-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a single exception for name validation #423
Conversation
I have confirmed that Safari Tech Preview has not updated to follow the (current) spec yet, at least for I also searched bugs.webkit.org for createElementNS, NamespaceError, InvalidCharacterError, NAMESPACE_ERR, and INVALID_CHARACTER_ERR with no results that indicate they're tracking this. Oh, and I tested Edge and it also does InvalidCharacterError. |
So it's not that simple. The changed tests cause failures in all browsers. They all use NAMESPACE_ERR for some set of invalid names currently. So bz expressed willingness to change that so that name validation uses a single exception, but seeing the results we'd need explicit sign-off from @tkent-google and @cdumez too, at least. |
Oh. In that case maybe it is indeed better to wait to see if we can relax the validation rules, instead of changing twice :-/. |
…mespaceError https://bugs.webkit.org/show_bug.cgi?id=171052 Reviewed by Sam Weinig. LayoutTests/imported/w3c: Re-sync web-platform-tests/dom from upstream to gain test coverage. * web-platform-tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html: * web-platform-tests/dom/collections/HTMLCollection-empty-name.html: * web-platform-tests/dom/collections/HTMLCollection-supported-property-indices.html: * web-platform-tests/dom/collections/HTMLCollection-supported-property-names.html: * web-platform-tests/dom/collections/domstringmap-supported-property-names.html: * web-platform-tests/dom/collections/namednodemap-supported-property-names.html: * web-platform-tests/dom/events/AddEventListenerOptions-once.html: * web-platform-tests/dom/events/AddEventListenerOptions-passive.html: * web-platform-tests/dom/events/CustomEvent.html: * web-platform-tests/dom/events/Event-cancelBubble.html: * web-platform-tests/dom/events/Event-constants.html: * web-platform-tests/dom/events/Event-constructors.html: * web-platform-tests/dom/events/Event-defaultPrevented-after-dispatch.html: * web-platform-tests/dom/events/Event-defaultPrevented.html: * web-platform-tests/dom/events/Event-dispatch-bubble-canceled.html: * web-platform-tests/dom/events/Event-dispatch-bubbles-false.html: * web-platform-tests/dom/events/Event-dispatch-bubbles-true.html: * web-platform-tests/dom/events/Event-dispatch-click.html: * web-platform-tests/dom/events/Event-dispatch-detached-click.html: * web-platform-tests/dom/events/Event-dispatch-handlers-changed.html: * web-platform-tests/dom/events/Event-dispatch-multiple-cancelBubble.html: * web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation.html: * web-platform-tests/dom/events/Event-dispatch-omitted-capture.html: * web-platform-tests/dom/events/Event-dispatch-order.html: * web-platform-tests/dom/events/Event-dispatch-other-document.html: * web-platform-tests/dom/events/Event-dispatch-propagation-stopped.html: * web-platform-tests/dom/events/Event-dispatch-redispatch.html: * web-platform-tests/dom/events/Event-dispatch-reenter.html: * web-platform-tests/dom/events/Event-dispatch-target-moved.html: * web-platform-tests/dom/events/Event-dispatch-target-removed.html: * web-platform-tests/dom/events/Event-dispatch-throwing.html: * web-platform-tests/dom/events/Event-init-while-dispatching.html: * web-platform-tests/dom/events/Event-initEvent.html: * web-platform-tests/dom/events/Event-propagation.html: * web-platform-tests/dom/events/Event-subclasses-constructors.html: * web-platform-tests/dom/events/Event-type-empty.html: * web-platform-tests/dom/events/Event-type.html: * web-platform-tests/dom/events/EventListener-handleEvent.html: * web-platform-tests/dom/events/EventListener-incumbent-global-1.sub.html: * web-platform-tests/dom/events/EventListener-incumbent-global-2.sub.html: * web-platform-tests/dom/events/EventListener-invoke-legacy.html: * web-platform-tests/dom/events/EventListenerOptions-capture.html: * web-platform-tests/dom/events/EventTarget-addEventListener.html: * web-platform-tests/dom/events/EventTarget-dispatchEvent-returnvalue.html: * web-platform-tests/dom/events/EventTarget-dispatchEvent.html: * web-platform-tests/dom/events/EventTarget-removeEventListener.html: * web-platform-tests/dom/historical.html: * web-platform-tests/dom/interface-objects.html: * web-platform-tests/dom/interfaces.html: * web-platform-tests/dom/lists/DOMTokenList-Iterable.html: * web-platform-tests/dom/lists/DOMTokenList-coverage-for-attributes.html: * web-platform-tests/dom/lists/DOMTokenList-iteration.html: * web-platform-tests/dom/lists/DOMTokenList-stringifier.html: * web-platform-tests/dom/lists/DOMTokenList-value.html: * web-platform-tests/dom/nodes/CharacterData-appendChild.html: * web-platform-tests/dom/nodes/CharacterData-appendData.html: * web-platform-tests/dom/nodes/CharacterData-data.html: * web-platform-tests/dom/nodes/CharacterData-deleteData.html: * web-platform-tests/dom/nodes/CharacterData-insertData.html: * web-platform-tests/dom/nodes/CharacterData-remove.html: * web-platform-tests/dom/nodes/CharacterData-replaceData.html: * web-platform-tests/dom/nodes/CharacterData-substringData.html: * web-platform-tests/dom/nodes/CharacterData-surrogates.html: * web-platform-tests/dom/nodes/ChildNode-after.html: * web-platform-tests/dom/nodes/ChildNode-before.html: * web-platform-tests/dom/nodes/ChildNode-replaceWith.html: * web-platform-tests/dom/nodes/Comment-constructor.html: * web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt: * web-platform-tests/dom/nodes/DOMImplementation-createDocument.html: * web-platform-tests/dom/nodes/DOMImplementation-createDocumentType-expected.txt: * web-platform-tests/dom/nodes/DOMImplementation-createDocumentType.html: * web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument.html: * web-platform-tests/dom/nodes/DOMImplementation-hasFeature.html: * web-platform-tests/dom/nodes/Document-URL.sub.html: * web-platform-tests/dom/nodes/Document-adoptNode.html: * web-platform-tests/dom/nodes/Document-characterSet-normalization.html: * web-platform-tests/dom/nodes/Document-constructor.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_bmp.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_css.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_gif.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_html.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_javascripturi.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_jpg.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_01.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_02.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_png.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_txt.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_xml.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/createDocument.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/createHTMLDocument.html: * web-platform-tests/dom/nodes/Document-contentType/contentType/xhr_responseType_document.html: * web-platform-tests/dom/nodes/Document-createAttribute.html: * web-platform-tests/dom/nodes/Document-createComment.html: * web-platform-tests/dom/nodes/Document-createElement-namespace-tests/w3c-import.log: * web-platform-tests/dom/nodes/Document-createElement-namespace.html: * web-platform-tests/dom/nodes/Document-createElement.html: * web-platform-tests/dom/nodes/Document-createElementNS-expected.txt: * web-platform-tests/dom/nodes/Document-createElementNS.html: * web-platform-tests/dom/nodes/Document-createElementNS.js: * web-platform-tests/dom/nodes/Document-createEvent.html: * web-platform-tests/dom/nodes/Document-createProcessingInstruction-xhtml.xhtml: * web-platform-tests/dom/nodes/Document-createProcessingInstruction.html: * web-platform-tests/dom/nodes/Document-createTextNode.html: * web-platform-tests/dom/nodes/Document-createTreeWalker.html: * web-platform-tests/dom/nodes/Document-doctype.html: * web-platform-tests/dom/nodes/Document-getElementById.html: * web-platform-tests/dom/nodes/Document-getElementsByTagName-xhtml.xhtml: * web-platform-tests/dom/nodes/Document-getElementsByTagName.html: * web-platform-tests/dom/nodes/Document-getElementsByTagNameNS.html: * web-platform-tests/dom/nodes/Document-implementation.html: * web-platform-tests/dom/nodes/Document-importNode.html: * web-platform-tests/dom/nodes/DocumentType-literal-xhtml.xhtml: * web-platform-tests/dom/nodes/DocumentType-literal.html: * web-platform-tests/dom/nodes/DocumentType-remove.html: * web-platform-tests/dom/nodes/Element-childElement-null-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-childElement-null.html: * web-platform-tests/dom/nodes/Element-childElementCount-dynamic-add-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-childElementCount-dynamic-add.html: * web-platform-tests/dom/nodes/Element-childElementCount-dynamic-remove-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-childElementCount-dynamic-remove.html: * web-platform-tests/dom/nodes/Element-childElementCount-nochild-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-childElementCount-nochild.html: * web-platform-tests/dom/nodes/Element-childElementCount-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-childElementCount.html: * web-platform-tests/dom/nodes/Element-children.html: * web-platform-tests/dom/nodes/Element-classlist.html: * web-platform-tests/dom/nodes/Element-closest.html: * web-platform-tests/dom/nodes/Element-firstElementChild-entity-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-firstElementChild-namespace-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-firstElementChild-namespace.html: * web-platform-tests/dom/nodes/Element-firstElementChild-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-firstElementChild.html: * web-platform-tests/dom/nodes/Element-getElementsByClassName.html: * web-platform-tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess.html: * web-platform-tests/dom/nodes/Element-getElementsByTagName.html: * web-platform-tests/dom/nodes/Element-getElementsByTagNameNS.html: * web-platform-tests/dom/nodes/Element-hasAttributes.html: * web-platform-tests/dom/nodes/Element-insertAdjacentElement.html: * web-platform-tests/dom/nodes/Element-insertAdjacentText.html: * web-platform-tests/dom/nodes/Element-lastElementChild-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-lastElementChild.html: * web-platform-tests/dom/nodes/Element-matches.html: * web-platform-tests/dom/nodes/Element-nextElementSibling-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-nextElementSibling.html: * web-platform-tests/dom/nodes/Element-previousElementSibling-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-previousElementSibling.html: * web-platform-tests/dom/nodes/Element-remove.html: * web-platform-tests/dom/nodes/Element-removeAttributeNS.html: * web-platform-tests/dom/nodes/Element-siblingElement-null-xhtml.xhtml: * web-platform-tests/dom/nodes/Element-siblingElement-null.html: * web-platform-tests/dom/nodes/Element-tagName.html: * web-platform-tests/dom/nodes/Element-webkitMatchesSelector.html: * web-platform-tests/dom/nodes/MutationObserver-attributes.html: * web-platform-tests/dom/nodes/MutationObserver-characterData.html: * web-platform-tests/dom/nodes/MutationObserver-childList.html: * web-platform-tests/dom/nodes/MutationObserver-disconnect.html: * web-platform-tests/dom/nodes/MutationObserver-document.html: * web-platform-tests/dom/nodes/MutationObserver-inner-outer.html: * web-platform-tests/dom/nodes/MutationObserver-takeRecords.html: * web-platform-tests/dom/nodes/Node-appendChild.html: * web-platform-tests/dom/nodes/Node-baseURI.html: * web-platform-tests/dom/nodes/Node-childNodes.html: * web-platform-tests/dom/nodes/Node-cloneNode.html: * web-platform-tests/dom/nodes/Node-compareDocumentPosition.html: * web-platform-tests/dom/nodes/Node-constants.html: * web-platform-tests/dom/nodes/Node-contains-xml.xml: * web-platform-tests/dom/nodes/Node-contains.html: * web-platform-tests/dom/nodes/Node-insertBefore.html: * web-platform-tests/dom/nodes/Node-isConnected.html: * web-platform-tests/dom/nodes/Node-isEqualNode-xhtml.xhtml: * web-platform-tests/dom/nodes/Node-isEqualNode.html: * web-platform-tests/dom/nodes/Node-isSameNode.html: * web-platform-tests/dom/nodes/Node-lookupNamespaceURI.html: * web-platform-tests/dom/nodes/Node-lookupPrefix.xhtml: * web-platform-tests/dom/nodes/Node-nodeName-xhtml.xhtml: * web-platform-tests/dom/nodes/Node-nodeName.html: * web-platform-tests/dom/nodes/Node-nodeValue.html: * web-platform-tests/dom/nodes/Node-normalize.html: * web-platform-tests/dom/nodes/Node-parentElement.html: * web-platform-tests/dom/nodes/Node-parentNode.html: * web-platform-tests/dom/nodes/Node-properties.html: * web-platform-tests/dom/nodes/Node-removeChild.html: * web-platform-tests/dom/nodes/Node-replaceChild.html: * web-platform-tests/dom/nodes/Node-textContent.html: * web-platform-tests/dom/nodes/NodeList-Iterable.html: * web-platform-tests/dom/nodes/ParentNode-append.html: * web-platform-tests/dom/nodes/ParentNode-prepend.html: * web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht.xht: * web-platform-tests/dom/nodes/ParentNode-querySelector-All.html: * web-platform-tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml: * web-platform-tests/dom/nodes/ProcessingInstruction-literal-1.xhtml: * web-platform-tests/dom/nodes/ProcessingInstruction-literal-2.xhtml: * web-platform-tests/dom/nodes/Text-constructor.html: * web-platform-tests/dom/nodes/Text-splitText.html: * web-platform-tests/dom/nodes/append-on-Document.html: * web-platform-tests/dom/nodes/attributes-expected.txt: * web-platform-tests/dom/nodes/attributes.html: * web-platform-tests/dom/nodes/case.html: * web-platform-tests/dom/nodes/getElementsByClassName-01.htm: * web-platform-tests/dom/nodes/getElementsByClassName-02.htm: * web-platform-tests/dom/nodes/getElementsByClassName-03.htm: * web-platform-tests/dom/nodes/getElementsByClassName-04.htm: * web-platform-tests/dom/nodes/getElementsByClassName-05.htm: * web-platform-tests/dom/nodes/getElementsByClassName-06.htm: * web-platform-tests/dom/nodes/getElementsByClassName-07.htm: * web-platform-tests/dom/nodes/getElementsByClassName-08.htm: * web-platform-tests/dom/nodes/getElementsByClassName-09.htm: * web-platform-tests/dom/nodes/getElementsByClassName-10.xml: * web-platform-tests/dom/nodes/getElementsByClassName-11.xml: * web-platform-tests/dom/nodes/getElementsByClassName-12.htm: * web-platform-tests/dom/nodes/getElementsByClassName-13.htm: * web-platform-tests/dom/nodes/getElementsByClassName-14.htm: * web-platform-tests/dom/nodes/getElementsByClassName-15.htm: * web-platform-tests/dom/nodes/getElementsByClassName-16.htm: * web-platform-tests/dom/nodes/getElementsByClassName-17.htm: * web-platform-tests/dom/nodes/getElementsByClassName-18.htm: * web-platform-tests/dom/nodes/getElementsByClassName-19.htm: * web-platform-tests/dom/nodes/getElementsByClassName-20.htm: * web-platform-tests/dom/nodes/getElementsByClassName-21.htm: * web-platform-tests/dom/nodes/getElementsByClassName-22.htm: * web-platform-tests/dom/nodes/getElementsByClassName-23.htm: * web-platform-tests/dom/nodes/getElementsByClassName-24.htm: * web-platform-tests/dom/nodes/getElementsByClassName-25.htm: * web-platform-tests/dom/nodes/getElementsByClassName-26.htm: * web-platform-tests/dom/nodes/getElementsByClassName-27.htm: * web-platform-tests/dom/nodes/getElementsByClassName-28.htm: * web-platform-tests/dom/nodes/getElementsByClassName-29.htm: * web-platform-tests/dom/nodes/getElementsByClassName-30.htm: * web-platform-tests/dom/nodes/getElementsByClassName-31.htm: * web-platform-tests/dom/nodes/insert-adjacent.html: * web-platform-tests/dom/nodes/prepend-on-Document.html: * web-platform-tests/dom/nodes/remove-unscopable.html: * web-platform-tests/dom/nodes/rootNode.html: * web-platform-tests/dom/nodes/w3c-import.log: * web-platform-tests/dom/ranges/Range-attributes.html: * web-platform-tests/dom/ranges/Range-cloneContents.html: * web-platform-tests/dom/ranges/Range-cloneRange.html: * web-platform-tests/dom/ranges/Range-collapse.html: * web-platform-tests/dom/ranges/Range-commonAncestorContainer-2.html: * web-platform-tests/dom/ranges/Range-commonAncestorContainer.html: * web-platform-tests/dom/ranges/Range-compareBoundaryPoints.html: * web-platform-tests/dom/ranges/Range-comparePoint-2.html: * web-platform-tests/dom/ranges/Range-comparePoint.html: * web-platform-tests/dom/ranges/Range-constructor.html: * web-platform-tests/dom/ranges/Range-deleteContents.html: * web-platform-tests/dom/ranges/Range-detach.html: * web-platform-tests/dom/ranges/Range-extractContents.html: * web-platform-tests/dom/ranges/Range-insertNode.html: * web-platform-tests/dom/ranges/Range-intersectsNode-binding.html: * web-platform-tests/dom/ranges/Range-intersectsNode.html: * web-platform-tests/dom/ranges/Range-isPointInRange.html: * web-platform-tests/dom/ranges/Range-mutations-appendChild.html: * web-platform-tests/dom/ranges/Range-mutations-appendData.html: * web-platform-tests/dom/ranges/Range-mutations-dataChange.html: * web-platform-tests/dom/ranges/Range-mutations-deleteData.html: * web-platform-tests/dom/ranges/Range-mutations-insertBefore.html: * web-platform-tests/dom/ranges/Range-mutations-insertData.html: * web-platform-tests/dom/ranges/Range-mutations-removeChild.html: * web-platform-tests/dom/ranges/Range-mutations-replaceChild.html: * web-platform-tests/dom/ranges/Range-mutations-replaceData.html: * web-platform-tests/dom/ranges/Range-mutations-splitText.html: * web-platform-tests/dom/ranges/Range-selectNode.html: * web-platform-tests/dom/ranges/Range-set.html: * web-platform-tests/dom/ranges/Range-stringifier.html: * web-platform-tests/dom/ranges/Range-surroundContents.html: * web-platform-tests/dom/traversal/NodeFilter-constants.html: * web-platform-tests/dom/traversal/NodeIterator-removal.html: * web-platform-tests/dom/traversal/NodeIterator.html: * web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter.html: * web-platform-tests/dom/traversal/TreeWalker-basic.html: * web-platform-tests/dom/traversal/TreeWalker-currentNode.html: * web-platform-tests/dom/traversal/TreeWalker-previousNodeLastChildReject.html: * web-platform-tests/dom/traversal/TreeWalker-previousSiblingLastChildSkip.html: * web-platform-tests/dom/traversal/TreeWalker-traversal-reject.html: * web-platform-tests/dom/traversal/TreeWalker-traversal-skip-most.html: * web-platform-tests/dom/traversal/TreeWalker-traversal-skip.html: * web-platform-tests/dom/traversal/TreeWalker-walking-outside-a-tree.html: * web-platform-tests/dom/traversal/TreeWalker.html: Source/WebCore: Validating a qualified name should only throw InvalidCharacterError, not NamespaceError, after: - whatwg/dom#319 - web-platform-tests/wpt#5161 - whatwg/dom#423 Latest spec: - https://dom.spec.whatwg.org/#validate No new tests, updated web-platform-tests. * dom/Document.cpp: (WebCore::Document::parseQualifiedName): LayoutTests: Updated / rebaselined existing tests to reflect behavior change. * fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt: * fast/dom/DOMImplementation/createDocumentType-err-expected.txt: * fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js: * fast/dom/DOMImplementation/script-tests/createDocumentType-err.js: * fast/dom/Document/createAttributeNS-namespace-err-expected.txt: * fast/dom/Document/createElementNS-namespace-err-expected.txt: * fast/dom/Document/script-tests/createAttributeNS-namespace-err.js: * fast/dom/Document/script-tests/createElementNS-namespace-err.js: * fast/dom/Element/script-tests/setAttributeNS-namespace-err.js: * fast/dom/Element/setAttributeNS-namespace-err-expected.txt: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@215701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tests: web-platform-tests/wpt#5161.
Fixes #319.
Preview | Diff