3 <link rel=
"stylesheet" href=
"../js/resources/js-test-style.css">
4 <script src=
"../js/resources/js-test-pre.js"></script>
5 <style id=
"style" media=
"screen">
8 clip: rect(
0,
0,
1,
1);
9 content: counter(dummy, square);
14 <p id=
"description"></p>
15 <div id=
"console"></div>
16 <iframe id=
"xmlframe" onload=
"frameLoaded()" style=
"height:0px" src=
"data:application/xhtml+xml,<?xml version='1.0' encoding='UTF-8'?><body/>"></iframe>
19 if (window
.layoutTestController
)
20 layoutTestController
.waitUntilDone();
22 function jsWrapperClass(node
)
26 var string
= Object
.prototype.toString
.apply(node
);
27 return string
.substr(8, string
.length
- 9);
30 function tagJSWrapperClass(tagName
)
32 return jsWrapperClass(document
.createElement(tagName
));
35 function tagJSWrapperPrototypeClass(tagName
)
37 return jsWrapperClass(document
.createElement(tagName
).__proto__
);
40 function tagJSWrapperConstructorClass(tagName
)
42 return jsWrapperClass(document
.createElement(tagName
).constructor);
45 function testTag(tagName
, className
, prototypeName
, constructorName
)
48 prototypeName
= className
+ "Prototype";
50 constructorName
= className
+ "Constructor";
51 shouldBe("tagJSWrapperClass('" + tagName
+ "')", "'" + className
+ "'");
52 shouldBe("tagJSWrapperPrototypeClass('" + tagName
+ "')", "'" + prototypeName
+ "'");
53 shouldBe("tagJSWrapperConstructorClass('" + tagName
+ "')", "'" + constructorName
+ "'");
56 function test(expression
, className
, prototypeName
, constructorName
)
59 prototypeName
= className
+ "Prototype";
61 constructorName
= className
+ "Constructor";
62 shouldBe("jsWrapperClass(" + expression
+ ")", "'" + className
+ "'");
63 shouldBe("jsWrapperClass(" + expression
+ ".__proto__)", "'" + prototypeName
+ "'");
64 shouldBe("jsWrapperClass(" + expression
+ ".constructor)", "'" + constructorName
+ "'");
69 // NOTE: This is a sister test to platform/mac/fast/dom/wrapper-class-objc.html which test the Objective-C wrapper classes. Update accordingly.
70 description("This tests wrapper class names for JavaScript.");
72 stylesheet
= document
.getElementById("style").sheet
;
73 root
= document
.documentElement
;
74 xmlDocument
= document
.getElementById("xmlframe").contentDocument
;
79 test("document.createAttribute()", "Attr");
80 test("document.createComment()", "Comment");
81 test("document.createDocumentFragment()", "DocumentFragment");
82 test("document.implementation", "DOMImplementation");
83 test("root.attributes", "NamedNodeMap");
84 test("document.createNodeIterator(root, 0, null, false)", "NodeIterator");
85 test("document.getElementsByTagName('div')", "NodeList");
86 test("document.createRange()", "Range");
87 test("document.createTextNode()", "Text");
88 test("document.createTreeWalker(root, 0, null, false)", "TreeWalker");
94 test("xmlDocument", "Document");
95 test("xmlDocument.createCDATASection()", "CDATASection");
96 test("xmlDocument.createElementNS('x', 'x', 'x')", "Element");
97 test("xmlDocument.createEntityReference()", "EntityReference");
98 test("xmlDocument.createProcessingInstruction()", "ProcessingInstruction");
104 test("document.createEvent('Event')", "Event");
105 test("document.createEvent('KeyboardEvent')", "KeyboardEvent");
106 test("document.createEvent('MouseEvent')", "MouseEvent");
107 test("document.createEvent('MutationEvent')", "MutationEvent");
108 test("document.createEvent('OverflowEvent')", "OverflowEvent");
109 test("document.createEvent('TextEvent')", "TextEvent");
110 test("document.createEvent('UIEvent')", "UIEvent");
111 test("document.createEvent('WheelEvent')", "WheelEvent");
117 test("document.styleSheets", "StyleSheetList");
118 test("stylesheet", "CSSStyleSheet");
119 test("stylesheet.cssRules", "CSSRuleList");
120 test("stylesheet.cssRules.item(0)", "CSSStyleRule");
121 test("stylesheet.cssRules.item(0).style", "CSSStyleDeclaration");
122 test("stylesheet.cssRules.item(0).style.getPropertyCSSValue('color')", "CSSPrimitiveValue");
123 test("stylesheet.cssRules.item(0).style.getPropertyCSSValue('color').getRGBColorValue()", "RGBColor");
124 test("stylesheet.cssRules.item(0).style.getPropertyCSSValue('clip').getRectValue()", "Rect");
125 test("stylesheet.cssRules.item(0).style.getPropertyCSSValue('content')", "CSSValueList");
126 test("stylesheet.cssRules.item(0).style.getPropertyCSSValue('content').item(0).getCounterValue()", "Counter");
127 test("stylesheet.media", "MediaList");
133 test("document.createExpression('//*', document.createNSResolver(document))", "XPathExpression");
134 test("document.evaluate('//*', document, document.createNSResolver(document), 0, null)", "XPathResult");
140 test("window", "DOMWindow");
146 test("root.children", "HTMLCollection");
147 test("document", "HTMLDocument");
148 test("document.createElement('select').options", "HTMLOptionsCollection");
151 debug('HTML Elements');
154 testTag("a", "HTMLAnchorElement");
155 testTag("abbr", "HTMLElement");
156 testTag("acronym", "HTMLElement");
157 testTag("address", "HTMLElement");
158 testTag("applet", "HTMLAppletElement");
159 testTag("area", "HTMLAreaElement");
160 testTag("b", "HTMLElement");
161 testTag("base", "HTMLBaseElement");
162 testTag("basefont", "HTMLBaseFontElement");
163 testTag("bdo", "HTMLElement");
164 testTag("big", "HTMLElement");
165 testTag("blockquote", "HTMLBlockquoteElement");
166 testTag("body", "HTMLBodyElement");
167 testTag("br", "HTMLBRElement");
168 testTag("button", "HTMLButtonElement");
169 testTag("canvas", "HTMLCanvasElement");
170 testTag("caption", "HTMLTableCaptionElement");
171 testTag("center", "HTMLElement");
172 testTag("cite", "HTMLElement");
173 testTag("code", "HTMLElement");
174 testTag("col", "HTMLTableColElement");
175 testTag("colgroup", "HTMLTableColElement");
176 testTag("dd", "HTMLElement");
177 testTag("del", "HTMLModElement");
178 testTag("dfn", "HTMLElement");
179 testTag("dir", "HTMLDirectoryElement");
180 testTag("div", "HTMLDivElement");
181 testTag("dl", "HTMLDListElement");
182 testTag("dt", "HTMLElement");
183 testTag("em", "HTMLElement");
184 testTag("embed", "HTMLEmbedElement");
185 testTag("fieldset", "HTMLFieldSetElement");
186 testTag("font", "HTMLFontElement");
187 testTag("form", "HTMLFormElement");
188 testTag("frame", "HTMLFrameElement");
189 testTag("frameset", "HTMLFrameSetElement");
190 testTag("head", "HTMLHeadElement");
191 testTag("h1", "HTMLHeadingElement");
192 testTag("h2", "HTMLHeadingElement");
193 testTag("h3", "HTMLHeadingElement");
194 testTag("h4", "HTMLHeadingElement");
195 testTag("h5", "HTMLHeadingElement");
196 testTag("h6", "HTMLHeadingElement");
197 testTag("hr", "HTMLHRElement");
198 testTag("html", "HTMLHtmlElement");
199 testTag("i", "HTMLElement");
200 testTag("iframe", "HTMLIFrameElement");
201 testTag("image", "HTMLImageElement");
202 testTag("img", "HTMLImageElement");
203 testTag("input", "HTMLInputElement");
204 testTag("ins", "HTMLModElement");
205 testTag("isindex", "HTMLIsIndexElement");
206 testTag("kbd", "HTMLElement");
207 testTag("keygen", "HTMLSelectElement");
208 testTag("label", "HTMLLabelElement");
209 testTag("layer", "HTMLElement");
210 testTag("legend", "HTMLLegendElement");
211 testTag("li", "HTMLLIElement");
212 testTag("link", "HTMLLinkElement");
213 testTag("listing", "HTMLPreElement");
214 testTag("map", "HTMLMapElement");
215 testTag("marquee", "HTMLMarqueeElement");
216 testTag("menu", "HTMLMenuElement");
217 testTag("meta", "HTMLMetaElement");
218 testTag("nobr", "HTMLElement");
219 testTag("noembed", "HTMLElement");
220 testTag("noframes", "HTMLElement");
221 testTag("nolayer", "HTMLElement");
222 testTag("noscript", "HTMLElement");
223 testTag("object", "HTMLObjectElement");
224 testTag("ol", "HTMLOListElement");
225 testTag("optgroup", "HTMLOptGroupElement");
226 testTag("option", "HTMLOptionElement");
227 testTag("p", "HTMLParagraphElement");
228 testTag("param", "HTMLParamElement");
229 testTag("plaintext", "HTMLElement");
230 testTag("pre", "HTMLPreElement");
231 testTag("q", "HTMLQuoteElement");
232 testTag("s", "HTMLElement");
233 testTag("samp", "HTMLElement");
234 testTag("script", "HTMLScriptElement");
235 testTag("select", "HTMLSelectElement");
236 testTag("small", "HTMLElement");
237 testTag("span", "HTMLElement");
238 testTag("strike", "HTMLElement");
239 testTag("strong", "HTMLElement");
240 testTag("style", "HTMLStyleElement");
241 testTag("sub", "HTMLElement");
242 testTag("sup", "HTMLElement");
243 testTag("table", "HTMLTableElement");
244 testTag("tbody", "HTMLTableSectionElement");
245 testTag("td", "HTMLTableCellElement");
246 testTag("textarea", "HTMLTextAreaElement");
247 testTag("tfoot", "HTMLTableSectionElement");
248 testTag("th", "HTMLTableCellElement");
249 testTag("thead", "HTMLTableSectionElement");
250 testTag("title", "HTMLTitleElement");
251 testTag("tr", "HTMLTableRowElement");
252 testTag("tt", "HTMLElement");
253 testTag("u", "HTMLElement");
254 testTag("ul", "HTMLUListElement");
255 testTag("var", "HTMLElement");
256 testTag("wbr", "HTMLElement");
257 testTag("xmp", "HTMLPreElement");
268 // WebKitCSSKeyframeRule
269 // WebKitCSSKeyframesRule
275 // the various window sub-objects
277 // what else is missing?
279 if (window
.layoutTestController
)
280 layoutTestController
.notifyDone();
283 function frameLoaded()