OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/js-test.js"></script> | 2 <script src="../../resources/js-test.js"></script> |
3 <script> | 3 <script> |
4 var jsTestIsAsync = true; | 4 var jsTestIsAsync = true; |
5 | 5 |
6 description("Tests that document.defaultView on a detached document doesn't cras
h."); | 6 description("Tests that document.defaultView on a detached document doesn't cras
h."); |
7 | 7 |
8 var cachedWindow; | 8 var cachedWindow; |
9 var cachedDocument; | 9 var cachedDocument; |
10 var testFrameUnloaded = false; | 10 var testFrameUnloaded = false; |
(...skipping 22 matching lines...) Expand all Loading... |
33 // One way to satisfy this condition is to test the value of document.defaul
tView when removing | 33 // One way to satisfy this condition is to test the value of document.defaul
tView when removing |
34 // a DOM node that contains multiple subframes, since ChildFrameDisconnector
keeps a ref to the | 34 // a DOM node that contains multiple subframes, since ChildFrameDisconnector
keeps a ref to the |
35 // affected HTMLFrameOwnerElements (and consequently the Frame) on the stack
. | 35 // affected HTMLFrameOwnerElements (and consequently the Frame) on the stack
. |
36 var frameContainer = document.getElementById("frames"); | 36 var frameContainer = document.getElementById("frames"); |
37 frameContainer.parentNode.removeChild(frameContainer); | 37 frameContainer.parentNode.removeChild(frameContainer); |
38 } | 38 } |
39 | 39 |
40 function finishTest() | 40 function finishTest() |
41 { | 41 { |
42 shouldBeTrue("testFrameUnloaded"); | 42 shouldBeTrue("testFrameUnloaded"); |
43 shouldBeUndefined("cachedDocument.defaultView"); | 43 shouldBeNull("cachedDocument.defaultView"); |
44 finishJSTest(); | 44 finishJSTest(); |
45 } | 45 } |
46 </script> | 46 </script> |
47 <body onload="setupTest()"> | 47 <body onload="setupTest()"> |
48 <div id="frames"> | 48 <div id="frames"> |
49 <iframe id="testFrame" srcdoc="<script>window.onunload=function() { window.t
op.testFrameUnloaded = true; };</script>"></iframe> | 49 <iframe id="testFrame" srcdoc="<script>window.onunload=function() { window.t
op.testFrameUnloaded = true; };</script>"></iframe> |
50 </div> | 50 </div> |
51 </body> | 51 </body> |
OLD | NEW |