OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../js/resources/js-test-pre.js"></script> | 3 <script src="../js/resources/js-test-pre.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 'Comment', | |
20 'Document', | 19 'Document', |
21 'DocumentType', | 20 'DocumentType', |
22 'Element', | 21 'Element', |
23 'Entity', | 22 'Entity', |
24 'EntityReference', | 23 'EntityReference', |
25 'HTMLDocument', | 24 'HTMLDocument', |
26 'Node', | 25 'Node', |
27 'Notation', | 26 'Notation', |
28 'ProcessingInstruction', | 27 'ProcessingInstruction', |
29 'Text', | 28 'Text', |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 'NodeIterator', | 126 'NodeIterator', |
128 'RGBColor', | 127 'RGBColor', |
129 'Screen', | 128 'Screen', |
130 'TreeWalker', | 129 'TreeWalker', |
131 'XPathExpression', | 130 'XPathExpression', |
132 'Worker' | 131 'Worker' |
133 ]; | 132 ]; |
134 | 133 |
135 // These objects should have a working constructor. | 134 // These objects should have a working constructor. |
136 var objects_constructor = [ | 135 var objects_constructor = [ |
| 136 'Comment', |
137 'DOMParser', | 137 'DOMParser', |
138 'DocumentFragment', | 138 'DocumentFragment', |
139 'Range', | 139 'Range', |
140 'XMLHttpRequest', | 140 'XMLHttpRequest', |
141 'XMLSerializer', | 141 'XMLSerializer', |
142 'XPathEvaluator', | 142 'XPathEvaluator', |
143 'XSLTProcessor' | 143 'XSLTProcessor' |
144 ]; | 144 ]; |
145 | 145 |
146 // These objects should have no constructor. | 146 // These objects should have no constructor. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 element.id = "element"; | 209 element.id = "element"; |
210 element.name = obj; | 210 element.name = obj; |
211 shouldBe("TryAllocate('" + obj + "')", | 211 shouldBe("TryAllocate('" + obj + "')", |
212 "'[object " + objects_different_constructor[obj] + "]'"); | 212 "'[object " + objects_different_constructor[obj] + "]'"); |
213 element.name = "element_name"; | 213 element.name = "element_name"; |
214 } | 214 } |
215 </script> | 215 </script> |
216 <script src="../js/resources/js-test-post.js"></script> | 216 <script src="../js/resources/js-test-post.js"></script> |
217 </body> | 217 </body> |
218 </html> | 218 </html> |
OLD | NEW |