[css-cascade-6] clarification of :scope
matching in nested scopes
#9741
Labels
Closed as Question Answered
Used when the issue is more of a question than a problem, and it's been answered.
css-cascade-6
Projects
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: