Avoid calling IsFixedPosFrameInDisplayPort for every abs/fixed child of a given frame
Categories
(Core :: Web Painting, enhancement)
Tracking
()
People
(Reporter: tnikkel, Assigned: tnikkel)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(1 file)
Assignee | ||
Comment 1•8 months ago
|
||
The DisplayPortUtils::IsFixedPosFrameInDisplayPort call in OutOfFlowDisplayData::ComputeVisibleRectForFrame is actually a significant chunk of our painting time when running sp3.
We have this call tree
nsDisplayListBuilder::MarkFramesForDisplayList
nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay
OutOfFlowDisplayData::ComputeVisibleRectForFrame
nsDisplayListBuilder::MarkFramesForDisplayList iterates every abs/fixed child of a frame, and the value of IsFixedPosFrameInDisplayPort is the same for every child of a given frame, so we can compute IsFixedPosFrameInDisplayPort once in MarkFramesForDisplayList and then pass it down. In fact its actually quicker to compute in MarkFramesForDisplayList because we don't need to check any style data since we know that any absolute child of the root frame has to be a true fixed pos frame (as opposed to a frame with position: fixed style inside a transform) (the sole regular child of the root frame can't appear in MarkFramesForDisplayList since its only called on the absolute/fixed child list).
This change then has the knock on effect of having to compute the aIsFixedPosInDisplayPort bool later when we actually descend into this abs/fixed child frames. But this actually presents another win as we can check the PLACEHOLDER_FOR_FIXEDPOS frame state bit on the placeholder in place of checking the style.
Updated•7 months ago
|
Updated•7 months ago
|
Description
•