Test for a nested :scope inside an :is()#43697
Merged
andruud merged 2 commits intoweb-platform-tests:masterfrom Jan 3, 2024
Merged
Test for a nested :scope inside an :is()#43697andruud merged 2 commits intoweb-platform-tests:masterfrom
:scope inside an :is()#43697andruud merged 2 commits intoweb-platform-tests:masterfrom
Conversation
Contributor
|
To my understanding of the spec, the inner rule selector should be The test seems fine (albeit fairly complex to follow 😅), it looks like an implementation bug in Chromium (FWIW, it passes on WebKit main). |
mdubet
approved these changes
Dec 20, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
:scopeis 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-rootworks 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