Test case: data:text/html,<!DOCTYPE%20html><script>document.write(document.evaluate('%2F%2Fnode()'%2C%20document%2C%20null%2C%20XPathResult.FIRST_ORDERED_NODE_TYPE%2C%20null).singleNodeValue%20%3D%3D%20document.documentElement%20%3F%20'PASS'%20%3A%20'FAIL')<%2Fscript>
Created attachment 144929 [details] test case Same test as attachment, because long URL breaks layout.
Could you please explain why this is wrong? I'm not disagreeing with you, it's just not obvious.
(In reply to comment #2) > Could you please explain why this is wrong? I'm not disagreeing with you, it's just not obvious. The DOCTYPE declaration is not acknowledged in the XPath/XSLT data model. “support for DTDs in the data model” is listed in Appendix G of the XSLT 1.0 Recommendation as a feature under consideration for future versions. http://www.w3.org/TR/xslt#section-Features-under-Consideration-for-Future-Versions-of-XSLT
The XSLT spec doesn't govern XPathEvaluator behavior. The best we have is <http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html>.
http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#Mapping only lists these: > 1.2.1 Element Nodes > 1.2.2 Attribute Nodes > 1.2.3 Namespace Nodes > 1.2.4 Text Nodes > 1.2.5 Entity Reference Nodes > 1.2.6 Comment Nodes > 1.2.7 Processing Instruction Nodes > 1.2.8 Document order Document Type Nodes are not included.
This is probably a misinterpretation of http://www.w3.org/TR/xpath/#NT-NodeType, which says: > A node test `node()` is true for any node of any type whatsoever. This should have said: > A node test `node()` is true for any node of any XPath-defined node type whatsoever. This is clear when you look at the production below, which only mentions the specified node types: > [7] NodeTest ::= NameTest > | NodeType '(' ')' > | 'processing-instruction' '(' Literal ')' Where `NodeTest` is defined as: > [38] NodeType ::= 'comment' > | 'text' > | 'processing-instruction' > | 'node' Document type nodes are neither of those four options.
Mass moving XML DOM bugs to the "DOM" Component.
All browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6 on macOS 12.5) show "FAIL" in this test case, is it web-spec issue or all browsers haven't implemented something which is needed for this test?
All browsers agree -> Config Changed. Nothing to be done here.