Bug 1878772. Adjust assert about deleting a retained display list to take into account partial updates that were aborted mid way through due to complexity. r=mstange

We call RetainedDisplayListBuilder::PreProcessDisplayList, the list has four items (from bottom to top), a solid color item, a hit test item, an async zoom item, and a own layer item for a scrollbar frame. We process the first three and put them in mOldItems. We descend into the 3rd item because it has child items, we then hit this early return

https://searchfox.org/mozilla-central/rev/896042a1a71066254ceb5291f016ca3dbca21cb7/layout/painting/RetainedDisplayListBuilder.cpp#169

detecting if the merging process is getting too complicated and we return false indicating that we should give up on the partial update and do a full display list rebuild. Back up to the first level PreProcessDisplayList we hit his early return

https://searchfox.org/mozilla-central/rev/896042a1a71066254ceb5291f016ca3dbca21cb7/layout/painting/RetainedDisplayListBuilder.cpp#284

and we never process the fourth item so it's still in the list and we haven't moved it to mOldItems. We immdiately delete the list and return in AttemptPartialUpdate

https://searchfox.org/mozilla-central/rev/896042a1a71066254ceb5291f016ca3dbca21cb7/layout/painting/RetainedDisplayListBuilder.cpp#1592

The delete finds those 3 items in mOldItems and the one remaining item in the main list.

This seems okay to me, I think the assert should be adjusted to ignore this case.

Differential Revision: https://phabricator.services.mozilla.com/D200777
This commit is contained in:
Timothy Nikkel 2024-02-21 12:07:19 +00:00
parent eb8cbda22f
commit fb8edf128f

View file

@ -3570,7 +3570,7 @@ class RetainedDisplayList : public nsDisplayList {
for (OldItemInfo& i : mOldItems) {
if (i.mItem && i.mOwnsItem) {
i.mItem->Destroy(aBuilder);
MOZ_ASSERT(!GetBottom(),
MOZ_ASSERT(!GetBottom() || aBuilder->PartialBuildFailed(),
"mOldItems should not be owning items if we also have items "
"in the normal list");
}