Bug 672519 - dominant-baseline applied multiple times for tspan. r=dholbert

This commit is contained in:
Robert Longson 2011-07-31 19:36:40 +01:00
parent 4419b304b5
commit a41a7ca959
4 changed files with 28 additions and 1 deletions

View File

@ -204,6 +204,7 @@ fails-if(Android) random-if(gtk2Widget) != text-language-01.xhtml text-language-
== 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 text-layout-05-ref.svg
== text-scale-01.svg text-scale-01-ref.svg
== text-stroke-scaling-01.svg text-stroke-scaling-01-ref.svg
== stroke-linecap-square-w-zero-length-segs-01.svg pass.svg

View File

@ -0,0 +1,13 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Reference to check that dominant-baseline works for tspan</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=672519 -->
<rect width="100%" height="100%" fill="lime"/>
<text x="20" y="200" dominant-baseline="central"
font-family="monospace" font-size="50px">foo bar baz</text>
</svg>

After

Width:  |  Height:  |  Size: 479 B

View File

@ -0,0 +1,13 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg">
<title>Testcase to check that dominant-baseline works for tspan</title>
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=672519 -->
<rect width="100%" height="100%" fill="lime"/>
<text x="20" y="200" dominant-baseline="central"
font-family="monospace" font-size="50px"><tspan>foo </tspan><tspan>bar </tspan><tspan>baz</tspan></text>
</svg>

After

Width:  |  Height:  |  Size: 523 B

View File

@ -1063,7 +1063,7 @@ nsSVGGlyphFrame::SetGlyphPosition(gfxPoint *aPosition, PRBool aForceGlobalTransf
}
gfxFloat y = (textPath || yCount <= 1) ? aPosition->y : yList[yCount - 1];
aPosition->MoveTo(x, y - GetBaselineOffset(metricsScale));
aPosition->MoveTo(x, y);
gfxFloat pathScale = 1.0;
if (textPath)