1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/events/test/test_bug689564.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,65 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=689564 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 689564</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=689564">Mozilla Bug 689564</a> 1.16 +<p id="display"></p> 1.17 +<div id="content" style="display: none"> 1.18 + 1.19 +</div> 1.20 +<pre id="test"> 1.21 +<script type="application/javascript"> 1.22 + 1.23 +/** Test for Bug 689564 **/ 1.24 +var div = document.createElement("div"); 1.25 +div.setAttribute("onclick", "div"); 1.26 +is(window.onclick, null, "div should not forward onclick"); 1.27 +is(div.onclick.toString(), "function onclick(event) {\ndiv\n}", 1.28 + "div should have an onclick handler"); 1.29 + 1.30 +div.setAttribute("onscroll", "div"); 1.31 +is(window.onscroll, null, "div should not forward onscroll"); 1.32 +is(div.onscroll.toString(), "function onscroll(event) {\ndiv\n}", 1.33 + "div should have an onscroll handler"); 1.34 + 1.35 +div.setAttribute("onpopstate", "div"); 1.36 +is(window.onpopstate, null, "div should not forward onpopstate"); 1.37 +is(div.onpopstate, null, "div should not have onpopstate handler"); 1.38 + 1.39 +var body = document.createElement("body"); 1.40 +body.setAttribute("onclick", "body"); 1.41 +is(window.onclick, null, "body should not forward onclick"); 1.42 +is(body.onclick.toString(), "function onclick(event) {\nbody\n}", 1.43 + "body should have an onclick handler"); 1.44 +body.setAttribute("onscroll", "body"); 1.45 +is(window.onscroll.toString(), "function onscroll(event) {\nbody\n}", 1.46 + "body should forward onscroll"); 1.47 +body.setAttribute("onpopstate", "body"); 1.48 +is(window.onpopstate.toString(), "function onpopstate(event) {\nbody\n}", 1.49 + "body should forward onpopstate"); 1.50 + 1.51 +var frameset = document.createElement("frameset"); 1.52 +frameset.setAttribute("onclick", "frameset"); 1.53 +is(window.onclick, null, "frameset should not forward onclick"); 1.54 +is(frameset.onclick.toString(), "function onclick(event) {\nframeset\n}", 1.55 + "frameset should have an onclick handler"); 1.56 +frameset.setAttribute("onscroll", "frameset"); 1.57 +is(window.onscroll.toString(), "function onscroll(event) {\nframeset\n}", 1.58 + "frameset should forward onscroll"); 1.59 +frameset.setAttribute("onpopstate", "frameset"); 1.60 +is(window.onpopstate.toString(), "function onpopstate(event) {\nframeset\n}", 1.61 + "frameset should forward onpopstate"); 1.62 + 1.63 + 1.64 + 1.65 +</script> 1.66 +</pre> 1.67 +</body> 1.68 +</html>