Open SKYWy opened 1 month ago
From what I see, in PathExpr.applyLocationPath, we shouldn't have startNodes = [PathExpr.getRoot(xpc, nodes)]
if the node is a document-fragment.
Moreover, in PathExpr.applySteps, it seems that for shadow DOM, the reduce()
goes "too far", by that I mean that applyStepToNodes
was called once to often.
Hello,
I want to use the library to evaluate xPath in shadow DOMs in HTML, but have a problem when I use it with absolute xPath. Per definition, absolute XPath should look for the target in all of the document, but the document itself does not have access to the content of shadow DOM (which are
document-fragment
). In my case, the case where we use Shadow DOM as a document and have the absolute xpath only inside it, is enough. Is there a way to achieve it ?Here is the HTML and Javascript used:
The screenshot from the devTools
And the console