OLD | NEW |
| (Empty) |
1 <html> | |
2 <body onload="startTest()"> | |
3 | |
4 <script src="../../resources/js-test.js"></script> | |
5 <script> | |
6 | |
7 description("This test checks that moving an element with an event handler from
one window (FrameHost) to another properly migrates the handler too."); | |
8 | |
9 var jsTestIsAsync = true; | |
10 var window2; | |
11 | |
12 function window2Loaded() { | |
13 shouldBe('window.internals.scrollEventHandlerCount(document)', '0'); | |
14 var div = window2.document.getElementById("div"); | |
15 window.document.adoptNode(div); | |
16 window.document.body.appendChild(div); | |
17 shouldBe('window.internals.scrollEventHandlerCount(document)', '1'); | |
18 | |
19 window2.close(); | |
20 finishJSTest(); | |
21 } | |
22 | |
23 function startTest() { | |
24 if (window.testRunner) { | |
25 testRunner.waitUntilDone(); | |
26 testRunner.setCanOpenWindows(); | |
27 } | |
28 window2 = window.open('data:text/html,<div id="div" onscroll="function() {}"
></div>'); | |
29 window2.addEventListener("load", window2Loaded, false); | |
30 } | |
31 | |
32 </script> | |
33 | |
34 </body> | |
35 </html> | |
OLD | NEW |