foreignObject-move-repaint-01.svg 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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:html="http://www.w3.org/1999/xhtml"
  7. class="reftest-wait">
  8. <title>Testcase for repaint of the area previously covered by a foreignObject</title>
  9. <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=369992 -->
  10. <script type="application/javascript">
  11. // The green rect is initially covered by the red div. After the div
  12. // has rendered the foreignObject (and thus div) is moved out
  13. // of the viewport which should then be filled by the green rect as a result.
  14. document.addEventListener("MozReftestInvalidate", doTest, false);
  15. setTimeout(doTest, 4000); // fallback for running outside reftest
  16. function doTest() {
  17. document.getElementById('fo').setAttribute('y', '100%');
  18. document.documentElement.removeAttribute('class');
  19. }
  20. </script>
  21. <rect width="100%" height="100%" fill="red"/>
  22. <!-- Create the "pass" rect using a foreignObject so the testcase doesn't
  23. seem to pass if foreignObject is not supported -->
  24. <foreignObject width="100%" height="100%">
  25. <html:div style="display:block;width:100%;height:100%;background:lime;"/>
  26. </foreignObject>
  27. <foreignObject id="fo" width="100%" height="100%">
  28. <html:div style="display:block;width:100%;height:100%;background:red;"/>
  29. </foreignObject>
  30. </svg>