Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify if Document (and other non-Element Nodes) are allowed as startNodes of browsingContext.locateNodes #703

Closed
juliandescottes opened this issue Apr 24, 2024 · 3 comments
Labels
browsingContext Browsing Context module needs-discussion Issues to be discussed by the working group

Comments

@juliandescottes
Copy link
Contributor

In the current spec for browsingContext.locateNodes, it is not clear if we can pass only Element in the startNodes parameter or if non-Elements (eg Document) 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?

@juliandescottes juliandescottes added browsingContext Browsing Context module needs-discussion Issues to be discussed by the working group labels Apr 24, 2024
@juliandescottes
Copy link
Contributor Author

See #702

@OrKoN
Copy link
Contributor

OrKoN commented Apr 24, 2024

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.

@juliandescottes
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browsingContext Browsing Context module needs-discussion Issues to be discussed by the working group
Projects
None yet
Development

No branches or pull requests

2 participants