dom/events/test/test_bug944011.html

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:21e126c836e1
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=944011
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 944011</title>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="application/javascript">
12
13 /** Test for Bug 944011 comment 24 - Event handlers should fire even if the
14 target comes from a non-current inner. **/
15 SimpleTest.waitForExplicitFinish();
16 var gLoadCount = 0;
17 function loaded() {
18 ++gLoadCount;
19 switch(gLoadCount) {
20 case 1:
21 ok(true, "Got first load");
22 oldBody = window[0].document.body;
23 oldBody.onclick = function() {
24 ok(true, "Got onclick");
25 SimpleTest.finish();
26 }
27 $('ifr').setAttribute('src', 'data:text/html,<html><body>Second frame</body></html>');
28 break;
29 case 2:
30 ok(true, "Got second load");
31 oldBody.dispatchEvent(new MouseEvent('click'));
32 break;
33 default:
34 ok(false, "Unexpected load");
35 SimpleTest.finish();
36 }
37 }
38
39
40 </script>
41 </head>
42 <body>
43 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=944011">Mozilla Bug 944011</a>
44 <p id="display"></p>
45 <div id="content" style="display: none">
46 <iframe id="ifr" onload="loaded();" src="data:text/html,<html><body>foo</body></html>"></iframe>
47 <div name="testTarget"></div>
48 </div>
49 <pre id="test">
50 </pre>
51 </body>
52 </html>

mercurial