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

@scope #625

Closed
andruud opened this issue Mar 25, 2022 · 3 comments
Closed

@scope #625

andruud opened this issue Mar 25, 2022 · 3 comments

Comments

@andruud
Copy link

andruud commented Mar 25, 2022

Request for Mozilla Position on an Emerging Web Specification

Other information

At this time I'm requesting a position for @scope only, not including:

  • Scoped Descendant Combinator, e.g. .a >> .b.
  • Selector Scoping Notation, e.g. (.foo / .bar) .a { ... }.
@emilio
Copy link
Collaborator

emilio commented Mar 25, 2022

Over-all seems reasonable, though I'm a bit confused/concerned about the :scope rules. The spec says:

Selectors are scoped to the given scope, with the :scope element being the scoping root.

I think the :scope definition is circular there (because the scoping root is defined to be :scope), but ignoring that... I think that means that you need to compute the scope for a given selector before you start matching it, right? Which means you need to do a bunch of extra work for selectors that don't end up matching, which is a bit unfortunate... Of course you can do the bloom filter rejection earlier, presumably, but still..

@andruud
Copy link
Author

andruud commented Mar 25, 2022

Yeah, :scope is the most annoying part here.

I think that means that you need to compute the scope for a given selector before you start matching it, right?

I was exploring the possibility of dynamically figuring out the scope element when :scope is encountered in the selector, so at least for e.g. :scope > .foo we'd check .foo first before doing horrible things to check for :scope. But that has some challenges as well ...

@zcorpan
Copy link
Member

zcorpan commented Jan 10, 2023

Closing as dup of #472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants