test_bug626262.html (1302B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=626262 5 --> 6 <head> 7 <title>Test for Bug 626262</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=626262">Mozilla Bug 626262</a> 13 <p id="display"><iframe id="f" srcdoc="1"></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 626262 */ 21 SimpleTest.waitForExplicitFinish(); 22 23 addLoadEvent(function() { 24 var iframe = document.getElementById("f"); 25 var frameDoc = iframe.contentDocument; 26 var parent = frameDoc.createElementNS("http://www.w3.org/1999/xhtml", "div"); 27 28 function a() 29 { 30 window.removeEventListener("DOMNodeRemoved", arguments.callee); 31 document.adoptNode(parent); 32 } 33 34 var text = document.createTextNode(" "); 35 document.documentElement.appendChild(text); 36 37 var thrown = false; 38 try { 39 window.addEventListener("DOMNodeRemoved", a); 40 parent.appendChild(text); 41 } 42 catch (e) { 43 thrown = true; 44 } 45 46 ok(!thrown, "changing ownerDocument during adoptNode should not throw"); 47 48 SimpleTest.finish(); 49 }); 50 51 </script> 52 </pre> 53 </body> 54 </html>