1 createElementNS tests from mozilla, attached to webkit bug 16833
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
7 PASS createElementNS(, )
8 PASS createElementNS(null, )
9 PASS createElementNS(, null)
10 PASS createElementNS(null, null)
11 PASS createElementNS(null, ""); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided is empty.
12 PASS createElementNS("", null)
13 PASS createElementNS("", ""); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided is empty.
14 PASS createElementNS(null, "<div>"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('<div>') contains the invalid name-start character '<'.
15 PASS createElementNS(null, "0div"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('0div') contains the invalid name-start character '0'.
16 PASS createElementNS(null, "di v"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('di v') contains the invalid character ' '.
17 PASS createElementNS(null, "di<v"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('di<v') contains the invalid character '<'.
18 PASS createElementNS(null, "-div"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('-div') contains the invalid name-start character '-'.
19 PASS createElementNS(null, ".div"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('.div') contains the invalid name-start character '.'.
20 PASS createElementNS("http://example.com/", "<div>"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('<div>') contains the invalid name-start character '<'.
21 PASS createElementNS("http://example.com/", "0div"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('0div') contains the invalid name-start character '0'.
22 PASS createElementNS("http://example.com/", "di<v"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('di<v') contains the invalid character '<'.
23 PASS createElementNS("http://example.com/", "-div"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('-div') contains the invalid name-start character '-'.
24 PASS createElementNS("http://example.com/", ".div"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('.div') contains the invalid name-start character '.'.
25 PASS createElementNS(null, ":div"); threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix.
26 PASS createElementNS(null, "div:"); threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('div:') has an empty local name.
27 PASS createElementNS("http://example.com/", ":div"); threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix.
28 PASS createElementNS("http://example.com/", "div:"); threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('div:') has an empty local name.
29 PASS createElementNS(null, "d:iv"); threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The namespace URI provided ('') is not valid for the qualified name provided ('d:iv').
30 PASS createElementNS(null, "a:b:c"); valid XML name, invalid QName; threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a:b:c') contains multiple colons.
31 PASS createElementNS("http://example.com/", "a:b:c"); valid XML name, invalid QName; threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a:b:c') contains multiple colons.
32 PASS createElementNS(null, "a::c"); valid XML name, invalid QName; threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a::c') contains multiple colons.
33 PASS createElementNS("http://example.com/", "a::c"); valid XML name, invalid QName; threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a::c') contains multiple colons.
34 PASS createElementNS("http://example.com/", "a:0"); valid XML name, not a valid QName; threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a:0') contains the invalid name-start character '0'.
35 PASS createElementNS("http://example.com/", "0:a"); 0 at start makes it not a valid XML name; threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('0:a') contains the invalid name-start character '0'.
36 PASS createElementNS("http://example.com/", "a:_")
37 FAIL createElementNS("http://example.com/", "a:ெ"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (but still a valid XML name, hence not INVALID_CHARACTER_ERR); expected NAMESPACE_ERR, threw INVALID_CHARACTER_ERR
38 PASS createElementNS("http://example.com/", "ெ:a"); non-ASCII character after colon is CombiningChar, which is NCNameChar but not (Letter | "_") so invalid at start of NCName (Gecko chooses to throw NAMESPACE_ERR here, but either is valid as this is both an invalid XML name and an invalid QName); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('ெ:a') contains the invalid name-start character 'ெ'.
39 PASS createElementNS("http://example.com/", "a:aெ")
40 PASS createElementNS("http://example.com/", "aெ:a")
41 PASS createElementNS("http://example.com/", "xml:test"); binding xml prefix wrong; threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The namespace URI provided ('http://example.com/') is not valid for the qualified name provided ('xml:test').
42 PASS createElementNS("http://example.com/", "xmlns:test"); binding xmlns prefix wrong; threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The namespace URI provided ('http://example.com/') is not valid for the qualified name provided ('xmlns:test').
43 PASS createElementNS("http://www.w3.org/2000/xmlns/", "x:test"); binding namespace namespace to wrong prefix; threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The namespace URI provided ('http://www.w3.org/2000/xmlns/') is not valid for the qualified name provided ('x:test').
44 PASS createElementNS("http://www.w3.org/2000/xmlns/", "xmlns:test")
45 PASS createElementNS("http://www.w3.org/XML/1998/namespace", "xml:test")
46 PASS createElementNS("http://www.w3.org/XML/1998/namespace", "x:test")
48 PASS createElement(null)
49 PASS createElement(""); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.
50 PASS createElement("<div>"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('<div>') is not a valid name.
51 PASS createElement("0div"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('0div') is not a valid name.
52 PASS createElement("di v"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('di v') is not a valid name.
53 PASS createElement("di<v"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('di<v') is not a valid name.
54 PASS createElement("-div"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('-div') is not a valid name.
55 PASS createElement(".div"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('.div') is not a valid name.
56 PASS createElement(":"); valid XML name, invalid QName
57 PASS createElement(":div"); valid XML name, invalid QName
58 PASS createElement("div:"); valid XML name, invalid QName
59 PASS createElement("d:iv")
60 PASS createElement("a:b:c"); valid XML name, invalid QName
61 PASS createElement("a::c"); valid XML name, invalid QName
62 PASS createElement("a::c:"); valid XML name, invalid QName
63 PASS createElement("a:0"); valid XML name, not a valid QName
64 PASS createElement("0:a"); 0 at start makes it not a valid XML name; threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('0:a') is not a valid name.
65 PASS createElement("a:_")
66 PASS createElement("a:ெ"); non-ASCII character after colon is CombiningChar, which is valid in pre-namespace XML
67 PASS createElement("ெ:a"); not a valid start character; threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('ெ:a') is not a valid name.
68 PASS createElement("a:aெ")
69 PASS createElement("aெ:a")
70 PASS createElement("xml:test")
71 PASS createElement("xmlns:test")
72 PASS createElement("x:test")
73 PASS createElement("xmlns:test")
74 PASS createElement("SOAP-ENV:Body")
75 XHTML createElement tests:
77 PASS createElement(null)
78 PASS createElement(""); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.
79 PASS createElement("<div>"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('<div>') is not a valid name.
80 PASS createElement("0div"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('0div') is not a valid name.
81 PASS createElement("di v"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('di v') is not a valid name.
82 PASS createElement("di<v"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('di<v') is not a valid name.
83 PASS createElement("-div"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('-div') is not a valid name.
84 PASS createElement(".div"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('.div') is not a valid name.
85 PASS createElement(":"); valid XML name, invalid QName
86 PASS createElement(":div"); valid XML name, invalid QName
87 PASS createElement("div:"); valid XML name, invalid QName
88 PASS createElement("d:iv")
89 PASS createElement("a:b:c"); valid XML name, invalid QName
90 PASS createElement("a::c"); valid XML name, invalid QName
91 PASS createElement("a::c:"); valid XML name, invalid QName
92 PASS createElement("a:0"); valid XML name, not a valid QName
93 PASS createElement("0:a"); 0 at start makes it not a valid XML name; threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('0:a') is not a valid name.
94 PASS createElement("a:_")
95 PASS createElement("a:ெ"); non-ASCII character after colon is CombiningChar, which is valid in pre-namespace XML
96 PASS createElement("ெ:a"); not a valid start character; threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('ெ:a') is not a valid name.
97 PASS createElement("a:aெ")
98 PASS createElement("aெ:a")
99 PASS createElement("xml:test")
100 PASS createElement("xmlns:test")
101 PASS createElement("x:test")
102 PASS createElement("xmlns:test")
103 PASS createElement("SOAP-ENV:Body")
104 XML createElement tests:
106 PASS createElement(null)
107 PASS createElement(""); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('') is not a valid name.
108 PASS createElement("<div>"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('<div>') is not a valid name.
109 PASS createElement("0div"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('0div') is not a valid name.
110 PASS createElement("di v"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('di v') is not a valid name.
111 PASS createElement("di<v"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('di<v') is not a valid name.
112 PASS createElement("-div"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('-div') is not a valid name.
113 PASS createElement(".div"); threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('.div') is not a valid name.
114 PASS createElement(":"); valid XML name, invalid QName
115 PASS createElement(":div"); valid XML name, invalid QName
116 PASS createElement("div:"); valid XML name, invalid QName
117 PASS createElement("d:iv")
118 PASS createElement("a:b:c"); valid XML name, invalid QName
119 PASS createElement("a::c"); valid XML name, invalid QName
120 PASS createElement("a::c:"); valid XML name, invalid QName
121 PASS createElement("a:0"); valid XML name, not a valid QName
122 PASS createElement("0:a"); 0 at start makes it not a valid XML name; threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('0:a') is not a valid name.
123 PASS createElement("a:_")
124 PASS createElement("a:ெ"); non-ASCII character after colon is CombiningChar, which is valid in pre-namespace XML
125 PASS createElement("ெ:a"); not a valid start character; threw InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('ெ:a') is not a valid name.
126 PASS createElement("a:aெ")
127 PASS createElement("aெ:a")
128 PASS createElement("xml:test")
129 PASS createElement("xmlns:test")
130 PASS createElement("x:test")
131 PASS createElement("xmlns:test")
132 PASS createElement("SOAP-ENV:Body")
133 PASS successfullyParsed is true