Use testRunner instead of layoutTestController in fast/doctypes, dom, dynamic, encodi...
[WebKit-https.git] / LayoutTests / fast / events / attribute-listener-extracted-from-frameless-doc-context-2.html
1 <html>
2 <body onload="test()">
3 <iframe src='data:text/html,<a id="a" href="#" onclick="document.write(window != top ? &apos;<p>FAIL</p>&apos; : &apos;<p>PASS</p>&apos;); return false">link</a>'></iframe>
4 <script>
5 if (window.testRunner) {
6     testRunner.dumpAsText();
7     testRunner.waitUntilDone();
8 }
9
10 function test()
11 {
12     var doc = frames[0].document;
13     var range=doc.createRange();
14     range.selectNodeContents(doc.body);
15     var frag=range.extractContents();
16     document.body.appendChild(frag);
17
18     frames[0].location = "data:text/html,";
19     frames[0].frameElement.onload = test2;
20 }
21
22 function test2()
23 {
24     var event = top.document.createEvent('MouseEvent');
25     event.initEvent('click', true, true);
26     top.document.getElementsByTagName('a')[0].dispatchEvent(event);
27     if (window.testRunner)
28         testRunner.notifyDone();
29 }
30 </script>
31 </body>
32 </html>