Closed Bug 839956 Opened 7 years ago Closed 7 years ago

underlines in SVG text drawn with the wrong size


(Core :: SVG, defect)

Not set





(Reporter: heycam, Assigned: heycam)




(2 files, 1 obsolete file)

With svg.text.css-frames.enabled true, text decorations don't seem to be rendered with the correct thickness.  Try opening layout/reftests/svg/text/simple-underline.txt and pressing {Cmd,Ctrl}+Plus and notice that the underline stays at its original thickness.
Duplicate of this bug: 842144
See too where the decoration is basically invisible when the SVG document is shown embedded in the html page but appears when you select view in tab.
Also if you view the strike through decoration is not positioned correctly.

If I disable font size scaling by making UpdateFontSizeScaleFactor return early, then the decorations all look OK.
Blocks: svgtext
Summary: underlines in SVG text drawn with the wrong size when full page zoom is active → underlines in SVG text drawn with the wrong size
Attached patch patch for size (obsolete) — Splinter Review
The font size scale factor should not have taken the CSS:device pixel ratio into account.  This fixes the decoration thickness, but not the position of the strike through decoration, which I'll look into with a separate patch.
Assignee: nobody → cam
Attachment #735686 - Flags: review?(longsonr)
Attached patch patch for sizeSplinter Review
Attachment #735686 - Attachment is obsolete: true
Attachment #735686 - Flags: review?(longsonr)
Attachment #735687 - Flags: review?(longsonr)
Blocks: 839957
Attachment #735687 - Flags: review?(longsonr) → review+
Text decoration size/position is currently only correct when mFontSizeScaleFactor is 1.  The patch above just ensures that we get 1 for normal-ish font-sizes on text that hasn't been scaled.
Here's the solution for that.  We weren't getting in to the nsLayoutUtils::GetInflationFor code that looks at the SVG text's font size scale factor.  So get it here, when we get the inflated metrics for text decorations.
Attachment #736155 - Flags: review?(roc)
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.