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

@@ -4692,12 +4692,10 @@ nsRect PresShell::ClipListToRange(nsDisplayListBuilder* aBuilder,
// part of the selection. Then, append the wrapper to the top of the list.
// Otherwise, just delete the item and don't append it.
nsRect surfaceRect;
nsDisplayList tmpList;
nsDisplayItem* i;
while ((i = aList->RemoveBottom())) {
for (nsDisplayItem* i : aList->TakeItems()) {
if (i->GetType() == DisplayItemType::TYPE_CONTAINER) {
tmpList.AppendToTop(i);
aList->AppendToTop(i);
surfaceRect.UnionRect(
surfaceRect, ClipListToRange(aBuilder, i->GetChildren(), aRange));
continue;
@@ -4778,7 +4776,7 @@ nsRect PresShell::ClipListToRange(nsDisplayListBuilder* aBuilder,
// list, insert that as well
nsDisplayList* sublist = i->GetSameCoordinateSystemChildren();
if (itemToInsert || sublist) {
tmpList.AppendToTop(itemToInsert ? itemToInsert : i);
aList->AppendToTop(itemToInsert ? itemToInsert : i);
// if the item is a list, iterate over it as well
if (sublist)
surfaceRect.UnionRect(surfaceRect,
@@ -4789,9 +4787,6 @@ nsRect PresShell::ClipListToRange(nsDisplayListBuilder* aBuilder,
}
}
// now add all the items back onto the original list again
aList->AppendToTop(&tmpList);
return surfaceRect;
}