Do not destroy display items during display list building
Categories
(Core :: Web Painting, defect, P2)
Tracking
()
People
(Reporter: mikokm, Unassigned)
References
(Blocks 1 open bug)
Details
This is wasteful and makes it difficult to reason about display item lifetimes. In particular this is problematic for retained display lists, because it makes it hard to retain data in frames if their ancestor frames can destroy that data.
Callers of nsDisplayItem::Destroy(): 1, 2
Callers of nsDisplayList::DeleteAll(): 3,4
Callers of nsDisplayListSet::DeleteAll(): 5,6
Comment 1•3 years ago
|
||
The two callers to nsDisplayItem::Destroy() are text overflow and PresShell::ClipListToRange.
text-overflow could potentially be rewritten to be done at reflow time instead of display list time.
ClipListToRange only seems used by dragging and dropping, perhaps we can implement it differently as well.
Comment 2•3 years ago
|
||
ClipListToRange came from https://bugzilla.mozilla.org/show_bug.cgi?id=178513.
WebKit/Chrome implement something like this using paint behaviour flags e.g. https://searchfox.org/wubkat/rev/78bfb4f405f50bd751536c8b9c026455b00ef936/Source/WebCore/rendering/RenderLayer.cpp#3434
i.e. basically only draw what we need to instead of removing things after painting.
Description
•