Node.lookupNamespceURI() supports "xml" and "xmlns" prefixes by default. The function returns fixed namespace strings for them.
Document.createNSResolver() and XPathEvaluator.createNSResolver() stops to wrap the specified node to add "xml" prefix handling. They return the specified node as is.
Web developers can use an element as an XPathNSResolver without wrapping it with createNSResolver().
TAG reviewNone. Two other browsers already shipped this.
TAG review statusNot applicable
Interoperability and Compatibility
The risk is low. Firefox has had this behavior for a long time, and Safari has adopted the behavior.
This feature has an incompatible change on createNSResolver(). If a disconnected non-element node is specified to createNSResolver(), the resultant object has no "xml" prefix support any longer. We have a UseCounter for such a case, and the counter value is 0.0.
: Shipped/Shipping (https://commits.webkit.org/260848@main
: No signalsOther signals
WebView application risks
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?YesYeshttps://wpt.fyi/results/domxpath/xpathevaluatorbase-creatensresolver.htmlhttps://wpt.fyi/results/dom/nodes/Node-lookupNamespaceURI.html