|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=447736 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 447736</title> |
|
8 <script type="text/javascript" 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=447736">Mozilla Bug 447736</a> |
|
13 <p id="display"></p> |
|
14 <div id="content" style="display: none"> |
|
15 |
|
16 </div> |
|
17 <div id="secondTarget"></div> |
|
18 <pre id="test"> |
|
19 <script class="testbody" type="text/javascript"> |
|
20 |
|
21 /** Test for Bug 447736 **/ |
|
22 |
|
23 var loadEvent = null; |
|
24 window.addEventListener("load", |
|
25 function (evt) { |
|
26 is(evt.target, window.document, "Wrong target!"); |
|
27 is(evt.originalTarget, window.document, "Wrong originalTarget!"); |
|
28 ok(evt.isTrusted, "Event should be trusted!"); |
|
29 loadEvent = evt; |
|
30 setTimeout("st.dispatchEvent(loadEvent)", 0); |
|
31 }, true); |
|
32 |
|
33 var st = document.getElementById("secondTarget"); |
|
34 st.addEventListener("load", |
|
35 function (evt) { |
|
36 is(evt.target, st, "Wrong target! (2)"); |
|
37 is(evt.originalTarget, st, "Wrong originalTarget! (2)"); |
|
38 ok(!evt.isTrusted, "Event shouldn't be trusted anymore!"); |
|
39 SimpleTest.finish(); |
|
40 }, true); |
|
41 |
|
42 SimpleTest.waitForExplicitFinish(); |
|
43 </script> |
|
44 </pre> |
|
45 </body> |
|
46 </html> |
|
47 |