Skip to content

Commit bb64931

Browse files
shannonboothmoz-wptsync-bot
authored andcommitted
Bug 1975206 [wpt PR 53533] - Align validate and extract tests with DOM spec, a=testonly
Automatic update from web-platform-tests DOM: correct validate and extract tests See whatwg/dom#1387 and whatwg/dom#1388 for context. Fixes #53464. -- wpt-commits: 3f4bd80a4b333cd3be5ad0b69aa89d8094c78d2b wpt-pr: 53533
1 parent 96e918d commit bb64931

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

testing/web-platform/tests/dom/nodes/DOMImplementation-createDocument.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@
112112
assert_not_equals(element, null)
113113
assert_equals(element.nodeType, Node.ELEMENT_NODE)
114114
assert_equals(element.ownerDocument, doc)
115-
var qualified = String(qualifiedName), names = []
115+
var qualified = String(qualifiedName)
116+
var names = []
116117
var firstColonIndex = qualified.indexOf(":")
117118
if (firstColonIndex >= 0) {
118-
names.push(qualified.substring(0, firstColonIndex));
119-
names.push(qualified.substring(firstColonIndex + 1));
119+
names = qualifiedName.split(":", 2);
120120
} else {
121121
names = [null, qualified]
122122
}

testing/web-platform/tests/dom/nodes/Document-createElementNS.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,20 @@
5858
assert_equals(element.nodeType, element.ELEMENT_NODE)
5959
assert_equals(element.nodeValue, null)
6060
assert_equals(element.ownerDocument, doc)
61-
var qualified = String(qualifiedName), names = []
61+
var qualified = String(qualifiedName)
62+
var tagName = String(qualifiedName)
63+
var names = [];
6264
var firstColonIndex = qualified.indexOf(":")
6365
if (firstColonIndex >= 0) {
64-
names.push(qualified.substring(0, firstColonIndex));
65-
names.push(qualified.substring(firstColonIndex + 1));
66+
names = qualifiedName.split(":", 2);
67+
tagName = names.join(":");
6668
} else {
6769
names = [null, qualified]
6870
}
6971
assert_equals(element.prefix, names[0], 'element.prefix')
7072
assert_equals(element.localName, names[1], 'element.localName')
71-
assert_equals(element.tagName, qualified, 'element.tagName')
72-
assert_equals(element.nodeName, qualified, 'element.nodeName')
73+
assert_equals(element.tagName, tagName, 'element.tagName')
74+
assert_equals(element.nodeName, tagName, 'element.nodeName')
7375
assert_equals(element.namespaceURI,
7476
namespace === undefined || namespace === "" ? null
7577
: namespace,

testing/web-platform/tests/dom/nodes/Document-createElementNS.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var createElementNS_tests = [
2626
[null, "fo o", "INVALID_CHARACTER_ERR"],
2727
[null, "-foo", "INVALID_CHARACTER_ERR"],
2828
[null, ".foo", "INVALID_CHARACTER_ERR"],
29-
[null, ":foo", null],
29+
[null, ":foo", "INVALID_CHARACTER_ERR"],
3030
[null, "f:oo", "NAMESPACE_ERR"],
3131
[null, "foo:", "INVALID_CHARACTER_ERR"],
3232
[null, "f:o:o", "NAMESPACE_ERR"],
@@ -39,7 +39,7 @@ var createElementNS_tests = [
3939
[null, "xmlfoo:bar", "NAMESPACE_ERR"],
4040
[null, "null:xml", "NAMESPACE_ERR"],
4141
["", null, null],
42-
["", ":foo", null],
42+
["", ":foo", "INVALID_CHARACTER_ERR"],
4343
["", "f:oo", "NAMESPACE_ERR"],
4444
["", "foo:", "INVALID_CHARACTER_ERR"],
4545
[undefined, null, null],
@@ -48,10 +48,10 @@ var createElementNS_tests = [
4848
[undefined, "1foo", "INVALID_CHARACTER_ERR"],
4949
[undefined, "f1oo", null],
5050
[undefined, "foo1", null],
51-
[undefined, ":foo", null],
51+
[undefined, ":foo", "INVALID_CHARACTER_ERR"],
5252
[undefined, "f:oo", "NAMESPACE_ERR"],
5353
[undefined, "foo:", "INVALID_CHARACTER_ERR"],
54-
[undefined, "f::oo", "NAMESPACE_ERR"],
54+
[undefined, "f::oo", "INVALID_CHARACTER_ERR"],
5555
[undefined, "xml", null],
5656
[undefined, "xmlns", "NAMESPACE_ERR"],
5757
[undefined, "xmlfoo", null],
@@ -66,11 +66,11 @@ var createElementNS_tests = [
6666
["http://example.com/", ".foo", "INVALID_CHARACTER_ERR"],
6767
["http://example.com/", "f1oo", null],
6868
["http://example.com/", "foo1", null],
69-
["http://example.com/", ":foo", null],
69+
["http://example.com/", ":foo", "INVALID_CHARACTER_ERR"],
7070
["http://example.com/", "f:oo", null],
7171
["http://example.com/", "f:o:o", null],
7272
["http://example.com/", "foo:", "INVALID_CHARACTER_ERR"],
73-
["http://example.com/", "f::oo", null],
73+
["http://example.com/", "f::oo", "INVALID_CHARACTER_ERR"],
7474
["http://example.com/", "a:0", "INVALID_CHARACTER_ERR"],
7575
["http://example.com/", "0:a", null],
7676
["http://example.com/", "a:_", null],
@@ -103,7 +103,7 @@ var createElementNS_tests = [
103103
["http://example.com/", "xmlns:foo", "NAMESPACE_ERR"],
104104
["http://example.com/", "XMLNS:foo", null],
105105
["http://example.com/", "xmlfoo:bar", null],
106-
["http://example.com/", "prefix::local", null],
106+
["http://example.com/", "prefix::local", "INVALID_CHARACTER_ERR"],
107107
["http://example.com/", "namespaceURI:{", "INVALID_CHARACTER_ERR"],
108108
["http://example.com/", "namespaceURI:}", "INVALID_CHARACTER_ERR"],
109109
["http://example.com/", "namespaceURI:~", "INVALID_CHARACTER_ERR"],
@@ -135,7 +135,7 @@ var createElementNS_tests = [
135135
["/", "1foo", "INVALID_CHARACTER_ERR"],
136136
["/", "f1oo", null],
137137
["/", "foo1", null],
138-
["/", ":foo", null],
138+
["/", ":foo", "INVALID_CHARACTER_ERR"],
139139
["/", "f:oo", null],
140140
["/", "foo:", "INVALID_CHARACTER_ERR"],
141141
["/", "xml", null],
@@ -148,7 +148,7 @@ var createElementNS_tests = [
148148
["http://www.w3.org/XML/1998/namespace", "1foo", "INVALID_CHARACTER_ERR"],
149149
["http://www.w3.org/XML/1998/namespace", "f1oo", null],
150150
["http://www.w3.org/XML/1998/namespace", "foo1", null],
151-
["http://www.w3.org/XML/1998/namespace", ":foo", null],
151+
["http://www.w3.org/XML/1998/namespace", ":foo", "INVALID_CHARACTER_ERR"],
152152
["http://www.w3.org/XML/1998/namespace", "f:oo", null],
153153
["http://www.w3.org/XML/1998/namespace", "foo:", "INVALID_CHARACTER_ERR"],
154154
["http://www.w3.org/XML/1998/namespace", "xml", null],
@@ -163,7 +163,7 @@ var createElementNS_tests = [
163163
["http://www.w3.org/2000/xmlns/", "1foo", "INVALID_CHARACTER_ERR"],
164164
["http://www.w3.org/2000/xmlns/", "f1oo", "NAMESPACE_ERR"],
165165
["http://www.w3.org/2000/xmlns/", "foo1", "NAMESPACE_ERR"],
166-
["http://www.w3.org/2000/xmlns/", ":foo", "NAMESPACE_ERR"],
166+
["http://www.w3.org/2000/xmlns/", ":foo", "INVALID_CHARACTER_ERR"],
167167
["http://www.w3.org/2000/xmlns/", "f:oo", "NAMESPACE_ERR"],
168168
["http://www.w3.org/2000/xmlns/", "foo:", "INVALID_CHARACTER_ERR"],
169169
["http://www.w3.org/2000/xmlns/", "xml", "NAMESPACE_ERR"],
@@ -177,7 +177,7 @@ var createElementNS_tests = [
177177
["foo:", "1foo", "INVALID_CHARACTER_ERR"],
178178
["foo:", "f1oo", null],
179179
["foo:", "foo1", null],
180-
["foo:", ":foo", null],
180+
["foo:", ":foo", "INVALID_CHARACTER_ERR"],
181181
["foo:", "f:oo", null],
182182
["foo:", "foo:", "INVALID_CHARACTER_ERR"],
183183
["foo:", "xml", null],

testing/web-platform/tests/dom/nodes/name-validation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
const invalidElementLocalNames = invalidElementLocalNamesShortened.slice();
5050
const validAttributeLocalNames = validAttributeLocalNamesShortened.slice();
5151
const invalidAttributeLocalNames = invalidAttributeLocalNamesShortened.slice();
52-
const validNamespacePrefixes = ['', smallEmoji, bigEmoji];
53-
const invalidNamespacePrefixes = [];
52+
const validNamespacePrefixes = [smallEmoji, bigEmoji];
53+
const invalidNamespacePrefixes = [''];
5454
const validDoctypes = [''];
5555
const invalidDoctypes = [];
5656

0 commit comments

Comments
 (0)