dynamic-text-attr-01.svg 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!--
  2. Any copyright is dedicated to the Public Domain.
  3. http://creativecommons.org/publicdomain/zero/1.0/
  4. -->
  5. <svg xmlns="http://www.w3.org/2000/svg"
  6. xmlns:xlink="http://www.w3.org/1999/xlink"
  7. class="reftest-wait"
  8. style="font: 16px sans-serif">
  9. <title>Testcase for modifying attributes on child text content elements</title>
  10. <text x="20" y="20" data-test="x=200">Test 1</text>
  11. <text x="20" y="40" data-test="y=60">Test 2</text>
  12. <text x="20" y="80" data-test="rotate=10">Test 3</text>
  13. <text>
  14. <tspan x="20" y="100" data-test="x=200">Test 4</tspan>
  15. </text>
  16. <text>
  17. <tspan x="20" y="120" data-test="y=140">Test 5</tspan>
  18. </text>
  19. <text>
  20. <tspan x="20" y="160" data-test="rotate=30">Test 6</tspan>
  21. </text>
  22. <path id="p" d="M 20,180 h 400"/>
  23. <text>
  24. <textPath xlink:href="#p" data-test="startOffset=180">Test 7</textPath>
  25. </text>
  26. <text x="20" y="200" textLength="100" lengthAdjust="spacing" data-test="lengthAdjust=spacingAndGlyphs">Test 8</text>
  27. <!-- We don't support textLength/lengthAdjust on child text content
  28. elements currently (bug 890692), so Test 9 doesn't really test
  29. anything at the moment. But it is the only animatable enumerated
  30. attribute value on text content elements to test. -->
  31. <text>
  32. <tspan x="20" y="220" textLength="100" lengthAdjust="spacing" data-test="lengthAdjust=spacingAndGlyphs">Test 9</tspan>
  33. </text>
  34. <script>
  35. window.addEventListener("MozReftestInvalidate", function() {
  36. [...document.querySelectorAll("[data-test]")].forEach(function(e) {
  37. var [name, value] = e.getAttribute("data-test").split("=");
  38. e.setAttribute(name, value);
  39. });
  40. document.documentElement.removeAttribute("class");
  41. }, false);
  42. </script>
  43. </svg>