From 8a1a666c19d748b9eedc68cf42abcc5a9804b860 Mon Sep 17 00:00:00 2001 From: sideshowbarker Date: Fri, 6 Mar 2026 21:42:37 +0900 Subject: [PATCH] WebKit export of https://bugs.webkit.org/show_bug.cgi?id=241419 --- dom/nodes/DOMImplementation-createDocument.html | 2 +- dom/nodes/Document-createElementNS.html | 8 +++----- dom/nodes/Document-createElementNS.js | 6 +++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/dom/nodes/DOMImplementation-createDocument.html b/dom/nodes/DOMImplementation-createDocument.html index 1efea6855fdf23..7dc29d8e7d9fe2 100644 --- a/dom/nodes/DOMImplementation-createDocument.html +++ b/dom/nodes/DOMImplementation-createDocument.html @@ -116,7 +116,7 @@ var names = [] var firstColonIndex = qualified.indexOf(":") if (firstColonIndex >= 0) { - names = qualifiedName.split(":", 2); + names = [qualified.substring(0, firstColonIndex), qualified.substring(firstColonIndex + 1)]; } else { names = [null, qualified] } diff --git a/dom/nodes/Document-createElementNS.html b/dom/nodes/Document-createElementNS.html index 9d0792647d3a11..9a0a97d879e9c3 100644 --- a/dom/nodes/Document-createElementNS.html +++ b/dom/nodes/Document-createElementNS.html @@ -59,19 +59,17 @@ assert_equals(element.nodeValue, null) assert_equals(element.ownerDocument, doc) var qualified = String(qualifiedName) - var tagName = String(qualifiedName) var names = []; var firstColonIndex = qualified.indexOf(":") if (firstColonIndex >= 0) { - names = qualifiedName.split(":", 2); - tagName = names.join(":"); + names = [qualified.substring(0, firstColonIndex), qualified.substring(firstColonIndex + 1)]; } else { names = [null, qualified] } assert_equals(element.prefix, names[0], 'element.prefix') assert_equals(element.localName, names[1], 'element.localName') - assert_equals(element.tagName, tagName, 'element.tagName') - assert_equals(element.nodeName, tagName, 'element.nodeName') + assert_equals(element.tagName, qualified, 'element.tagName') + assert_equals(element.nodeName, qualified, 'element.nodeName') assert_equals(element.namespaceURI, namespace === undefined || namespace === "" ? null : namespace, diff --git a/dom/nodes/Document-createElementNS.js b/dom/nodes/Document-createElementNS.js index 21902ec504e76f..14b22220ad91c7 100644 --- a/dom/nodes/Document-createElementNS.js +++ b/dom/nodes/Document-createElementNS.js @@ -51,7 +51,7 @@ var createElementNS_tests = [ [undefined, ":foo", "INVALID_CHARACTER_ERR"], [undefined, "f:oo", "NAMESPACE_ERR"], [undefined, "foo:", "INVALID_CHARACTER_ERR"], - [undefined, "f::oo", "INVALID_CHARACTER_ERR"], + [undefined, "f::oo", "NAMESPACE_ERR"], [undefined, "xml", null], [undefined, "xmlns", "NAMESPACE_ERR"], [undefined, "xmlfoo", null], @@ -70,7 +70,7 @@ var createElementNS_tests = [ ["http://example.com/", "f:oo", null], ["http://example.com/", "f:o:o", null], ["http://example.com/", "foo:", "INVALID_CHARACTER_ERR"], - ["http://example.com/", "f::oo", "INVALID_CHARACTER_ERR"], + ["http://example.com/", "f::oo", null], ["http://example.com/", "a:0", "INVALID_CHARACTER_ERR"], ["http://example.com/", "0:a", null], ["http://example.com/", "a:_", null], @@ -103,7 +103,7 @@ var createElementNS_tests = [ ["http://example.com/", "xmlns:foo", "NAMESPACE_ERR"], ["http://example.com/", "XMLNS:foo", null], ["http://example.com/", "xmlfoo:bar", null], - ["http://example.com/", "prefix::local", "INVALID_CHARACTER_ERR"], + ["http://example.com/", "prefix::local", null], ["http://example.com/", "namespaceURI:{", "INVALID_CHARACTER_ERR"], ["http://example.com/", "namespaceURI:}", "INVALID_CHARACTER_ERR"], ["http://example.com/", "namespaceURI:~", "INVALID_CHARACTER_ERR"],