Test for a nested :scope
inside an :is()
#43697
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quoting the specs for
:scope
,In the following code, there is a scoping root: the
.a
.However, right now, in the Chromium implementation, when the
:scope
is mentioned inside nesting, does not “see” the wrapping@scope
, and treats it as:root
, according toHowever, this is only true if we'd take the inner
&:is(:scope.x *)
in isolation, but because it is, in fact, inside the@scope
, it should detect the scoping root, as we can think of it as:scope .foo:is(:scope:hover *)
, which works (see it in action in the CodePen where I stumbled upon this: https://codepen.io/kizu/pen/NWoZYwK); I did also add it as an assertion.This is not an abstract example, and having this case to work as in the test assertion will be very useful for authors. It could allow us to use this method to clarify the conditions over the root node from inside the nesting, similar to how
@at-root
works in Sass, or how root reference works in Stylus.cc @mirisuzanne
Update: cross-linking a Chromium bug I filled about this: https://bugs.chromium.org/p/chromium/issues/detail?id=1512217