|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=689564 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 689564</title> |
|
8 <script type="application/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=689564">Mozilla Bug 689564</a> |
|
13 <p id="display"></p> |
|
14 <div id="content" style="display: none"> |
|
15 |
|
16 </div> |
|
17 <pre id="test"> |
|
18 <script type="application/javascript"> |
|
19 |
|
20 /** Test for Bug 689564 **/ |
|
21 var div = document.createElement("div"); |
|
22 div.setAttribute("onclick", "div"); |
|
23 is(window.onclick, null, "div should not forward onclick"); |
|
24 is(div.onclick.toString(), "function onclick(event) {\ndiv\n}", |
|
25 "div should have an onclick handler"); |
|
26 |
|
27 div.setAttribute("onscroll", "div"); |
|
28 is(window.onscroll, null, "div should not forward onscroll"); |
|
29 is(div.onscroll.toString(), "function onscroll(event) {\ndiv\n}", |
|
30 "div should have an onscroll handler"); |
|
31 |
|
32 div.setAttribute("onpopstate", "div"); |
|
33 is(window.onpopstate, null, "div should not forward onpopstate"); |
|
34 is(div.onpopstate, null, "div should not have onpopstate handler"); |
|
35 |
|
36 var body = document.createElement("body"); |
|
37 body.setAttribute("onclick", "body"); |
|
38 is(window.onclick, null, "body should not forward onclick"); |
|
39 is(body.onclick.toString(), "function onclick(event) {\nbody\n}", |
|
40 "body should have an onclick handler"); |
|
41 body.setAttribute("onscroll", "body"); |
|
42 is(window.onscroll.toString(), "function onscroll(event) {\nbody\n}", |
|
43 "body should forward onscroll"); |
|
44 body.setAttribute("onpopstate", "body"); |
|
45 is(window.onpopstate.toString(), "function onpopstate(event) {\nbody\n}", |
|
46 "body should forward onpopstate"); |
|
47 |
|
48 var frameset = document.createElement("frameset"); |
|
49 frameset.setAttribute("onclick", "frameset"); |
|
50 is(window.onclick, null, "frameset should not forward onclick"); |
|
51 is(frameset.onclick.toString(), "function onclick(event) {\nframeset\n}", |
|
52 "frameset should have an onclick handler"); |
|
53 frameset.setAttribute("onscroll", "frameset"); |
|
54 is(window.onscroll.toString(), "function onscroll(event) {\nframeset\n}", |
|
55 "frameset should forward onscroll"); |
|
56 frameset.setAttribute("onpopstate", "frameset"); |
|
57 is(window.onpopstate.toString(), "function onpopstate(event) {\nframeset\n}", |
|
58 "frameset should forward onpopstate"); |
|
59 |
|
60 |
|
61 |
|
62 </script> |
|
63 </pre> |
|
64 </body> |
|
65 </html> |