foreignObject-zoom-01.svg 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. onload="startTest()" reftest-zoom="2" class="reftest-wait"
  7. style="width:50%; height:50%;">
  8. <title>Testcase for zoomed foreignObject</title>
  9. <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=484677 -->
  10. <style type="text/css">
  11. * { margin:0;height:100%;width:100% }
  12. </style>
  13. <foreignObject width="100%" height="100%">
  14. <html xmlns="http://www.w3.org/1999/xhtml">
  15. <body>
  16. <div id="div" style="width:20px;height:20px;background:yellow;"/>
  17. </body>
  18. </html>
  19. </foreignObject>
  20. <script type="text/javascript">
  21. function startTest() {
  22. document.addEventListener("MozReftestInvalidate", doTest, false);
  23. }
  24. function doTest() {
  25. var elem = document.elementFromPoint(25, 25);
  26. var div = document.getElementById("div");
  27. div.setAttribute("style", "background:" + ((elem == div) ? "red" : "lime") + ";");
  28. document.documentElement.removeAttribute("class");
  29. }
  30. </script>
  31. </svg>