dynamic-rect-04.xhtml 925 B

123456789101112131415161718192021222324252627282930313233
  1. <?xml version="1.0"?>
  2. <!--
  3. Any copyright is dedicated to the Public Domain.
  4. http://creativecommons.org/publicdomain/zero/1.0/
  5. -->
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <title>Testcase reference file dynamic svg creation</title>
  9. <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=438867 -->
  10. <script>
  11. function m() {
  12. var SVG_NS = "http://www.w3.org/2000/svg";
  13. var svg = document.createElementNS(SVG_NS, 'svg');
  14. svg.style.position = 'absolute';
  15. svg.style.left = '0px';
  16. svg.style.top = '0px';
  17. svg.style.width = '100%';
  18. svg.style.height = '100%';
  19. document.body.appendChild(svg);
  20. var rect = document.createElementNS(SVG_NS, "rect");
  21. rect.setAttribute('width', '100%');
  22. rect.setAttribute('height', '100%');
  23. rect.setAttribute('fill', 'lime');
  24. svg.appendChild(rect);
  25. }
  26. </script>
  27. </head>
  28. <body onload="m();">
  29. <hr style="clear: both;"/>
  30. </body>
  31. </html>