Closed Bug 672519 Opened 13 years ago Closed 13 years ago

Incorrect vertical alignment of tspan inside dominant-baseline

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: Martin.vGagern, Assigned: longsonr)

References

Details

(Whiteboard: [inbound])

Attachments

(2 files, 1 obsolete file)

Attached image 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
Attached patch hg changeset patch with test (obsolete) — Splinter Review
Assignee: nobody → longsonr
Attachment #547106 - Flags: review?(jwatt)
OS: Linux → All
Hardware: x86_64 → All
Version: 5 Branch → Trunk
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+
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
Whiteboard: [inbound]
Flags: in-testsuite+
http://hg.mozilla.org/mozilla-central/rev/7b25f48cc21b
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
See Also: → 897884
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: