зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1417841 - Don't reset <textPath> first character coordinate to 0 when an ancestor text content element specifies an explicit position coordinate. r=longsonr
MozReview-Commit-ID: KpJCuYwXxXC --HG-- extra : rebase_source : ab8cde36825c580fd77337aac6e8a7d7bcd47e95
This commit is contained in:
Родитель
dcb596244e
Коммит
180dccaf7d
|
@ -119,6 +119,8 @@ fuzzy-if(skiaContent,1,15) == textpath.svg textpath-ref.svg
|
|||
== textpath-multiline-2.svg textpath-multiline-2-ref.svg
|
||||
== textpath-after.svg textpath-after-ref.svg
|
||||
== textpath-after-anchor-end.svg textpath-after-anchor-end-ref.svg
|
||||
== textpath-reset-position.svg textpath-reset-position-ref.svg
|
||||
== textpath-inherit-position.svg textpath-inherit-position-ref.svg
|
||||
|
||||
== textLength.svg textLength-ref.svg
|
||||
fuzzy-if(skiaContent,1,200) == textLength-2.svg textLength-2-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">
|
||||
<g transform="translate(150,50)" style="font: 32px sans-serif">
|
||||
<path id="p" d="M 100,100 l 100,100"/>
|
||||
<text x="0 20 40 60 80">hello <textPath xlink:href="#p"><tspan x="50">there</tspan></textPath></text>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 431 B |
|
@ -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">
|
||||
<g transform="translate(150,50)" style="font: 32px sans-serif">
|
||||
<path id="p" d="M 100,100 l 100,100"/>
|
||||
<text x="0 20 40 60 80 100 50">hello <textPath xlink:href="#p">there</textPath></text>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 416 B |
|
@ -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">
|
||||
<g transform="translate(150,50)" style="font: 32px sans-serif">
|
||||
<path id="p" d="M 100,100 l 100,100"/>
|
||||
<text x="50">hello <textPath xlink:href="#p"><tspan x="0">there</tspan></textPath></text>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 419 B |
|
@ -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">
|
||||
<g transform="translate(150,50)" style="font: 32px sans-serif">
|
||||
<path id="p" d="M 100,100 l 100,100"/>
|
||||
<text x="50">hello <textPath xlink:href="#p">there</textPath></text>
|
||||
</g>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 398 B |
|
@ -8,7 +8,7 @@
|
|||
<path id="path" d="M20,20 C20,150 150,150 150,20" pathLength="100" transform="scale(2,1)" fill="none" stroke="black"/>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="lime"/>
|
||||
<text y="50">
|
||||
<text>
|
||||
<textPath xlink:href="#path" font-size="20" fill="red" startOffset="50">FAIL</textPath>
|
||||
</text>
|
||||
<rect x="160" y="80" width="100" height="60" fill="lime"/>
|
||||
|
|
До Ширина: | Высота: | Размер: 679 B После Ширина: | Высота: | Размер: 672 B |
|
@ -4581,15 +4581,22 @@ SVGTextFrame::ResolvePositionsForNode(nsIContent* aContent,
|
|||
}
|
||||
|
||||
if (aContent->IsSVGElement(nsGkAtoms::textPath)) {
|
||||
// <textPath> elements are as if they are specified with x="0" y="0", but
|
||||
// only if they actually have some text content.
|
||||
// <textPath> elements behave as if they have x="0" y="0" on them, but only
|
||||
// if there is not a value for the coordinates that got inherited from a
|
||||
// parent. We skip this if there is no text content, so that empty
|
||||
// <textPath>s don't interrupt the layout of text in the parent element.
|
||||
if (HasTextContent(aContent)) {
|
||||
if (MOZ_UNLIKELY(aIndex >= mPositions.Length())) {
|
||||
MOZ_ASSERT_UNREACHABLE("length of mPositions does not match characters "
|
||||
"found by iterating content");
|
||||
return false;
|
||||
}
|
||||
mPositions[aIndex].mPosition = gfxPoint();
|
||||
if (!mPositions[aIndex].IsXSpecified()) {
|
||||
mPositions[aIndex].mPosition.x = 0.0;
|
||||
}
|
||||
if (!mPositions[aIndex].IsYSpecified()) {
|
||||
mPositions[aIndex].mPosition.y = 0.0;
|
||||
}
|
||||
mPositions[aIndex].mStartOfChunk = true;
|
||||
}
|
||||
} else if (!aContent->IsSVGElement(nsGkAtoms::a)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче