suspend-04.svg 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. <?xml version="1.0"?>
  2. <!--
  3. Any copyright is dedicated to the Public Domain.
  4. http://creativecommons.org/licenses/publicdomain/
  5. -->
  6. <svg xmlns="http://www.w3.org/2000/svg" class="reftest-wait">
  7. <title>Test that suspendRedraw doesn't apply after the end of a script</title>
  8. <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=615146 -->
  9. <script type="text/javascript">
  10. <![CDATA[
  11. document.addEventListener("MozReftestInvalidate", doTest, false);
  12. setTimeout(doTest, 4000); // fallback for running outside reftest
  13. function doTest() {
  14. var svg = document.documentElement;
  15. setTimeout(function() {
  16. svg.suspendRedraw(10000);
  17. var r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
  18. r.setAttribute("width", "100%");
  19. r.setAttribute("height", "100%");
  20. r.setAttribute("fill", "lime");
  21. svg.appendChild(r);
  22. svg.removeAttribute("class");
  23. }, 50);
  24. }
  25. ]]>
  26. </script>
  27. <rect width="100%" height="100%" fill="red"/>
  28. </svg>