Closed
Bug 957770
Opened 12 years ago
Closed 11 years ago
text-decoration:underline is not positioned correctly in SVG text
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: balatskova, Assigned: heycam)
Details
(Whiteboard: [good first verify])
Attachments
(2 files)
844 bytes,
image/svg+xml
|
Details | |
6.38 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Steps to reproduce:
Firefox version 26.0: Text underline is not rendered correctly in svg text element when text is scaled or when text-rendering="geometricPrecision" is used as an attribute. See attached example.
Actual results:
The underline is misplaced
- positioned above the text when text has text-rendering="geometricPrecision"
- moves up when text is scaled (see attached example)
Expected results:
The underline should be positioned under the text.
Comment 1•12 years ago
|
||
The two lines of the testcase may be different underlying bugs. (I can reproduce both, in Linux nightly).
Note that the issue with scaling (in the second line of the attached testcase), the problem goes away if I remove the dominant-baseline="text-before-edge" attribute.
Updated•12 years ago
|
OS: Windows 7 → All
Hardware: x86_64 → All
Reporter | ||
Comment 2•12 years ago
|
||
Thank you. I see that removing the dominant-baseline attribute makes the underline to appear in the correct place for both cases, but the text shifts. Using the dominant-baseline attribute is important for our product. If you experiment with dominant-baseline, you will see that the text underline is misplaced for "mathematical", "central", "middle" values as well as for "text-before-edge".
Comment 3•12 years ago
|
||
heycam, this seems up your alley -- do you have cycles to take a look at this?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(cam)
Assignee | ||
Comment 4•12 years ago
|
||
Yeah I'll take a look.
Status: NEW → ASSIGNED
Flags: needinfo?(cam)
QA Contact: cam
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → cam
QA Contact: cam
Assignee | ||
Comment 5•12 years ago
|
||
Just like we added GetFontInflationForTextDecorations in nsTextFrame.cpp to wrap the nsLayoutUtils::GetFontInflationInner calls within the decoration painting code so that it can return the SVGTextFrame's font size scale factor, we need to do the same in nsLineLayout's calls to GetFontInflationInner when it is doing vertical alignment.
Attachment #8358198 -
Flags: review?(roc)
Attachment #8358198 -
Flags: review?(roc) → review+
Comment 6•12 years ago
|
||
Comment on attachment 8358198 [details] [diff] [review]
patch
>
>+static float
>+GetInflationForVerticalAlignment(nsIFrame* aFrame,
>+ nscoord aInflationMinFontSize)
>+{
>+ if (aFrame->IsSVGText()) {
>+ const nsIFrame* container = aFrame;
>+ while (container->GetType() != nsGkAtoms::svgTextFrame) {
>+ container = container->GetParent();
>+ }
Use nsLayoutUtils::GetClosestFrameOfType here?
Assignee | ||
Comment 7•12 years ago
|
||
Comment 8•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Updated•11 years ago
|
Whiteboard: [good first verify]
You need to log in
before you can comment on or make changes to this bug.
Description
•