Last Comment Bug 672519 - Incorrect vertical alignment of tspan inside dominant-baseline
: Incorrect vertical alignment of tspan inside dominant-baseline
Product: Core
Classification: Components
Component: SVG (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla8
Assigned To: Robert Longson
: Jet Villegas (:jet)
Depends on:
  Show dependency treegraph
Reported: 2011-07-19 08:52 PDT by Martin von Gagern
Modified: 2013-07-29 04:10 PDT (History)
2 users (show)
longsonr: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Test case (566 bytes, image/svg+xml)
2011-07-19 08:52 PDT, Martin von Gagern
no flags Details
hg changeset patch with test (2.07 KB, patch)
2011-07-20 08:44 PDT, Robert Longson
dholbert: review+
Details | Diff | Splinter Review
address review comment (2.67 KB, patch)
2011-07-31 08:46 PDT, Robert Longson
no flags Details | Diff | Splinter Review

Description User image Martin von Gagern 2011-07-19 08:52:01 PDT
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>

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.
Comment 1 User image Cameron McCormack (:heycam) (away 25 Feb–5 Mar) 2011-07-19 14:32:33 PDT
Agreed, I think the test should show all three tspans aligned on their central baseline.
Comment 2 User image Robert Longson 2011-07-20 08:44:27 PDT
Created attachment 547106 [details] [diff] [review]
hg changeset patch with test
Comment 3 User image Daniel Holbert [:dholbert] 2011-07-25 17:33:17 PDT
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
Comment 4 User image Robert Longson 2011-07-31 08:46:51 PDT
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.
Comment 6 User image Marco Bonardo [::mak] 2011-08-01 08:03:35 PDT

Note You need to log in before you can comment on or make changes to this bug.