New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 702077 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

QualifiedName validation doesn't conform to the DOM spec

Project Member Reported by tkent@chromium.org, Mar 16 2017

Issue description

Chrome Version: 59 canary
OS: All but iOS

What steps will reproduce the problem?
(1) Open http://w3c-test.org/dom/nodes/Document-createElementNS.html
Note that there are other failing tests in dom/nodes/ due to this issue.

What is the expected result?
No FAILs.

What happens instead?
There are some failures.  e.g.

assert_throws: function "function () { doc.createElementNS(namespace, qualifiedName) }" threw object "InvalidCharacterError: Failed to execute 'createElementNS' on 'Document': The qualified name provided ('a:0') contains the invalid name-start character '0'." that is not a DOMException NAMESPACE_ERR: property "code" is equal to 5, expected 14

Please use labels and text to provide additional information.
The test is that what should be thrown by:
  document.createElementNS("http://example.com/","a:0")
Blink now throws InvalidCharacterError.

https://dom.spec.whatwg.org/#validate
> 1. If qualifiedName does not match the Name production, then throw an InvalidCharacterError.
> 2. If qualifiedName does not match the QName production, then throw a NamespaceError.

"a:0" matches to "Name" production, so NamespaceError should be thrown.

Implementation is in createQualifiedName() in core/dom/Document.cpp.

 

Comment 2 by tkent@chromium.org, Mar 16 2017

Labels: -Hotlist-GoodFirstBug
Status: ExternalDependency (was: Available)
Thanks for the link.

Comment 3 by tkent@chromium.org, Apr 20 2017

 Issue 713681  has been merged into this issue.

Comment 4 by tkent@chromium.org, Apr 20 2017

Labels: Hotlist-GoodFirstBug
Status: Available (was: ExternalDependency)
The specification and WTP were updated.

https://dom.spec.whatwg.org/#validate
> To validate a qualifiedName, throw an InvalidCharacterError if qualifiedName does not match the Name or QName production.

I don't think intent-to-ship is necessary for this.

Owner: shanmug...@samsung.com
Status: Assigned (was: Available)
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/423b422b6ce147aa3bb4858ab498802751c52c9b

commit 423b422b6ce147aa3bb4858ab498802751c52c9b
Author: shanmuga.m <shanmuga.m@samsung.com>
Date: Fri Apr 28 08:47:00 2017

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}

[delete] https://crrev.com/a8c329d4466035b680575a794744e469641e7b9b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/DOMImplementation-createDocument-expected.txt
[delete] https://crrev.com/a8c329d4466035b680575a794744e469641e7b9b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/DOMImplementation-createDocumentType-expected.txt
[delete] https://crrev.com/a8c329d4466035b680575a794744e469641e7b9b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/Document-createElementNS-expected.txt
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/attributes-expected.txt
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err.html
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err-expected.txt
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err.html
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err.html
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err.html
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err-expected.txt
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err.html
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/LayoutTests/http/tests/misc/acid3.html
[modify] https://crrev.com/423b422b6ce147aa3bb4858ab498802751c52c9b/third_party/WebKit/Source/core/dom/Document.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment