Bug 1714584 - Part 2: Remove nsDisplayList::RemoveBottom() r=mstange

Differential Revision: https://phabricator.services.mozilla.com/D138153
This commit is contained in:
Miko Mynttinen
2022-02-22 23:42:18 +00:00
parent 528f0d244b
commit 7bae3ee4f4
7 changed files with 30 additions and 58 deletions

View File

@@ -306,9 +306,7 @@ ScreenIntSize nsSubDocumentFrame::GetSubdocumentSize() {
static void WrapBackgroundColorInOwnLayer(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
nsDisplayList* aList) {
nsDisplayList tempItems;
nsDisplayItem* item;
while ((item = aList->RemoveBottom()) != nullptr) {
for (nsDisplayItem* item : aList->TakeItems()) {
if (item->GetType() == DisplayItemType::TYPE_BACKGROUND_COLOR) {
nsDisplayList tmpList(aBuilder);
tmpList.AppendToTop(item);
@@ -317,11 +315,8 @@ static void WrapBackgroundColorInOwnLayer(nsDisplayListBuilder* aBuilder,
&tmpList, aBuilder->CurrentActiveScrolledRoot(),
nsDisplayOwnLayerFlags::None, ScrollbarData{}, true, false);
}
if (item) {
tempItems.AppendToTop(item);
}
aList->AppendToTop(item);
}
aList->AppendToTop(&tempItems);
}
void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,