OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
3 <title>Document.createElementNS</title> | 3 <title>Document.createElementNS</title> |
4 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-createelementns"> | 4 <link rel=help href="https://dom.spec.whatwg.org/#dom-document-createelementns"> |
5 <script src="/resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
6 <script src="/resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
7 <script src="Document-createElementNS.js"></script> | 7 <script src="Document-createElementNS.js"></script> |
8 <div id="log"></div> | 8 <div id="log"></div> |
9 <iframe src="/common/dummy.xml"></iframe> | 9 <iframe src="/common/dummy.xml"></iframe> |
10 <iframe src="/common/dummy.xhtml"></iframe> | 10 <iframe src="/common/dummy.xhtml"></iframe> |
11 <script> | 11 <script> |
12 var tests = createElementNS_tests.concat([ | 12 var tests = createElementNS_tests.concat([ |
13 /* Arrays with three elements: | 13 /* Arrays with three elements: |
14 * the namespace argument | 14 * the namespace argument |
15 * the qualifiedName argument | 15 * the qualifiedName argument |
16 * the expected exception, or null if none | 16 * the expected exception, or null if none |
17 */ | 17 */ |
18 ["", "", "INVALID_CHARACTER_ERR"], | 18 ["", "", "INVALID_CHARACTER_ERR"], |
19 [null, null, null], | |
20 [null, "", "INVALID_CHARACTER_ERR"], | 19 [null, "", "INVALID_CHARACTER_ERR"], |
21 [undefined, null, null], | |
22 [undefined, "", "INVALID_CHARACTER_ERR"], | 20 [undefined, "", "INVALID_CHARACTER_ERR"], |
23 ["http://example.com/", null, null], | 21 ["http://example.com/", null, null], |
24 ["http://example.com/", "", "INVALID_CHARACTER_ERR"], | 22 ["http://example.com/", "", "INVALID_CHARACTER_ERR"], |
25 ["/", null, null], | 23 ["/", null, null], |
26 ["/", "", "INVALID_CHARACTER_ERR"], | 24 ["/", "", "INVALID_CHARACTER_ERR"], |
27 ["http://www.w3.org/XML/1998/namespace", null, null], | 25 ["http://www.w3.org/XML/1998/namespace", null, null], |
28 ["http://www.w3.org/XML/1998/namespace", "", "INVALID_CHARACTER_ERR"], | 26 ["http://www.w3.org/XML/1998/namespace", "", "INVALID_CHARACTER_ERR"], |
29 ["http://www.w3.org/2000/xmlns/", null, "NAMESPACE_ERR"], | 27 ["http://www.w3.org/2000/xmlns/", null, "NAMESPACE_ERR"], |
30 ["http://www.w3.org/2000/xmlns/", "", "INVALID_CHARACTER_ERR"], | 28 ["http://www.w3.org/2000/xmlns/", "", "INVALID_CHARACTER_ERR"], |
31 ["foo:", null, null], | 29 ["foo:", null, null], |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 assert_equals(element.namespaceURI, null); | 215 assert_equals(element.namespaceURI, null); |
218 assert_equals(element.prefix, null); | 216 assert_equals(element.prefix, null); |
219 assert_equals(element.localName, "span"); | 217 assert_equals(element.localName, "span"); |
220 assert_equals(element.tagName, "span"); | 218 assert_equals(element.tagName, "span"); |
221 assert_true(element instanceof Node, "Should be a Node"); | 219 assert_true(element instanceof Node, "Should be a Node"); |
222 assert_true(element instanceof Element, "Should be an Element"); | 220 assert_true(element instanceof Element, "Should be an Element"); |
223 assert_false(element instanceof HTMLElement, "Should not be an HTMLElement"); | 221 assert_false(element instanceof HTMLElement, "Should not be an HTMLElement"); |
224 assert_false(element instanceof HTMLSpanElement, "Should not be an HTMLSpanEle
ment"); | 222 assert_false(element instanceof HTMLSpanElement, "Should not be an HTMLSpanEle
ment"); |
225 }, "empty string namespace"); | 223 }, "empty string namespace"); |
226 </script> | 224 </script> |
OLD | NEW |