1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
7 <p id=
"description"></p>
8 <div id=
"console"></div>
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"');