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