Closed juliandescottes closed 3 weeks ago
See #702
Shadow roots are also non-element nodes so I think the locator API is meant to accept Node's in general. We should probably make sure a11y and innerPath algorithms check the node type before performing element specific steps.
All locators have now been updated to handle non-element context nodes correctly. Either they support it by definition (css, xpath), or logic has been added to handle them.
In the current spec for browsingContext.locateNodes, it is not clear if we can pass only
Element
in thestartNodes
parameter or if non-Elements (egDocument
) are allowed.For the accessibility and innerText locators, the spec calls other specs which only work with Elements:
Should we restrict startNodes to only contain Elements? Or should we add a special case if a
Document
is provided to use its document element?