[go: nahoru, domu]

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

Allow 'lower-boundary' scoping argument in querySelector() #1172

Open
mirisuzanne opened this issue Mar 20, 2023 · 2 comments
Open

Allow 'lower-boundary' scoping argument in querySelector() #1172

mirisuzanne opened this issue Mar 20, 2023 · 2 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: nodes

Comments

@mirisuzanne
Copy link

The CSSWG is working on new 'scoping' functionality, that allows authors to establish both upper (root) and lower boundaries on a 'scoped' selector. The result is that selectors match within a tree fragment starting at the root, and containing all descendants up until a lower boundary selector is matched.

It would be great to have this option available for authors in querySelector() as well. In our discussions, @tabatkins suggested the following:

In particular, the current second argument to qS() is, effectively, the upper bound of scoping; we could expand the argument to be an options bag with {upper: [nodes], lower: [nodes]} to accommodate both directions.

@annevk annevk added needs implementer interest Moving the issue forward requires implementers to express interest addition/proposal New features or enhancements topic: nodes labels Mar 22, 2023
@annevk
Copy link
Member
annevk commented Mar 22, 2023

It currently doesn't have a second argument?

Also, https://whatwg.org/faq#adding-new-features applies here. In addition to what is stated there it would be good to know if this is a frequent issue developers face (e.g., questions on Stack Overflow) and whether libraries are addressing this problem.

@tabatkins
Copy link
Contributor

It currently doesn't have a second argument?

Oh lol, I'm still remembering the original form of querySelector from a decade ago. Well, what I mean is really the context argument is the upper boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: nodes
Development

No branches or pull requests

3 participants