Bug 956513 - Have anchored chunk boundaries at both ends of a <textPath>.
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/956513-1-ref.svg
@@ -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>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/956513-1.svg
@@ -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>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1786,9 +1786,10 @@ fuzzy-if(cocoaWidget,1,40) == 928607-1.h
== 931464-1.html 931464-1-ref.html
== 931853.html 931853-ref.html
== 931853-quirks.html 931853-quirks-ref.html
fuzzy-if(OSX==10.6,2,30) == 933264-1.html 933264-1-ref.html
== 936670-1.svg 936670-1-ref.svg
== 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
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -4321,16 +4321,17 @@ SVGTextFrame::ResolvePositions(nsIConten
return aIndex;
}
if (aContent->Tag() == nsGkAtoms::textPath) {
// <textPath> elements are as if they are specified with x="0" y="0", but
// 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.
nsSVGElement* element = static_cast<nsSVGElement*>(aContent);
// Get x, y, dx, dy.
SVGUserUnitList x, y, dx, dy;
element->GetAnimatedLengthListValues(&x, &y, &dx, &dy);