Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / event-attribute.html
blob7b4adea590af88a83c445b3de23678742f97b079
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <input onabort="1">
11 <script>
12 description('Test that setting event handlers with attribute works.');
14 var elementTags = ["img", "script", "video", "div", "form", "input"];
15 var eventNames = ["onclick", "oncontextmenu", "ondblclick", "onmousedown",
16 "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel",
17 "onfocus", "onblur", "onkeydown", "onkeypress", "onkeyup", "onscroll",
18 "onbeforecut", "oncut", "onbeforecopy", "oncopy", "onbeforepaste", "onpaste",
19 "ondragenter", "ondragover", "ondragleave", "ondrop", "ondragstart", "ondrag",
20 "ondragend", "onselectstart", "onsubmit", "onerror", "oninput", "oninvalid",
21 "ontouchstart", "ontouchmove", "ontouchend", "ontouchcancel",
22 "onwebkitfullscreenchange", "onwebkitfullscreenerror", "onabort", "onchange",
23 "onreset", "onselect", "onload"];
25 for (var i = 0; i < elementTags.length; i++) {
26 var element = document.createElement(elementTags[i]);
27 for (var j = 0; j < eventNames.length; j++) {
28 element.setAttribute(eventNames[j], "1");
29 shouldBe('/*' + elementTags[i] + '*/ typeof (element["' + eventNames[j] + '"])', '"function"');
33 </script>
34 </body>
35 </html>