1 description("This tests what event handler attributes are available on what objects.");
3 var elementAndDocumentProperties
= [
4 "onabort", "onblur", "onchange", "onclick", "oncontextmenu", "ondblclick", "ondrag", "ondragend",
5 "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "onerror", "onfocus", "oninput",
6 "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", "onmousemove", "onmouseout",
7 "onmouseover", "onmouseup", "onmousewheel", "onscroll", "onselect", "onsubmit",
10 // "oncanplay", "oncanplaythrough", "ondurationchange", "onemptied", "onended", "onformchange",
11 // "onforminput", "oninvalid", "onloadeddata", "onloadedmetadata", "onloadstart", "onpause",
12 // "onplay", "onplaying", "onprogress", "onratechange", "onreadystatechange", "onseeked", "onseeking",
13 // "onshow", "onstalled", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting",
16 "onbeforecut", "oncut", "onbeforecopy", "oncopy", "onbeforepaste", "onpaste", "onreset", "onsearch",
20 var bodyAndFrameSetProperties
= [
21 "onbeforeunload", "onmessage", "onoffline", "ononline", "onresize", "onstorage", "onunload", "onblur",
22 "onerror", "onfocus", "onload",
24 // Not implemented yet.
25 // "onafterprint", "onbeforeprint", "onhashchange", "onpopstate", "onredo", "onundo"
28 var svgAnimationElementProperties
= [
29 "onbegin", "onend", "onrepeat"
33 debug("Test Element");
34 var element
= document
.createElement("div");
35 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
36 shouldBeTrue("'" + elementAndDocumentProperties
[i
] + "' in element");
39 debug("\nTest Document");
40 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
41 shouldBeTrue("'" + elementAndDocumentProperties
[i
] + "' in document");
44 debug("\nTest Window");
45 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
46 shouldBeTrue("'" + elementAndDocumentProperties
[i
] + "' in window");
49 debug("\nTest Text Node");
50 var textNode
= document
.createTextNode("text");
51 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
52 shouldBeFalse("'" + elementAndDocumentProperties
[i
] + "' in textNode");
55 debug("\nTest Attribute");
56 var attribute
= document
.createAttribute("attr");
57 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
58 shouldBeFalse("'" + elementAndDocumentProperties
[i
] + "' in attribute");
61 debug("\nTest HTMLBodyElement");
62 var body
= document
.body
;
63 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
64 shouldBeTrue("'" + elementAndDocumentProperties
[i
] + "' in body");
66 for (var i
= 0; i
< bodyAndFrameSetProperties
.length
; ++i
) {
67 shouldBeTrue("'" + bodyAndFrameSetProperties
[i
] + "' in body");
70 debug("\nTest HTMLFrameSetElement");
71 var frameSet
= document
.createElement("frameset");
72 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
73 shouldBeTrue("'" + elementAndDocumentProperties
[i
] + "' in frameSet");
75 for (var i
= 0; i
< bodyAndFrameSetProperties
.length
; ++i
) {
76 shouldBeTrue("'" + bodyAndFrameSetProperties
[i
] + "' in frameSet");
79 debug("\nTest SVGPathElement");
80 var pathelement
= document
.createElementNS("http://www.w3.org/2000/svg", "path");
81 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
82 shouldBeTrue("'" + elementAndDocumentProperties
[i
] + "' in pathelement");
84 for (var i
= 0; i
< svgAnimationElementProperties
.length
; ++i
) {
85 shouldBeFalse("'" + svgAnimationElementProperties
[i
] + "' in pathelement");
88 debug("\nTest SVGSVGElement");
89 var svgelement
= document
.implementation
.createDocument("http://www.w3.org/2000/svg", "svg", null).documentElement
;
90 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
91 shouldBeTrue("'" + elementAndDocumentProperties
[i
] + "' in svgelement");
93 for (var i
= 0; i
< svgAnimationElementProperties
.length
; ++i
) {
94 shouldBeFalse("'" + svgAnimationElementProperties
[i
] + "' in svgelement");
97 debug("\nTest SVGAnimationElement");
98 var animateelement
= document
.createElementNS("http://www.w3.org/2000/svg", "animate");
99 for (var i
= 0; i
< elementAndDocumentProperties
.length
; ++i
) {
100 shouldBeTrue("'" + elementAndDocumentProperties
[i
] + "' in animateelement");
102 for (var i
= 0; i
< svgAnimationElementProperties
.length
; ++i
) {
103 shouldBeTrue("'" + svgAnimationElementProperties
[i
] + "' in animateelement");