Closed Bug 1872986 Opened 9 months ago Closed 8 months ago

[wpt-sync] Sync PR 43849 - [@scope] Produce kScopeActivation relations for scoped nesting

Categories

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

task

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

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

[@scope] Produce kScopeActivation relations for scoped nesting

When parsing style rules that are immediate children of an @scope rule,
any compound selector which contains either :scope or '&' is prepended
with RelationType::kScopeActivation. This relation is what triggers
the "figure out if we're indeed in scope, and what the scoping root is"-
behavior during SelectorChecker, and without the kScopeActivation, we'll
just fall back to the regular behavior for :scope (i.e. it matches :root
in the normal cases).

This CL fixes a bug which caused missing kScopeActivations for nested
style rules within @scope, e.g.:

@scope (a) {
b {
/* :scope needs to refer to 'a' here */
:scope:not(&) { ... }
}
}

This doesn't work, because we're basing the kScopeActivation emit/no-emit
decision on the nesting type of the immediate parent rule, which in this
case is CSSNestingType::kNesting. We need to know whether any ancestor
rule is an @scope rule, and so we propagate a flag for this, and base
the emit/no-emit decision on this instead.

Fixed: 1512217
Change-Id: I35d28489dd8255badd2e9a9c911fda3e2541bb52
Reviewed-on: https://chromium-review.googlesource.com/5164291
WPT-Export-Revision: 316714ef7aa9947897212778429b4f76d7a01995

PR 43849 applied with additional changes from upstream: bc19e8e7679b438b658e2ee81c916740b2b1111d
Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 17 subtests

Status Summary

Firefox

OK : 1
PASS: 1
FAIL: 16

Chrome

OK : 1
PASS: 13
FAIL: 4

Safari

OK : 1
PASS: 11
FAIL: 6

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

  • /css/css-cascade/scope-nesting.html [wpt.fyi]
    • Implicit :scope in <scope-end>: FAIL (Chrome: PASS, Safari: FAIL)
    • Relative selectors in <scope-end>: FAIL (Chrome: PASS, Safari: PASS)
    • Nesting-selector in the scope's <stylesheet>: FAIL (Chrome: PASS, Safari: PASS)
    • Nesting-selector within :scope rule: FAIL (Chrome: PASS, Safari: PASS)
    • Nesting-selector within :scope rule (double nested): FAIL (Chrome: PASS, Safari: PASS)
    • @scope nested within style rule: FAIL (Chrome: PASS, Safari: PASS)
    • Parent pseudo class within scope-start: FAIL (Chrome: PASS, Safari: PASS)
    • Parent pseudo class within scope-end: FAIL (Chrome: PASS, Safari: FAIL)
    • Parent pseudo class within body of nested @scope: FAIL (Chrome: PASS, Safari: FAIL)
    • Implicit rule within nested @scope : FAIL (Chrome: PASS, Safari: FAIL)
    • Implicit rule within nested @scope (proximity): FAIL (Chrome: PASS, Safari: FAIL)
    • Nested :scope inside an :is: FAIL (Chrome: FAIL, Safari: PASS)
    • :scope within nested and scoped rule: FAIL (Chrome: FAIL, Safari: PASS)
    • :scope within nested and scoped rule (implied &): FAIL (Chrome: FAIL, Safari: PASS)
    • :scope within nested and scoped rule (relative): FAIL (Chrome: FAIL, Safari: PASS)
    • Scoped nested group rule: FAIL (Chrome: PASS, Safari: PASS)
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/afd101f7f29e
[wpt PR 43849] - [@scope] Produce kScopeActivation relations for scoped nesting, a=testonly
https://hg.mozilla.org/integration/autoland/rev/4e0e2d88da8e
[wpt PR 43849] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
You need to log in before you can comment on or make changes to this bug.