Incorrect vertical alignment of tspan inside dominant-baseline

RESOLVED FIXED in mozilla8

Status

()

Core
SVG
RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: Martin von Gagern, Assigned: Robert Longson)

Tracking

Trunk
mozilla8
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [inbound])

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Created attachment 546800 [details]
Test case

The attached file does not render as I'd have expected in FF 5.

<text dominant-baseline="central">
  <tspan>foo </tspan>
  <tspan>bar </tspan>
  <tspan>baz</tspan>
</text>

I'd have expected all three tspans to be aligned along the same "central" baseline. But for reasons unknon, it appears that each tspan except the first has its "central" baseline aligned to the "alphabetic" baseline of its predecessor. Makes vertical centering a real problem.
Agreed, I think the test should show all three tspans aligned on their central baseline.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

6 years ago
Created attachment 547106 [details] [diff] [review]
hg changeset patch with test
Assignee: nobody → longsonr
Attachment #547106 - Flags: review?(jwatt)
(Assignee)

Updated

6 years ago
OS: Linux → All
Hardware: x86_64 → All
Version: 5 Branch → Trunk
(Assignee)

Updated

6 years ago
Attachment #547106 - Flags: review?(jwatt) → review?(dholbert)
Comment on attachment 547106 [details] [diff] [review]
hg changeset patch with test

>+++ b/layout/reftests/svg/reftest.list
>@@ -204,6 +204,7 @@ fails-if(Android) random-if(gtk2Widget) 
> == text-layout-02.svg text-layout-02-ref.svg
> == text-layout-03.svg text-layout-03-ref.svg
> == text-layout-04.svg text-layout-04-ref.svg
>+== text-layout-05.svg pass.svg
[...]
>+++ b/layout/reftests/svg/text-layout-05.svg
[...]
>+  <text x="20" y="200" dominant-baseline="central"
>+        font-family="monospace" font-size="50px"><tspan>foo </tspan><tspan>bar </tspan><tspan>baz</tspan></text>
>+  <!-- cover where we expect the text to be -->
>+  <rect x="20" y="178" width="330" height="40" fill="lime"/>

I think we could test this much more robustly if we just compared against a reference that has the <tspan>'s removed.  (i.e. just using a <text> node in the reference case)

Could you change the test (or add another test) that does that?

r=me with that
Attachment #547106 - Flags: review?(dholbert) → review+
(Assignee)

Comment 4

6 years ago
Created attachment 549659 [details] [diff] [review]
address review comment

I was expecting this not to work due to subpixel positioning differences but I seem to be wrong.

http://tbpl.mozilla.org/?tree=Try&rev=8c780666adab
Attachment #547106 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Whiteboard: [inbound]
(Assignee)

Updated

6 years ago
Flags: in-testsuite+
(Assignee)

Comment 5

6 years ago
pushed http://hg.mozilla.org/integration/mozilla-inbound/rev/7b25f48cc21b
http://hg.mozilla.org/mozilla-central/rev/7b25f48cc21b
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8

Updated

4 years ago
See Also: → bug 897884
You need to log in before you can comment on or make changes to this bug.