Commit 423b422b authored by shanmuga.m's avatar shanmuga.m Committed by Commit bot

createElementNS() should now throw only InvalidCharacterError, not NamespaceError

Validating a qualified name should only throw InvalidCharacterError, not NamespaceError,
after:
 https://github.com/whatwg/dom/issues/319
 https://github.com/w3c/web-platform-tests/issues/5161
 https://github.com/whatwg/dom/issues/423

Latest spec:
 https://dom.spec.whatwg.org/#validate

Webkit Patch:
 http://trac.webkit.org/changeset/215701/webkit

BUG=702077

Review-Url: https://codereview.chromium.org/2841393003
Cr-Commit-Position: refs/heads/master@{#467936}
parent a8c329d4
This is a testharness.js-based test.
Found 82 tests; 79 PASS, 3 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS DOMImplementation.createDocumentType(qualifiedName, publicId, systemId)
PASS createDocumentType("", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("test:root", "1234", "") should work
PASS createDocumentType("test:root", "1234", "test") should work
PASS createDocumentType("test:root", "test", "") should work
PASS createDocumentType("test:root", "test", "test") should work
PASS createDocumentType("_:_", "", "") should work
PASS createDocumentType("_:h0", "", "") should work
PASS createDocumentType("_:test", "", "") should work
PASS createDocumentType("_:_.", "", "") should work
PASS createDocumentType("_:a-", "", "") should work
PASS createDocumentType("l_:_", "", "") should work
PASS createDocumentType("ns:_0", "", "") should work
PASS createDocumentType("ns:a0", "", "") should work
PASS createDocumentType("ns0:test", "", "") should work
PASS createDocumentType("ns:EEE.", "", "") should work
PASS createDocumentType("ns:_-", "", "") should work
PASS createDocumentType("a.b:c", "", "") should work
PASS createDocumentType("a-b:c.j", "", "") should work
PASS createDocumentType("a-b:c", "", "") should work
PASS createDocumentType("foo", "", "") should work
PASS createDocumentType("1foo", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("foo1", "", "") should work
PASS createDocumentType("f1oo", "", "") should work
PASS createDocumentType("@foo", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("foo@", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("f@oo", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:{", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:}", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:~", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:'", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:!", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:@", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:#", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:$", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:%", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:^", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:&", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:*", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:(", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:)", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:+", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:=", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:[", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:]", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:\\", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:/", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:;", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:`", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:<", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:>", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:,", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:a ", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("edi:\"", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("{", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("}", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("'", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("~", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("`", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("@", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("#", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("$", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("%", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("^", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("&", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("*", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("(", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType(")", "", "") should throw INVALID_CHARACTER_ERR
PASS createDocumentType("f:oo", "", "") should work
FAIL createDocumentType(":foo", "", "") should throw INVALID_CHARACTER_ERR assert_throws: function "function () {
document.implementation.createDocumentType(qualifiedName, publicId, systemId)
}" threw object "NamespaceError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided (':foo') has an empty namespace prefix." that is not a DOMException INVALID_CHARACTER_ERR: property "code" is equal to 14, expected 5
FAIL createDocumentType("foo:", "", "") should throw INVALID_CHARACTER_ERR assert_throws: function "function () {
document.implementation.createDocumentType(qualifiedName, publicId, systemId)
}" threw object "NamespaceError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('foo:') has an empty local name." that is not a DOMException INVALID_CHARACTER_ERR: property "code" is equal to 14, expected 5
FAIL createDocumentType("prefix::local", "", "") should throw INVALID_CHARACTER_ERR assert_throws: function "function () {
document.implementation.createDocumentType(qualifiedName, publicId, systemId)
}" threw object "NamespaceError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('prefix::local') contains multiple colons." that is not a DOMException INVALID_CHARACTER_ERR: property "code" is equal to 14, expected 5
PASS createDocumentType("foo", "foo", "") should work
PASS createDocumentType("foo", "", "foo") should work
PASS createDocumentType("foo", "f'oo", "") should work
PASS createDocumentType("foo", "", "f'oo") should work
PASS createDocumentType("foo", "f\"oo", "") should work
PASS createDocumentType("foo", "", "f\"oo") should work
PASS createDocumentType("foo", "f'o\"o", "") should work
PASS createDocumentType("foo", "", "f'o\"o") should work
PASS createDocumentType("foo", "foo>", "") should work
PASS createDocumentType("foo", "", "foo>") should work
Harness: the test ran to completion.
This is a testharness.js-based test. This is a testharness.js-based test.
Found 58 tests; 49 PASS, 9 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 58 tests; 50 PASS, 8 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown. (setAttribute) PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown. (setAttribute)
PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown, even if the attribute is already present. (setAttribute) PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown, even if the attribute is already present. (setAttribute)
PASS setAttribute should lowercase its name argument (upper case attribute) PASS setAttribute should lowercase its name argument (upper case attribute)
...@@ -11,7 +11,7 @@ PASS setAttribute should set the first attribute with the given name ...@@ -11,7 +11,7 @@ PASS setAttribute should set the first attribute with the given name
PASS setAttribute should set the attribute with the given qualified name PASS setAttribute should set the attribute with the given qualified name
PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown. (setAttributeNS) PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown. (setAttributeNS)
PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown, even if the attribute is already present. (setAttributeNS) PASS When qualifiedName does not match the Name production, an INVALID_CHARACTER_ERR exception is to be thrown, even if the attribute is already present. (setAttributeNS)
FAIL When qualifiedName does not match the QName production, an INVALID_CHARACTER_ERR exception is to be thrown. assert_throws: Expected exception for :a. function "function () { el.setAttributeNS("a", invalid_qnames[i], "fail") }" threw object "NamespaceError: Failed to execute 'setAttributeNS' on 'Element': The qualified name provided (':a') has an empty namespace prefix." that is not a DOMException INVALID_CHARACTER_ERR: property "code" is equal to 14, expected 5 PASS When qualifiedName does not match the QName production, an INVALID_CHARACTER_ERR exception is to be thrown.
PASS null and the empty string should result in a null namespace. PASS null and the empty string should result in a null namespace.
PASS A namespace is required to use a prefix. PASS A namespace is required to use a prefix.
PASS The xml prefix should not be allowed for arbitrary namespaces PASS The xml prefix should not be allowed for arbitrary namespaces
......
...@@ -23,15 +23,15 @@ PASS createDocument("http://example.com/", "0div", null); threw INVALID_CHARACTE ...@@ -23,15 +23,15 @@ PASS createDocument("http://example.com/", "0div", null); threw INVALID_CHARACTE
PASS createDocument("http://example.com/", "di<v", null); threw INVALID_CHARACTER_ERR PASS createDocument("http://example.com/", "di<v", null); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "-div", null); threw INVALID_CHARACTER_ERR PASS createDocument("http://example.com/", "-div", null); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", ".div", null); threw INVALID_CHARACTER_ERR PASS createDocument("http://example.com/", ".div", null); threw INVALID_CHARACTER_ERR
PASS createDocument(null, ":div", null); threw NAMESPACE_ERR PASS createDocument(null, ":div", null); threw INVALID_CHARACTER_ERR
PASS createDocument(null, "div:", null); threw NAMESPACE_ERR PASS createDocument(null, "div:", null); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", ":div", null); threw NAMESPACE_ERR PASS createDocument("http://example.com/", ":div", null); threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "div:", null); threw NAMESPACE_ERR PASS createDocument("http://example.com/", "div:", null); threw INVALID_CHARACTER_ERR
PASS createDocument(null, "d:iv", null); threw NAMESPACE_ERR PASS createDocument(null, "d:iv", null); threw NAMESPACE_ERR
PASS createDocument(null, "a:b:c", null); valid XML name, invalid QName; threw NAMESPACE_ERR PASS createDocument(null, "a:b:c", null); valid XML name, invalid QName; threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "a:b:c", null); valid XML name, invalid QName; threw NAMESPACE_ERR PASS createDocument("http://example.com/", "a:b:c", null); valid XML name, invalid QName; threw INVALID_CHARACTER_ERR
PASS createDocument(null, "a::c", null); valid XML name, invalid QName; threw NAMESPACE_ERR PASS createDocument(null, "a::c", null); valid XML name, invalid QName; threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "a::c", null); valid XML name, invalid QName; threw NAMESPACE_ERR PASS createDocument("http://example.com/", "a::c", null); valid XML name, invalid QName; threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "a:0", null); valid XML name, not a valid QName; threw INVALID_CHARACTER_ERR PASS createDocument("http://example.com/", "a:0", null); valid XML name, not a valid QName; threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "0:a", null); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR PASS createDocument("http://example.com/", "0:a", null); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR
PASS createDocument("http://example.com/", "a:_", null) PASS createDocument("http://example.com/", "a:_", null)
......
...@@ -66,15 +66,15 @@ var allNSTests = [ ...@@ -66,15 +66,15 @@ var allNSTests = [
{ args: ["http://example.com/", "di<v"], code: 5 }, { args: ["http://example.com/", "di<v"], code: 5 },
{ args: ["http://example.com/", "-div"], code: 5 }, { args: ["http://example.com/", "-div"], code: 5 },
{ args: ["http://example.com/", ".div"], code: 5 }, { args: ["http://example.com/", ".div"], code: 5 },
{ args: [null, ":div"], code: 14 }, { args: [null, ":div"], code: 5 },
{ args: [null, "div:"], code: 14 }, { args: [null, "div:"], code: 5 },
{ args: ["http://example.com/", ":div"], code: 14 }, { args: ["http://example.com/", ":div"], code: 5 },
{ args: ["http://example.com/", "div:"], code: 14 }, { args: ["http://example.com/", "div:"], code: 5 },
{ args: [null, "d:iv"], code: 14 }, { args: [null, "d:iv"], code: 14 },
{ args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, { args: [null, "a:b:c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, { args: ["http://example.com/", "a:b:c"], code: 5, message: "valid XML name, invalid QName" },
{ args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, { args: [null, "a::c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, { args: ["http://example.com/", "a::c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" },
{ args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
{ args: ["http://example.com/", "a:_"] }, { args: ["http://example.com/", "a:_"] },
......
...@@ -13,17 +13,17 @@ PASS document.implementation.createDocumentType(null, null) threw exception Type ...@@ -13,17 +13,17 @@ PASS document.implementation.createDocumentType(null, null) threw exception Type
PASS document.implementation.createDocumentType(null, '') threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 2 present.. PASS document.implementation.createDocumentType(null, '') threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 2 present..
PASS document.implementation.createDocumentType('', null) threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 2 present.. PASS document.implementation.createDocumentType('', null) threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 2 present..
PASS document.implementation.createDocumentType('', '') threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 2 present.. PASS document.implementation.createDocumentType('', '') threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 2 present..
PASS document.implementation.createDocumentType('a:', null, null) threw exception NamespaceError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('a:') has an empty local name.. PASS document.implementation.createDocumentType('a:', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('a:') has an empty local name..
PASS document.implementation.createDocumentType(':foo', null, null) threw exception NamespaceError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided (':foo') has an empty namespace prefix.. PASS document.implementation.createDocumentType(':foo', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided (':foo') has an empty namespace prefix..
PASS document.implementation.createDocumentType(':', null, null) threw exception NamespaceError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided (':') has an empty namespace prefix.. PASS document.implementation.createDocumentType(':', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided (':') has an empty namespace prefix..
PASS document.implementation.createDocumentType('foo', null, null) did not throw exception. PASS document.implementation.createDocumentType('foo', null, null) did not throw exception.
PASS document.implementation.createDocumentType('foo:bar', null, null) did not throw exception. PASS document.implementation.createDocumentType('foo:bar', null, null) did not throw exception.
PASS document.implementation.createDocumentType('foo::bar', null, null) threw exception NamespaceError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('foo::bar') contains multiple colons.. PASS document.implementation.createDocumentType('foo::bar', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('foo::bar') contains multiple colons..
PASS document.implementation.createDocumentType(' :bar', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided (' :bar') contains the invalid name-start character ' '.. PASS document.implementation.createDocumentType(' :bar', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided (' :bar') contains the invalid name-start character ' '..
PASS document.implementation.createDocumentType('foo: ', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('foo: ') contains the invalid name-start character ' '.. PASS document.implementation.createDocumentType('foo: ', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('foo: ') contains the invalid name-start character ' '..
PASS document.implementation.createDocumentType('foo :bar', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('foo :bar') contains the invalid character ' '.. PASS document.implementation.createDocumentType('foo :bar', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('foo :bar') contains the invalid character ' '..
PASS document.implementation.createDocumentType('foo: bar', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('foo: bar') contains the invalid name-start character ' '.. PASS document.implementation.createDocumentType('foo: bar', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('foo: bar') contains the invalid name-start character ' '..
PASS document.implementation.createDocumentType('a:b:c', null, null) threw exception NamespaceError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('a:b:c') contains multiple colons.. PASS document.implementation.createDocumentType('a:b:c', null, null) threw exception InvalidCharacterError: Failed to execute 'createDocumentType' on 'DOMImplementation': The qualified name provided ('a:b:c') contains multiple colons..
PASS successfullyParsed is true PASS successfullyParsed is true
TEST COMPLETE TEST COMPLETE
......
...@@ -21,17 +21,17 @@ shouldThrow("document.implementation.createDocumentType(null, null)", ExpectedNo ...@@ -21,17 +21,17 @@ shouldThrow("document.implementation.createDocumentType(null, null)", ExpectedNo
shouldThrow("document.implementation.createDocumentType(null, '')", ExpectedNotEnoughArgumentsMessage(2)); shouldThrow("document.implementation.createDocumentType(null, '')", ExpectedNotEnoughArgumentsMessage(2));
shouldThrow("document.implementation.createDocumentType('', null)", ExpectedNotEnoughArgumentsMessage(2)); shouldThrow("document.implementation.createDocumentType('', null)", ExpectedNotEnoughArgumentsMessage(2));
shouldThrow("document.implementation.createDocumentType('', '')", ExpectedNotEnoughArgumentsMessage(2)); shouldThrow("document.implementation.createDocumentType('', '')", ExpectedNotEnoughArgumentsMessage(2));
shouldThrow("document.implementation.createDocumentType('a:', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'a:\') has an empty local name."'); shouldThrow("document.implementation.createDocumentType('a:', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'a:\') has an empty local name."');
shouldThrow("document.implementation.createDocumentType(':foo', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\':foo\') has an empty namespace prefix."'); shouldThrow("document.implementation.createDocumentType(':foo', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\':foo\') has an empty namespace prefix."');
shouldThrow("document.implementation.createDocumentType(':', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\':\') has an empty namespace prefix."'); shouldThrow("document.implementation.createDocumentType(':', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\':\') has an empty namespace prefix."');
shouldNotThrow("document.implementation.createDocumentType('foo', null, null)"); shouldNotThrow("document.implementation.createDocumentType('foo', null, null)");
shouldNotThrow("document.implementation.createDocumentType('foo:bar', null, null)"); shouldNotThrow("document.implementation.createDocumentType('foo:bar', null, null)");
shouldThrow("document.implementation.createDocumentType('foo::bar', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo::bar\') contains multiple colons."'); shouldThrow("document.implementation.createDocumentType('foo::bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo::bar\') contains multiple colons."');
shouldThrow("document.implementation.createDocumentType('\t:bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'\t:bar\') contains the invalid name-start character \'\t\'."'); shouldThrow("document.implementation.createDocumentType('\t:bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'\t:bar\') contains the invalid name-start character \'\t\'."');
shouldThrow("document.implementation.createDocumentType('foo:\t', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo:\t\') contains the invalid name-start character \'\t\'."'); shouldThrow("document.implementation.createDocumentType('foo:\t', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo:\t\') contains the invalid name-start character \'\t\'."');
shouldThrow("document.implementation.createDocumentType('foo :bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo :bar\') contains the invalid character \' \'."'); shouldThrow("document.implementation.createDocumentType('foo :bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo :bar\') contains the invalid character \' \'."');
shouldThrow("document.implementation.createDocumentType('foo: bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo: bar\') contains the invalid name-start character \' \'."'); shouldThrow("document.implementation.createDocumentType('foo: bar', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'foo: bar\') contains the invalid name-start character \' \'."');
shouldThrow("document.implementation.createDocumentType('a:b:c', null, null)", '"NamespaceError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'a:b:c\') contains multiple colons."'); shouldThrow("document.implementation.createDocumentType('a:b:c', null, null)", '"InvalidCharacterError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': The qualified name provided (\'a:b:c\') contains multiple colons."');
</script> </script>
</body> </body>
......
...@@ -21,15 +21,15 @@ PASS createAttributeNS("http://example.com/", "0div"); threw InvalidCharacterErr ...@@ -21,15 +21,15 @@ PASS createAttributeNS("http://example.com/", "0div"); threw InvalidCharacterErr
PASS createAttributeNS("http://example.com/", "di<v"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('di<v') contains the invalid character '<'. PASS createAttributeNS("http://example.com/", "di<v"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('di<v') contains the invalid character '<'.
PASS createAttributeNS("http://example.com/", "-div"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('-div') contains the invalid name-start character '-'. PASS createAttributeNS("http://example.com/", "-div"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('-div') contains the invalid name-start character '-'.
PASS createAttributeNS("http://example.com/", ".div"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('.div') contains the invalid name-start character '.'. PASS createAttributeNS("http://example.com/", ".div"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('.div') contains the invalid name-start character '.'.
PASS createAttributeNS(null, ":div"); threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix. PASS createAttributeNS(null, ":div"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix.
PASS createAttributeNS(null, "div:"); threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('div:') has an empty local name. PASS createAttributeNS(null, "div:"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('div:') has an empty local name.
PASS createAttributeNS("http://example.com/", ":div"); threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix. PASS createAttributeNS("http://example.com/", ":div"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix.
PASS createAttributeNS("http://example.com/", "div:"); threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('div:') has an empty local name. PASS createAttributeNS("http://example.com/", "div:"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('div:') has an empty local name.
PASS createAttributeNS(null, "d:iv"); threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The namespace URI provided ('') is not valid for the qualified name provided ('d:iv'). PASS createAttributeNS(null, "d:iv"); threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The namespace URI provided ('') is not valid for the qualified name provided ('d:iv').
PASS createAttributeNS(null, "a:b:c"); valid XML name, invalid QName; threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a:b:c') contains multiple colons. PASS createAttributeNS(null, "a:b:c"); valid XML name, invalid QName; threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a:b:c') contains multiple colons.
PASS createAttributeNS("http://example.com/", "a:b:c"); valid XML name, invalid QName; threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a:b:c') contains multiple colons. PASS createAttributeNS("http://example.com/", "a:b:c"); valid XML name, invalid QName; threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a:b:c') contains multiple colons.
PASS createAttributeNS(null, "a::c"); valid XML name, invalid QName; threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a::c') contains multiple colons. PASS createAttributeNS(null, "a::c"); valid XML name, invalid QName; threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a::c') contains multiple colons.
PASS createAttributeNS("http://example.com/", "a::c"); valid XML name, invalid QName; threw NamespaceError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a::c') contains multiple colons. PASS createAttributeNS("http://example.com/", "a::c"); valid XML name, invalid QName; threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a::c') contains multiple colons.
PASS createAttributeNS("http://example.com/", "a:0"); valid XML name, not a valid QName; threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a:0') contains the invalid name-start character '0'. PASS createAttributeNS("http://example.com/", "a:0"); valid XML name, not a valid QName; threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('a:0') contains the invalid name-start character '0'.
PASS createAttributeNS("http://example.com/", "0:a"); 0 at start makes it not a valid XML name; threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('0:a') contains the invalid name-start character '0'. PASS createAttributeNS("http://example.com/", "0:a"); 0 at start makes it not a valid XML name; threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('0:a') contains the invalid name-start character '0'.
PASS createAttributeNS("http://example.com/", "a:_") PASS createAttributeNS("http://example.com/", "a:_")
......
...@@ -61,15 +61,15 @@ var allNSTests = [ ...@@ -61,15 +61,15 @@ var allNSTests = [
{ args: ["http://example.com/", "di<v"], code: 5 }, { args: ["http://example.com/", "di<v"], code: 5 },
{ args: ["http://example.com/", "-div"], code: 5 }, { args: ["http://example.com/", "-div"], code: 5 },
{ args: ["http://example.com/", ".div"], code: 5 }, { args: ["http://example.com/", ".div"], code: 5 },
{ args: [null, ":div"], code: 14 }, { args: [null, ":div"], code: 5 },
{ args: [null, "div:"], code: 14 }, { args: [null, "div:"], code: 5 },
{ args: ["http://example.com/", ":div"], code: 14 }, { args: ["http://example.com/", ":div"], code: 5 },
{ args: ["http://example.com/", "div:"], code: 14 }, { args: ["http://example.com/", "div:"], code: 5 },
{ args: [null, "d:iv"], code: 14 }, { args: [null, "d:iv"], code: 14 },
{ args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, { args: [null, "a:b:c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, { args: ["http://example.com/", "a:b:c"], code: 5, message: "valid XML name, invalid QName" },
{ args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, { args: [null, "a::c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, { args: ["http://example.com/", "a::c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" },
{ args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
{ args: ["http://example.com/", "a:_"] }, { args: ["http://example.com/", "a:_"] },
......
...@@ -22,15 +22,15 @@ PASS createElementNS("http://example.com/", "0div"); threw InvalidCharacterError ...@@ -22,15 +22,15 @@ PASS createElementNS("http://example.com/", "0div"); threw InvalidCharacterError
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 '<'. 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 '<'.
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 '-'. 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 '-'.
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 '.'. 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 '.'.
PASS createElementNS(null, ":div"); threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix. PASS createElementNS(null, ":div"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix.
PASS createElementNS(null, "div:"); threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('div:') has an empty local name. PASS createElementNS(null, "div:"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('div:') has an empty local name.
PASS createElementNS("http://example.com/", ":div"); threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix. PASS createElementNS("http://example.com/", ":div"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided (':div') has an empty namespace prefix.
PASS createElementNS("http://example.com/", "div:"); threw NamespaceError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('div:') has an empty local name. PASS createElementNS("http://example.com/", "div:"); threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('div:') has an empty local name.
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'). 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').
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. PASS createElementNS(null, "a:b:c"); valid XML name, invalid QName; threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a:b:c') contains multiple colons.
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. PASS createElementNS("http://example.com/", "a:b:c"); valid XML name, invalid QName; threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a:b:c') contains multiple colons.
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. PASS createElementNS(null, "a::c"); valid XML name, invalid QName; threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a::c') contains multiple colons.
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. PASS createElementNS("http://example.com/", "a::c"); valid XML name, invalid QName; threw InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a::c') contains multiple colons.
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'. 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'.
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'. 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'.
PASS createElementNS("http://example.com/", "a:_") PASS createElementNS("http://example.com/", "a:_")
......
...@@ -61,15 +61,15 @@ var allNSTests = [ ...@@ -61,15 +61,15 @@ var allNSTests = [
{ args: ["http://example.com/", "di<v"], code: 5 }, { args: ["http://example.com/", "di<v"], code: 5 },
{ args: ["http://example.com/", "-div"], code: 5 }, { args: ["http://example.com/", "-div"], code: 5 },
{ args: ["http://example.com/", ".div"], code: 5 }, { args: ["http://example.com/", ".div"], code: 5 },
{ args: [null, ":div"], code: 14 }, { args: [null, ":div"], code: 5 },
{ args: [null, "div:"], code: 14 }, { args: [null, "div:"], code: 5 },
{ args: ["http://example.com/", ":div"], code: 14 }, { args: ["http://example.com/", ":div"], code: 5 },
{ args: ["http://example.com/", "div:"], code: 14 }, { args: ["http://example.com/", "div:"], code: 5 },
{ args: [null, "d:iv"], code: 14 }, { args: [null, "d:iv"], code: 14 },
{ args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, { args: [null, "a:b:c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, { args: ["http://example.com/", "a:b:c"], code: 5, message: "valid XML name, invalid QName" },
{ args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, { args: [null, "a::c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, { args: ["http://example.com/", "a::c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" },
{ args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
{ args: ["http://example.com/", "a:_"] }, { args: ["http://example.com/", "a:_"] },
......
...@@ -21,15 +21,15 @@ PASS element.setAttributeNS("http://example.com/", "0div", 'value'); threw INVAL ...@@ -21,15 +21,15 @@ PASS element.setAttributeNS("http://example.com/", "0div", 'value'); threw INVAL
PASS element.setAttributeNS("http://example.com/", "di<v", 'value'); threw INVALID_CHARACTER_ERR PASS element.setAttributeNS("http://example.com/", "di<v", 'value'); threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS("http://example.com/", "-div", 'value'); threw INVALID_CHARACTER_ERR PASS element.setAttributeNS("http://example.com/", "-div", 'value'); threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS("http://example.com/", ".div", 'value'); threw INVALID_CHARACTER_ERR PASS element.setAttributeNS("http://example.com/", ".div", 'value'); threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS(null, ":div", 'value'); threw NAMESPACE_ERR PASS element.setAttributeNS(null, ":div", 'value'); threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS(null, "div:", 'value'); threw NAMESPACE_ERR PASS element.setAttributeNS(null, "div:", 'value'); threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS("http://example.com/", ":div", 'value'); threw NAMESPACE_ERR PASS element.setAttributeNS("http://example.com/", ":div", 'value'); threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS("http://example.com/", "div:", 'value'); threw NAMESPACE_ERR PASS element.setAttributeNS("http://example.com/", "div:", 'value'); threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS(null, "d:iv", 'value'); threw NAMESPACE_ERR PASS element.setAttributeNS(null, "d:iv", 'value'); threw NAMESPACE_ERR
PASS element.setAttributeNS(null, "a:b:c", 'value'); valid XML name, invalid QName; threw NAMESPACE_ERR PASS element.setAttributeNS(null, "a:b:c", 'value'); valid XML name, invalid QName; threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS("http://example.com/", "a:b:c", 'value'); valid XML name, invalid QName; threw NAMESPACE_ERR PASS element.setAttributeNS("http://example.com/", "a:b:c", 'value'); valid XML name, invalid QName; threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS(null, "a::c", 'value'); valid XML name, invalid QName; threw NAMESPACE_ERR PASS element.setAttributeNS(null, "a::c", 'value'); valid XML name, invalid QName; threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS("http://example.com/", "a::c", 'value'); valid XML name, invalid QName; threw NAMESPACE_ERR PASS element.setAttributeNS("http://example.com/", "a::c", 'value'); valid XML name, invalid QName; threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS("http://example.com/", "a:0", 'value'); valid XML name, not a valid QName; threw INVALID_CHARACTER_ERR PASS element.setAttributeNS("http://example.com/", "a:0", 'value'); valid XML name, not a valid QName; threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS("http://example.com/", "0:a", 'value'); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR PASS element.setAttributeNS("http://example.com/", "0:a", 'value'); 0 at start makes it not a valid XML name; threw INVALID_CHARACTER_ERR
PASS element.setAttributeNS("http://example.com/", "a:_", 'value') PASS element.setAttributeNS("http://example.com/", "a:_", 'value')
......
...@@ -60,15 +60,15 @@ var allNSTests = [ ...@@ -60,15 +60,15 @@ var allNSTests = [
{ args: ["http://example.com/", "di<v"], code: 5 }, { args: ["http://example.com/", "di<v"], code: 5 },
{ args: ["http://example.com/", "-div"], code: 5 }, { args: ["http://example.com/", "-div"], code: 5 },
{ args: ["http://example.com/", ".div"], code: 5 }, { args: ["http://example.com/", ".div"], code: 5 },
{ args: [null, ":div"], code: 14 }, { args: [null, ":div"], code: 5 },
{ args: [null, "div:"], code: 14 }, { args: [null, "div:"], code: 5 },
{ args: ["http://example.com/", ":div"], code: 14 }, { args: ["http://example.com/", ":div"], code: 5 },
{ args: ["http://example.com/", "div:"], code: 14 }, { args: ["http://example.com/", "div:"], code: 5 },
{ args: [null, "d:iv"], code: 14 }, { args: [null, "d:iv"], code: 14 },
{ args: [null, "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, { args: [null, "a:b:c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a:b:c"], code: 14, message: "valid XML name, invalid QName" }, { args: ["http://example.com/", "a:b:c"], code: 5, message: "valid XML name, invalid QName" },
{ args: [null, "a::c"], code: 14, message: "valid XML name, invalid QName" }, { args: [null, "a::c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a::c"], code: 14, message: "valid XML name, invalid QName" }, { args: ["http://example.com/", "a::c"], code: 5, message: "valid XML name, invalid QName" },
{ args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" }, { args: ["http://example.com/", "a:0"], code: 5, message: "valid XML name, not a valid QName" },
{ args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" }, { args: ["http://example.com/", "0:a"], code: 5, message: "0 at start makes it not a valid XML name" },
{ args: ["http://example.com/", "a:_"] }, { args: ["http://example.com/", "a:_"] },
......
...@@ -960,8 +960,8 @@ ...@@ -960,8 +960,8 @@
test('di<v', "http://example.com/", 5); test('di<v', "http://example.com/", 5);
test('-div', "http://example.com/", 5); test('-div', "http://example.com/", 5);
test('.div', "http://example.com/", 5); test('.div', "http://example.com/", 5);
test(':div', null, 14); test(':div', null, 5);
test(':div', "http://example.com/", 14); test(':div', "http://example.com/", 5);
test('d:iv', null, 14); test('d:iv', null, 14);
test('xml:test', "http://example.com/", 14); test('xml:test', "http://example.com/", 14);
test('xmlns:test', "http://example.com/", 14); // (technically a DOM3 Core test) test('xmlns:test', "http://example.com/", 14); // (technically a DOM3 Core test)
...@@ -982,7 +982,7 @@ ...@@ -982,7 +982,7 @@
document.implementation.createDocumentType('a:', '', ''); /* doesn't contain an illegal character; is malformed */ document.implementation.createDocumentType('a:', '', ''); /* doesn't contain an illegal character; is malformed */
message = "failed to raise exception"; message = "failed to raise exception";
} catch (e) { } catch (e) {
if (e.code != e.NAMESPACE_ERR) if (e.code != e.INVALID_CHARACTER_ERR)
message = "wrong exception"; message = "wrong exception";
else if (e.INVALID_ACCESS_ERR != 15) else if (e.INVALID_ACCESS_ERR != 15)
message = "exceptions don't have all the constants"; message = "exceptions don't have all the constants";
......
...@@ -5080,12 +5080,7 @@ bool Document::ParseQualifiedName(const AtomicString& qualified_name, ...@@ -5080,12 +5080,7 @@ bool Document::ParseQualifiedName(const AtomicString& qualified_name,
message.Append("has an empty local name."); message.Append("has an empty local name.");
} }
if (return_value.status == kQNInvalidStartChar || exception_state.ThrowDOMException(kInvalidCharacterError, message.ToString());
return_value.status == kQNInvalidChar)
exception_state.ThrowDOMException(kInvalidCharacterError,
message.ToString());
else
exception_state.ThrowDOMException(kNamespaceError, message.ToString());
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment