haikuwebkit/LayoutTests/svg/custom/textPath-path-change2-patte...

17 lines
737 B
XML
Raw Permalink Normal View History

Bug 15799: textPath element does not re-render when referenced path changes https://bugs.webkit.org/show_bug.cgi?id=15799 Patch by Rob Buis <rwlbuis@webkit.org> on 2012-05-26 Reviewed by Nikolas Zimmermann. Source/WebCore: Support textPath updating to changes on the referenced path. To make this possible use the target reference functionality also used by SVGFEImageElement. Tests: svg/custom/textPath-change-id-expected.svg svg/custom/textPath-change-id-pattern-expected.svg svg/custom/textPath-change-id-pattern.svg svg/custom/textPath-change-id.svg svg/custom/textPath-change-id2-expected.svg svg/custom/textPath-change-id2-pattern-expected.svg svg/custom/textPath-change-id2-pattern.svg svg/custom/textPath-change-id2.svg svg/custom/textPath-change-reference-expected.svg svg/custom/textPath-change-reference-pattern-expected.svg svg/custom/textPath-change-reference-pattern.svg svg/custom/textPath-change-reference-using-baseval-expected.svg svg/custom/textPath-change-reference-using-baseval-pattern-expected.svg svg/custom/textPath-change-reference-using-baseval-pattern.svg svg/custom/textPath-change-reference-using-baseval.svg svg/custom/textPath-change-reference.svg svg/custom/textPath-change-reference2-expected.svg svg/custom/textPath-change-reference2-pattern-expected.svg svg/custom/textPath-change-reference2-pattern.svg svg/custom/textPath-change-reference2-using-baseval-expected.svg svg/custom/textPath-change-reference2-using-baseval-pattern-expected.svg svg/custom/textPath-change-reference2-using-baseval-pattern.svg svg/custom/textPath-change-reference2-using-baseval.svg svg/custom/textPath-change-reference2.svg svg/custom/textPath-insert-path-expected.svg svg/custom/textPath-insert-path-pattern-expected.svg svg/custom/textPath-insert-path-pattern.svg svg/custom/textPath-insert-path.svg svg/custom/textPath-modify-child-expected.svg svg/custom/textPath-modify-child-pattern-expected.svg svg/custom/textPath-modify-child-pattern.svg svg/custom/textPath-modify-child.svg svg/custom/textPath-path-change-expected.svg svg/custom/textPath-path-change-pattern-expected.svg svg/custom/textPath-path-change-pattern.svg svg/custom/textPath-path-change-using-svg-dom-expected.svg svg/custom/textPath-path-change-using-svg-dom-pattern-expected.svg svg/custom/textPath-path-change-using-svg-dom-pattern.svg svg/custom/textPath-path-change-using-svg-dom.svg svg/custom/textPath-path-change.svg svg/custom/textPath-path-change2-expected.svg svg/custom/textPath-path-change2-pattern-expected.svg svg/custom/textPath-path-change2-pattern.svg svg/custom/textPath-path-change2.svg svg/custom/textPath-remove-path-expected.svg svg/custom/textPath-remove-path-pattern-expected.svg svg/custom/textPath-remove-path-pattern.svg svg/custom/textPath-remove-path.svg svg/custom/textPath-set-id-expected.svg svg/custom/textPath-set-id.svg svg/custom/textPath-startoffset-expected.svg svg/custom/textPath-startoffset-pattern-expected.svg svg/custom/textPath-startoffset-pattern.svg svg/custom/textPath-startoffset.svg * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::~SVGTextPathElement): (WebCore): (WebCore::SVGTextPathElement::clearResourceReferences): (WebCore::SVGTextPathElement::svgAttributeChanged): (WebCore::SVGTextPathElement::buildPendingResource): (WebCore::SVGTextPathElement::insertedInto): (WebCore::SVGTextPathElement::removedFrom): * svg/SVGTextPathElement.h: LayoutTests: - textPath-path-change-id.svg, react to change of id attribute on referenced path (makes the xlink:href valid). - textPath-path-change-id2.svg, react to change of id attribute on referenced path (makes the xlink:href invalid). - textPath-path-set-id.svg, react to setting of id attribute on referenced path (makes the xlink:href valid). - textPath-change-reference.svg, <textPath> references existing <path>, change the xlink:href to a non-existing one. - textPath-change-reference-using-baseval.svg, <textPath> references existing <path>, change the xlink:href to a non-existing one using SVG DOM. - textPath-change-reference2.svg, <textPath> references non-existing <path>, change xlink:href to an existing one. - textPath-change-reference2-using-baseval.svg, <textPath> references non-existing <path>, change xlink:href to an existing one using SVG DOM. - textPath-insert-path.svg, <textPath> references non-existing <path>, <path> added dynamically. - textPath-modify-child.svg, react to change on textPath content. - textPath-path-change-using-svg-dom.svg, react to change on pathSegList of referenced path. - textPath-path-change.svg, react to change on d attribute of referenced path. - textPath-path-change2.svg, react to change on d attribute of path referenced by multiple <textPath>s. - textPath-remove-path.svg, <textPath> references existing <path>, <path> is removed from DOM. - textPath-startoffset.svg, react to startOffset attribute change on <textPath>. These tests are duplicated for <textPath> inside a <pattern>. * svg/custom/textPath-change-id-expected.svg: Added. * svg/custom/textPath-change-id-pattern-expected.svg: Added. * svg/custom/textPath-change-id-pattern.svg: Added. * svg/custom/textPath-change-id.svg: Added. * svg/custom/textPath-change-id2-expected.svg: Added. * svg/custom/textPath-change-id2-pattern-expected.svg: Added. * svg/custom/textPath-change-id2-pattern.svg: Added. * svg/custom/textPath-change-id2.svg: Added. * svg/custom/textPath-change-reference-expected.svg: Added. * svg/custom/textPath-change-reference-pattern-expected.svg: Added. * svg/custom/textPath-change-reference-pattern.svg: Added. * svg/custom/textPath-change-reference-using-baseval-expected.svg: Added. * svg/custom/textPath-change-reference-using-baseval-pattern-expected.svg: Added. * svg/custom/textPath-change-reference-using-baseval-pattern.svg: Added. * svg/custom/textPath-change-reference-using-baseval.svg: Added. * svg/custom/textPath-change-reference.svg: Added. * svg/custom/textPath-change-reference2-expected.svg: Added. * svg/custom/textPath-change-reference2-pattern-expected.svg: Added. * svg/custom/textPath-change-reference2-pattern.svg: Added. * svg/custom/textPath-change-reference2-using-baseval-expected.svg: Added. * svg/custom/textPath-change-reference2-using-baseval-pattern-expected.svg: Added. * svg/custom/textPath-change-reference2-using-baseval-pattern.svg: Added. * svg/custom/textPath-change-reference2-using-baseval.svg: Added. * svg/custom/textPath-change-reference2.svg: Added. * svg/custom/textPath-insert-path-expected.svg: Added. * svg/custom/textPath-insert-path-pattern-expected.svg: Added. * svg/custom/textPath-insert-path-pattern.svg: Added. * svg/custom/textPath-insert-path.svg: Added. * svg/custom/textPath-modify-child-expected.svg: Added. * svg/custom/textPath-modify-child-pattern-expected.svg: Added. * svg/custom/textPath-modify-child-pattern.svg: Added. * svg/custom/textPath-modify-child.svg: Added. * svg/custom/textPath-path-change-expected.svg: Added. * svg/custom/textPath-path-change-pattern-expected.svg: Added. * svg/custom/textPath-path-change-pattern.svg: Added. * svg/custom/textPath-path-change-using-svg-dom-expected.svg: Added. * svg/custom/textPath-path-change-using-svg-dom-pattern-expected.svg: Added. * svg/custom/textPath-path-change-using-svg-dom-pattern.svg: Added. * svg/custom/textPath-path-change-using-svg-dom.svg: Added. * svg/custom/textPath-path-change.svg: Added. * svg/custom/textPath-path-change2-expected.svg: Added. * svg/custom/textPath-path-change2-pattern-expected.svg: Added. * svg/custom/textPath-path-change2-pattern.svg: Added. * svg/custom/textPath-path-change2.svg: Added. * svg/custom/textPath-remove-path-expected.svg: Added. * svg/custom/textPath-remove-path-pattern-expected.svg: Added. * svg/custom/textPath-remove-path-pattern.svg: Added. * svg/custom/textPath-remove-path.svg: Added. * svg/custom/textPath-set-id-expected.svg: Added. * svg/custom/textPath-set-id.svg: Added. * svg/custom/textPath-startoffset-expected.svg: Added. * svg/custom/textPath-startoffset-pattern-expected.svg: Added. * svg/custom/textPath-startoffset-pattern.svg: Added. * svg/custom/textPath-startoffset.svg: Added. Canonical link: https://commits.webkit.org/105361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-05-26 11:38:37 +00:00
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runTest()">
<path id="thePath" d="M50 50 L 450 50" />
<pattern id="pat" patternUnits="userSpaceOnUse" x="0" y="0" width="400" height="400">
<text>
<textPath xlink:href="#thePath">This text should be ABOVE the other line.</textPath>
<textPath xlink:href="#thePath"><tspan dy="20">This text should be BELOW the other line.</tspan></textPath>
</text>
</pattern>
<rect width="400" height="400" fill="url(#pat)" stroke="black" stroke-width="1"/>
<script><![CDATA[
function runTest() {
var path = document.getElementById("thePath");
path.setAttribute("d", "M50 150 L 450 150");
}
]]></script>
</svg>