Closed Bug 1840070 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 40722 - [@scope] Support @scope nested within style rules

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 40722 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/40722
Details from upstream follow.

Anders Hartvoll Ruud <andruud@chromium.org> wrote:

[@scope] Support @scope nested within style rules

This CL adds support for nesting @scope inside regular style rules, e.g.

.a {
@scope (& .b) {
& { ... }
}
}

Note that @scope is a little different from other nested group rules
(like @media), because @scope itself acts as the parent style rule
for the purposes of evaluating the parent pseudo-class (&) inside the
body [1].

This means the '&' in the @scope's prelude refers to the '.a' selector,
but the '&' in @scope's body refers to the selector in the prelude,
which effectively is '.a .b'.

[1] https://drafts.csswg.org/css-nesting/#nesting-at-scope

Bug: 1456435
Change-Id: I6f53566d9e9bde50a888ab3b86dfd6699f004ebd
Reviewed-on: https://chromium-review.googlesource.com/4637290
WPT-Export-Revision: 525d492e4a48119f9ddba7067382c34068192353

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a5540d8b4575 [wpt PR 40722] - [@scope] Support @scope nested within style rules, a=testonly https://hg.mozilla.org/integration/autoland/rev/512432d04d46 [wpt PR 40722] - Update wpt metadata, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
You need to log in before you can comment on or make changes to this bug.