Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-scoping] Always serialise the implicit :scope ? #9621

Open
mdubet opened this issue Nov 22, 2023 · 3 comments
Open

[css-scoping] Always serialise the implicit :scope ? #9621

mdubet opened this issue Nov 22, 2023 · 3 comments
Labels

Comments

@mdubet
Copy link

mdubet commented Nov 22, 2023

For the css-nesting spec, we resolved to always serialise the implicit &:

When serializing a relative selector in a nested style rule, the selector must be absolutized, with the implied nesting selector inserted.

https://drafts.csswg.org/css-nesting/#cssom

Should we do the same for the implicit :scope in scoped style rule ?

They accept a relative-selector-list as their prelude (rather than just a selector-list). Such relative selectors are relative to :scope.

@mdubet mdubet added the css-scoping-1 Current Work label Nov 22, 2023
@annevk annevk added the Agenda+ label Dec 14, 2023
webkit-commit-queue pushed a commit to mdubet/WebKit that referenced this issue Dec 15, 2023
https://bugs.webkit.org/show_bug.cgi?id=266467
rdar://119711922

Reviewed by Antti Koivisto.

The <scope-start> should be prepended by either nothing,
& or :scope (depending on the outer context).

The <scope-end> should be prepended by :scope.

* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-cssom.html:

w3c/csswg-drafts#9621

* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-evaluation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-nesting-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/scope-visited-cssom-expected.txt:
* Source/WebCore/css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::appendImplicitSelectorPseudoClassScopeIfNeeded):
(WebCore::appendImplicitSelectorNestingParentIfNeeded):
(WebCore::CSSParserImpl::appendImplicitSelectorIfNeeded):
(WebCore::CSSParserImpl::consumeScopeRule):
(WebCore::CSSParserImpl::consumeStyleRule):
* Source/WebCore/css/parser/CSSParserImpl.h:
* Source/WebCore/css/parser/CSSParserSelector.cpp:
(WebCore::CSSParserSelector::leftmostSimpleSelector const):

const version of the existing non-const one

(WebCore::CSSParserSelector::startsWithExplicitCombinator const):
* Source/WebCore/css/parser/CSSParserSelector.h:

Canonical link: https://commits.webkit.org/272117@main
@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-scoping] Always serialise the implicit `:scope` ?, and agreed to the following:

  • RESOLUTION: serialize implicit scope pseudoclass in rule selectors
The full IRC log of that discussion <frances__> rossen: always serialize implicit scope?
<bramus> s/accepts custom/accepts auto.
<TabAtkins> q+
<frances__> matthieu d: in css copying spec all rules in the spec have a : scot selector, nesting serialize implicit selector, value context related to selector
<Rossen_> ack TabAtkins
<emilio> q+
<Rossen_> ack emilio
<frances__> tabatkins: more transportable to other spots for javascript copying and pasting
<miriam> q+
<frances__> emilio: consistent for @ scope or nested inside, still seems fine
<Rossen_> ack miriam
<frances__> miriam: question, what implications does this have for the behavior or just internal?
<frances__> matthieu d: no implication, only for serialization, one value for specificity, already counted
<frances__> miriam: some questions from roman about nesting and scope and how the implicit scope works in nested context
<frances__> matthieu d: serializing when there is an implicit scope
<frances__> rossen: any other questions/concerns?
<frances__> rossen: any objections?
<frances__> PROPOSAL: serialize implicit scope pseudoclass in rule selectors
<frances__> RESOLUTION: serialize implicit scope pseudoclass in rule selectors

moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Mar 19, 2024
WPT is adjusted to reflect the resolution of Issue #9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1882581
gecko-commit: 9f390afd0df5166e4e3b28fd35039ccb9f63017d
gecko-reviewers: firefox-style-system-reviewers, emilio
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Mar 19, 2024
…g at `:scope`. r=firefox-style-system-reviewers,emilio

WPT is adjusted to reflect the resolution of Issue #9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
github-actions bot pushed a commit to servo/stylo that referenced this issue Mar 19, 2024
…g at `:scope`. r=firefox-style-system-reviewers,emilio

WPT is adjusted to reflect the resolution of Issue #9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this issue Mar 19, 2024
…g at `:scope`. r=firefox-style-system-reviewers,emilio

WPT is adjusted to reflect the resolution of Issue #9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Mar 19, 2024
WPT is adjusted to reflect the resolution of Issue #9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1882581
gecko-commit: 86b02f822790d85a5792865a127f2a487d52534d
gecko-reviewers: firefox-style-system-reviewers, emilio
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Mar 19, 2024
…g at `:scope`. r=firefox-style-system-reviewers,emilio

WPT is adjusted to reflect the resolution of Issue #9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Mar 19, 2024
WPT is adjusted to reflect the resolution of Issue #9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1882581
gecko-commit: 86b02f822790d85a5792865a127f2a487d52534d
gecko-reviewers: firefox-style-system-reviewers, emilio
github-actions bot pushed a commit to servo/stylo that referenced this issue Mar 20, 2024
…g at `:scope`. r=firefox-style-system-reviewers,emilio

WPT is adjusted to reflect the resolution of Issue #9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this issue Mar 21, 2024
…g at `:scope`. r=firefox-style-system-reviewers,emilio

WPT is adjusted to reflect the resolution of Issue #9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154
BruceDai pushed a commit to BruceDai/wpt that referenced this issue Mar 25, 2024
WPT is adjusted to reflect the resolution of Issue web-platform-tests#9621
(w3c/csswg-drafts#9621).
That is, relative selectors are serialized with `:scope` e.g.
`> .foo` becomes `:scope > .foo`.

Differential Revision: https://phabricator.services.mozilla.com/D203154

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1882581
gecko-commit: 86b02f822790d85a5792865a127f2a487d52534d
gecko-reviewers: firefox-style-system-reviewers, emilio
@mirisuzanne
Copy link
Contributor

Agenda+ to revert this, since we can't serialize something that would change the specificity.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-scoping] Always serialise the implicit `:scope` ?, and agreed to the following:

  • RESOLVED: reverse the previous resolution and not serialize implicit :scope pseudos
The full IRC log of that discussion <khush> andruud: if a :scope is implicitly added it's not serialized back out. because there is a diff between implicit and explicit :scope in terms of specificity
<khush> so they are not equivalent.
<khush> astearns: doesn't change anything about serialization of explicit :scope
<khush> astearns: proposal is to reverse the previous resolution and not serialize implicit :scope
<khush> matthieud: we agreed to do that for nested rules not inside ... the idea to always serialize nested rule is to take the selector from a nested rule and apply elsewhere.
<khush> matthieud: you can't move everything around and expect it to work automatically
<khush> astearns: any other comments?
<khush> astearns: objections to not serializing implicit scope
<khush> RESOLVED: reverse the previous resolution and not serialize implicit :scope pseudos
<matthieud> we can' t move a relative selector like "> div" from a context where it's valid to a context where it's not valid (top level rule)
<khush> github-bot take up https://github.com//issues/10389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Thursday afternoon
Development

No branches or pull requests

4 participants