foreignObject-change-transform-01.svg 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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 changing the 'transform' on foreignObject</title>
  9. <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=369911 -->
  10. <script type="application/javascript">
  11. // The foreignObject is inverted so that it is outside the viewport.
  12. // After the rect has rendered the transform on the
  13. // foreignObject is removed and the green div should fill the viewport.
  14. document.addEventListener("MozReftestInvalidate", doTest, false);
  15. setTimeout(doTest, 4000); // fallback for running outside reftest
  16. function doTest() {
  17. document.getElementById('fo').setAttribute('transform', '');
  18. document.documentElement.removeAttribute('class');
  19. }
  20. </script>
  21. <rect width="100%" height="100%" fill="red"/>
  22. <foreignObject id="fo" width="100%" height="100%" transform="scale(-1)">
  23. <html:div style="display:block;width:100%;height:100%;background:lime;"/>
  24. </foreignObject>
  25. </svg>