Closed Bug 1975531 Opened 1 year ago Closed 1 year ago

Change `&` behaviour inside `@scope` block as per spec resolution

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Points:
1

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: dshin, Assigned: dshin)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: [at-scope-m2], [wptsync upstream])

Attachments

(3 files)

Currently & behaves as if copy and pasting the scope-start-selector.
As per discussion logged in See Also, this is probably going to change:

  • Current suggested resolution is :where(:scope), like the implicitly inserted :scope.
  • There's going to be another discussion in a week's time to discuss alternatives.

Explainer here

See Also: → 1966706

Resolution was made to keep the suggested change, so will be working on this.

... Rather, just use the implicit scope selector, which is effectively the same
thing. This is done as per the recent CSSWG resolution [1].

[1] https://github.com/w3c/csswg-drafts/issues/9740

Assignee: nobody → dshin
Status: NEW → ASSIGNED

This is as per the CSSWG resolution [1].

  • scope-invalidation.html: Adjust for & no longer inheriting scope start
    selector's specificity.
  • scope-specificity.html: Now equate @scope(#main) { & .b {} } with
    :where(#main) .b in terms of specificity.
  • scope-nesting.html:
    • test_nest_scope_end: Now behaves identically to
      test_nest_scope_end_implicit_scope
    • test_inner_nest: Now behaves identically to
      test_parent_in_pseudo_scope
    • test_parent_pseudo_in_nested_scope_end: Removed; there's no equivalence
      with implicit :scope
    • test_insert_ampersand_rule_within_scope: Insert the selector using &
      before and after the selector using implicit scope selector, since
      order of apperance matters.

[1] https://github.com/w3c/csswg-drafts/issues/9740

Pushed by dshin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a44f91979c3a https://hg.mozilla.org/integration/autoland/rev/ba63941d4041 Change behaviour of parent selector in @scope to be :where(:scope). r=firefox-style-system-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/5dbaf0bb28a1 https://hg.mozilla.org/integration/autoland/rev/b7593b87da93 Adjust web-platform-tests for & being replaced by :where(:scope) in @scope. r=firefox-style-system-reviewers,emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/53831 for changes under testing/web-platform/tests
Whiteboard: [at-scope-triage] → [at-scope-triage], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
Points: --- → 1
Whiteboard: [at-scope-triage], [wptsync upstream] → [at-scope-m2], [wptsync upstream]
Keywords: dev-doc-needed
QA Whiteboard: [qa-triage-done-c143/b142]
Pushed by dshin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/97bf7293431c https://hg.mozilla.org/integration/autoland/rev/3ab10e3da283 Adjust WPT test as per upstream review. r=firefox-style-system-reviewers,emilio

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

(For future reference, this progressed WPT pull request here)

MDN docs changes for this bug can be tracked here: https://github.com/mdn/content/issues/40481

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: