test_bug486741.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=486741
  5. -->
  6. <head>
  7. <title>Test for Bug 486741</title>
  8. <script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
  9. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  10. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  11. </head>
  12. <body>
  13. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=486741">Mozilla Bug 486741</a>
  14. <p id="display"><iframe id="f"></iframe></p>
  15. <div id="content" style="display: none">
  16. </div>
  17. <pre id="test">
  18. <script type="application/javascript">
  19. /** Test for Bug 486741 **/
  20. SimpleTest.waitForExplicitFinish();
  21. addLoadEvent(function() {
  22. var d = $("f").contentDocument;
  23. var root = d.documentElement;
  24. is(root.tagName, "HTML", "Unexpected root");
  25. d.open();
  26. isnot(d.documentElement, root, "Shouldn't have the old root element");
  27. d.write("Test");
  28. d.close();
  29. isnot(d.documentElement, root, "Still shouldn't have the old root element");
  30. is(d.documentElement.tagName, "HTML", "Unexpected new root after write");
  31. SimpleTest.finish();
  32. });
  33. </script>
  34. </pre>
  35. </body>
  36. </html>