Bug 956513 - Have anchored chunk boundaries at both ends of a <textPath>.

This commit is contained in:
Cameron McCormack 2014-01-05 20:59:50 +11:00
parent f1aecc5ff3
commit 714312744f
4 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,10 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path id="p" d="M0 100h400"/>
<path d="M0 102h400" stroke="blue" stroke-width="1px"/>
<circle cx="200" cy="102" r="3" fill="blue"/>
<text><textPath font-size="16px" text-anchor="middle" startOffset="50%" xlink:href="#p">Text should be centered on the line.</textPath></text>
</svg>

After

Width:  |  Height:  |  Size: 492 B

View File

@ -0,0 +1,10 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path id="p" d="M0 100h400"/>
<path d="M0 102h400" stroke="blue" stroke-width="1px"/>
<circle cx="200" cy="102" r="3" fill="blue"/>
<text xml:space="preserve"> <textPath font-size="16px" text-anchor="middle" startOffset="50%" xlink:href="#p">Text should be centered on the line.</textPath> </text>
</svg>

After

Width:  |  Height:  |  Size: 515 B

View File

@ -1791,4 +1791,5 @@ fuzzy-if(OSX==10.6,2,30) == 933264-1.html 933264-1-ref.html
== 941940-1.html 941940-1-ref.html
== 942017.html 942017-ref.html
== 942672-1.html 942672-1-ref.html
== 956513-1.svg 956513-1-ref.svg
== 944291-1.html 944291-1-ref.html

View File

@ -4326,6 +4326,7 @@ SVGTextFrame::ResolvePositions(nsIContent* aContent,
// only if they actually have some text content.
if (HasTextContent(aContent)) {
mPositions[aIndex].mPosition = gfxPoint();
mPositions[aIndex].mStartOfChunk = true;
}
} else if (aContent->Tag() != nsGkAtoms::a) {
// We have a text content element that can have x/y/dx/dy/rotate attributes.