Closed Bug 876323 Opened 11 years ago Closed 11 years ago

nsSVGTextFrame2 should avoid recomputing mPositions when COORD_CONTEXT_CHANGED unless percentages were used

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: heycam, Assigned: heycam)

References

Details

(Keywords: perf)

Attachments

(2 files)

When nsSVGTextFrame2::NotifySVGChanged is called with COORD_CONTEXT_CHANGED, we can avoid calling NotifyGlyphMetricsChange unless we actually did use percentage values in the text positioning attributes.
Attached file test
For example you wouldn't expect this to need to call DoGlyphPositioning on each resize.
Attached patch patchSplinter Review
Assignee: nobody → cam
Status: NEW → ASSIGNED
Attachment #754330 - Flags: review?(jwatt)
Blocks: 876186
Should use a frame state bit for the flag (as well as mPositioningDirty)
There's bug 865901 for mPositioningDirty. How about we do them both at once over there. (We're at least not increasing the size of the frame object by adding this second one.)
Keywords: perf
Comment on attachment 754330 [details] [diff] [review] patch Nice. Regarding "mPositioningUsesPercentages", I think you should put the word "may" in there so that it's clear to readers that it's not a certainty even without reading the doc comment. Other than that, can you add a reftest along the lines of layout/reftests/svg/stroke-width-percentage-03.xhtml where we check that things work when the content window changes size? (Changing the width/height attributes on an <svg> will cause reflow that may mask bugs with content area resizing which won't necessarily cause reflow.) Given the "Percentage values beyond the number of addressable characters, however, do not influence mPositioningUsesPercentages" comment, it would also be good to have similar tests that add text after MozReftestInvalidate making an "out of bounds percentage" have something to apply to, and make sure that works.
Attachment #754330 - Flags: review?(jwatt) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: