dom/events/test/test_bug689564.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial