-
Notifications
You must be signed in to change notification settings - Fork 717
[css-cascade-6] clarification of :scope
matching in nested scopes
#9741
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
Comments
This was behavior was always the intent, we just need an editorial change here IMO. |
The spec, Chrome and Safari all seem to have the same behaviour here ( |
It seems like we might be able to close this as a browser bug that's been fixed (question answered)? I'm not sure we need any resolution. @fantasai you added the agenda+ label - was there something more that needed discussion on this? |
Testing it in the latest Safari TP — it seems things now behave the same as in Chrome, and the spec edit seems sufficient, so it is ok to close this issue and remove from the agenda. |
While testing different ways scopes interact when being nested, and how
:scope
behaves inside them in both Chrome and Safari Technology Preview, I found a difference in how the browsers treat the:scope
when there are nested scopes present.Here is a CodePen with the example: https://codepen.io/kizu/pen/xxBxKao
HTML & CSS for this example
I consider the way it works now in Chrome (the
:scope
matches the innermost closest defined scope) as correct. I did not find anything in the specs (https://drafts.csswg.org/css-cascade-6/#scope-scope) outside example 8, which shows the scope equivalence, where the:scope
matches the inner scoping root.Given how Safari currently uses the topmost scoping root instead, I think it would be nice to clarify the behavior of the
:scope
inside nested scopes explicitly in the normative parts of the spec, so there will be less left for interpretation.The text was updated successfully, but these errors were encountered: