-
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
lookupNamespaceURI('xml') #857
lookupNamespaceURI('xml') #857
Comments
@tkent-google I believe Chrome and Safari implement "correctly resolving the implicit xml prefix" wording of the spec this way. Firefox behavior seems more straightforward and, more importantly, is web-compatible. If Chrome will drop special handling of |
Note that Firefox does this for both |
Thanks! So the change will be:
WebKit people, do you have an objection? WebKit can remove |
@tkent-google @shvaikalesh works on WebKit so I'd say this is ready for a PR and tests. (As do I nowadays, but I'll defer to him. 😊) |
No objection. |
If we apply the change of whatwg/dom#857, createNSResolver() with - Attr not owned by an Element, - CharacterData not in an Element parent, or - Other non-element type nodes will return incompatible objects. Bug: whatwg/dom#857 Change-Id: I50434e9b359c50c7c97f3de9a66d3676e76a104d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4075448 Commit-Queue: Joey Arhar <[email protected]> Reviewed-by: Joey Arhar <[email protected]> Auto-Submit: Kent Tamura <[email protected]> Cr-Commit-Position: refs/heads/main@{#1078754}
Got it. Thanks! Google Chrome will collect data about incompatibility of |
The counter introduced by crrev.com/c/4075448 was not precise. We'd like to count cases where lookupNamespaceURI('xml') will return null. We don't need to count if 'xml' prefix is not looked up. Bug: whatwg/dom#857 Change-Id: I4391295ef65f1b28e0ac69c551dc191cc1ed9cc5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4081428 Commit-Queue: Joey Arhar <[email protected]> Auto-Submit: Kent Tamura <[email protected]> Reviewed-by: Joey Arhar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1079620}
It counted "xml" lookups for elements incorrectly though we wanted to count lookups for non-element nodes. This CL fixes the condition, and switches to a new counter. Bug: whatwg/dom#857 Change-Id: I467f24e34dce29fcfcc2fcac230af56665d9cc26 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4273811 Reviewed-by: Koji Ishii <[email protected]> Commit-Queue: Koji Ishii <[email protected]> Auto-Submit: Kent Tamura <[email protected]> Cr-Commit-Position: refs/heads/main@{#1107591}
Specification: https://dom.spec.whatwg.org/#locate-a-namespace https://dom.spec.whatwg.org/#dom-xpathnsresolver-lookupnamespaceuri https://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-createNSResolver
Chrome, EdgeHTML, and Safari follow the current definition of
Node.lookupNamespaceURI()
andXPathEvaluator.createNSResolver()
. That is to say,Node.lookupNamespacURI()
has no special handling for 'xml' prefix, and an object returned bycreateNSResolver()
has it.On the other hand, Firefox's
Node.lookupNamespaceURI('xml')
returns the XML namespace if the node is anElement
, and Firefox'sXPathEvaluator.createNSResolver()
just returns the specified node.I prefer the Firefox behavior because of its simplicity.
Demo code:
The text was updated successfully, but these errors were encountered: