feat: add Shadow DOM support for XPath queries#682
feat: add Shadow DOM support for XPath queries#682xjasonli wants to merge 1 commit intoFontoXML:masterfrom
Conversation
|
Thanks for the PR! Just looking through it. It's a tricky one, since the XQuery DOM has no notion of document fragments. I do agree fontoxpath can just treat them as document nodes, with multiple children. No harm in that. A test or two would be really useful here. Slimdom has support for document fragments, which is I think the gist of this PR: supporting document fragments. A test for the sibling axis might be specifically interesting: creating a document fragment with two elements, and addressing the second one from the first with Can we rename the commits to supporting Document Fragments? I first thought we were implementing going from a shadow host into its shadowroot, exposing the shadowroot as a child of its host. Not sure if we want that. KR, Martin |
61808e3 to
66f3407
Compare
|
Hi Martin Thanks for the suggestions! I just force-pushed the updates. I added some tests for document fragments, and the sibling axis one is working great. I also renamed the commit to "Support document fragments as root/context node" to keep things clear. Let me know what you think! |
Support DOCUMENT_FRAGMENT_NODE (ShadowRoot) as valid root for XPath expressions. Includes namespace resolution fallback to host element since ShadowRoot.lookupNamespaceURI returns null.
Fix: #681