Open Bug 872846 Opened 11 years ago Updated 2 months ago

Stop FrameNeedsReflow() calls for non-display SVG dirtying displayed ancestors

Categories

(Core :: SVG, defect)

defect

Tracking

()

People

(Reporter: jwatt, Unassigned)

Details

(Keywords: perf, Whiteboard: [jwatt:invalidation])

Attachments

(1 obsolete file)

Right now when style changes etc. cause FrameNeedsReflow() to be called on descendants of non-display SVG, the dirty marking up the ancestor chain continues out of the non-display frames into the displayed frames, resulting in needless reflow work happening.

For example, when the font-size changes on a <tspan> in <text> in a <pattern>, nsStyleFont::CalcFontDifference is called under ReResolveStyleContext causing a restyle with the NS_STYLE_HINT_REFLOW hint. We end up in nsCSSFrameConstructor::ProcessRestyledFrames where StyleChangeReflow() is called for the tspan frame, which calls FrameNeedsReflow passing NS_FRAME_IS_DIRTY. That sets NS_FRAME_IS_DIRTY on the tspan and NS_FRAME_HAS_DIRTY_CHILDREN on its ancestors, most likely all the way up to the root frame.

We should stop FrameNeedsReflow from doing this.
We could solve this with a bit flag on nsSVGPatternFrame etc. which would make FrameNeedsReflow halt. Note that this would be slightly different to the NS_FRAME_REFLOW_ROOT flag, since we wouldn't actually want to add anything to PresShell::mDirtyRoots.
Whiteboard: [jwatt:invalidation]
Is this kind of like what I have currently in nsSVGTextFrame2::ScheduleReflowSVGNonDisplayText?
Severity: normal → S3
Assignee: nobody → longsonr
Status: NEW → ASSIGNED
Attachment #9372713 - Attachment is obsolete: true
Assignee: longsonr → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: