OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 <div id="element" name="element_name"></div> | 6 <div id="element" name="element_name"></div> |
7 <script> | 7 <script> |
8 description('This test checks that all but a handful of dom constructors throw e
xceptions, and the rest return reasonable objects. It also tests that those cons
tructors have higher precedence than a document element with the same ID or name
.'); | 8 description('This test checks that all but a handful of dom constructors throw e
xceptions, and the rest return reasonable objects. It also tests that those cons
tructors have higher precedence than a document element with the same ID or name
.'); |
9 | 9 |
10 var element = document.getElementById("element"); | 10 var element = document.getElementById("element"); |
11 | 11 |
12 // These objects should throw an exception when their constructor is called | 12 // These objects should throw an exception when their constructor is called |
13 // with no arguments. (Some of them may have working constructors that require | 13 // with no arguments. (Some of them may have working constructors that require |
14 // arguments to be valid.) | 14 // arguments to be valid.) |
15 var objects_exception = [ | 15 var objects_exception = [ |
16 'Attr', | 16 'Attr', |
17 'CharacterData', | 17 'CharacterData', |
18 'CDATASection', | 18 'CDATASection', |
19 'Document', | 19 'Document', |
20 'DocumentType', | 20 'DocumentType', |
21 'Element', | 21 'Element', |
22 'EventTarget', | 22 'EventTarget', |
23 'HTMLDocument', | 23 'HTMLDocument', |
24 'Node', | 24 'Node', |
25 'Notation', | |
26 'ProcessingInstruction', | 25 'ProcessingInstruction', |
27 'HTMLAllCollection', | 26 'HTMLAllCollection', |
28 'HTMLAnchorElement', | 27 'HTMLAnchorElement', |
29 'HTMLAppletElement', | 28 'HTMLAppletElement', |
30 'HTMLAreaElement', | 29 'HTMLAreaElement', |
31 'HTMLBaseElement', | 30 'HTMLBaseElement', |
32 'HTMLBodyElement', | 31 'HTMLBodyElement', |
33 'HTMLBRElement', | 32 'HTMLBRElement', |
34 'HTMLButtonElement', | 33 'HTMLButtonElement', |
35 'HTMLCanvasElement', | 34 'HTMLCanvasElement', |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 "'[object " + objects_different_constructor[obj] + "]'"); | 205 "'[object " + objects_different_constructor[obj] + "]'"); |
207 element.id = "element"; | 206 element.id = "element"; |
208 element.name = obj; | 207 element.name = obj; |
209 shouldBe("TryAllocate('" + obj + "')", | 208 shouldBe("TryAllocate('" + obj + "')", |
210 "'[object " + objects_different_constructor[obj] + "]'"); | 209 "'[object " + objects_different_constructor[obj] + "]'"); |
211 element.name = "element_name"; | 210 element.name = "element_name"; |
212 } | 211 } |
213 </script> | 212 </script> |
214 </body> | 213 </body> |
215 </html> | 214 </html> |
OLD | NEW |