gradient-live-01d.svg 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <svg xmlns="http://www.w3.org/2000/svg"
  2. xmlns:xlink="http://www.w3.org/1999/xlink"
  3. class="reftest-wait" font-size="80">
  4. <!-- Tests that gradients are live to stop addition. -->
  5. <script>
  6. document.addEventListener("MozReftestInvalidate", addBlueStop, false);
  7. function addBlueStop()
  8. {
  9. var stop = document.createElementNS("http://www.w3.org/2000/svg", "stop");
  10. stop.setAttribute("stop-color", "#0000dd");
  11. stop.setAttribute("offset", "0.5");
  12. document.getElementById("grad1").insertBefore(stop, document.getElementById("magenta"));
  13. document.documentElement.removeAttribute('class');
  14. }
  15. </script>
  16. <linearGradient id="grad1" gradientUnits="objectBoundingBox" x1="0" y1="0" x2="1" y2="0">
  17. <stop id="green" stop-color="#00dd00" offset="0"/>
  18. <stop id="magenta" stop-color="magenta" offset="1"/>
  19. </linearGradient>
  20. <rect x="20" y="20" width="440" height="80" fill="url(#grad1)" />
  21. <linearGradient id="grad2" xlink:href="#grad1"/>
  22. <rect x="20" y="150" width="440" height="80" fill="url(#grad2)" />
  23. <text x="20" y="300" width="440" height="80" fill="url(#grad1)">gradiation</text>
  24. <text x="20" y="400" width="440" height="80" fill="url(#grad2)">gradiation</text>
  25. </svg>