| 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 'ProcessingInstruction', | 25 'ProcessingInstruction', |
| 26 'HTMLAllCollection', | 26 'HTMLAllCollection', |
| 27 'HTMLAnchorElement', | 27 'HTMLAnchorElement', |
| 28 'HTMLAppletElement', | |
| 29 'HTMLAreaElement', | 28 'HTMLAreaElement', |
| 30 'HTMLBaseElement', | 29 'HTMLBaseElement', |
| 31 'HTMLBodyElement', | 30 'HTMLBodyElement', |
| 32 'HTMLBRElement', | 31 'HTMLBRElement', |
| 33 'HTMLButtonElement', | 32 'HTMLButtonElement', |
| 34 'HTMLCanvasElement', | 33 'HTMLCanvasElement', |
| 35 'HTMLDirectoryElement', | 34 'HTMLDirectoryElement', |
| 36 'HTMLDivElement', | 35 'HTMLDivElement', |
| 37 'HTMLDListElement', | 36 'HTMLDListElement', |
| 38 'HTMLEmbedElement', | 37 'HTMLEmbedElement', |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 "'[object " + objects_different_constructor[obj] + "]'"); | 197 "'[object " + objects_different_constructor[obj] + "]'"); |
| 199 element.id = "element"; | 198 element.id = "element"; |
| 200 element.name = obj; | 199 element.name = obj; |
| 201 shouldBe("TryAllocate('" + obj + "')", | 200 shouldBe("TryAllocate('" + obj + "')", |
| 202 "'[object " + objects_different_constructor[obj] + "]'"); | 201 "'[object " + objects_different_constructor[obj] + "]'"); |
| 203 element.name = "element_name"; | 202 element.name = "element_name"; |
| 204 } | 203 } |
| 205 </script> | 204 </script> |
| 206 </body> | 205 </body> |
| 207 </html> | 206 </html> |
| OLD | NEW |