rootElement-null-01.svg 732 B

123456789101112131415161718192021222324252627282930
  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" version="1.1"
  6. onload="handleLoad(evt);">
  7. <title>Testcase for accessing null rootContent</title>
  8. <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=365611 -->
  9. <script type="application/ecmascript">
  10. <![CDATA[
  11. function handleLoad(event)
  12. {
  13. var root = document.removeChild(document.documentElement);
  14. if (document.documentElement == null) { // this shouldn't crash
  15. document.appendChild(root);
  16. document.getElementById('rect').setAttribute('fill', 'lime');
  17. }
  18. }
  19. ]]>
  20. </script>
  21. <rect id="rect" width="100%" height="100%" fill="red"/>
  22. </svg>