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-shadow-parts] need definition of which pseudo-classes can follow :part() that is sufficient to produce interoperability #10787

Open
dbaron opened this issue Aug 27, 2024 · 4 comments

Comments

@dbaron
Copy link
Member

dbaron commented Aug 27, 2024

The spec for ::part() says:

The ::part() pseudo-element can take additional pseudo-classes after it, such as x-button::part(label):hover, but never matches the structural pseudo-classes or any other pseudo-classes that match based on tree information rather than local element information.

This wording probably isn't precise enough to lead all implementors to classify every pseudo-class (works after ::part() or not) in the same way. I just added a test to WPT that exercises a bunch of these cases. (See also #10786 for a separate issue that relates to the same test. And also see #9795 for a case where people previously disagreed about this classification.)

We probably need a clearer definition of which selectors do or don't work here, and it probably needs to somehow end up in the way that we define pseudo-classes.

@dbaron
Copy link
Member Author

dbaron commented Aug 27, 2024

Perhaps a special case: I think it should probably be clear that :has() isn't allowed; it's probably not testable today but it could be in the future if we introduce something equivalent to what was allowed in early :has() drafts by :has(:scope:hover) (which is roughly equivalent to :is(:hover)).

@dbaron dbaron changed the title need definition of which pseudo-classes can follow :part() that is sufficient to produce interoperability Aug 27, 2024
@tabatkins
Copy link
Member

tabatkins commented Sep 5, 2024

Agreed.

I think the definitely-disallowed ones are:

  • the structural pseudo-classes, as already disallowed
  • :has()
  • :scope
  • :host, :host(), and :host-context()

Slightly uncertain ones that I think should still be allowed:

  • :lang() and :dir() (we already resolved to allow them)
  • the :*-within pseudos (:target-within, :focus-within
  • :picture-in-picture

And I think the rest are all clearly fine.

I made this list by looking over https://drafts.csswg.org/indexes/#selectors which gets selectors from across the spec landscape, so should be pretty complete (anything it's missing are just mis-tagged).

@dbaron
Copy link
Member Author

dbaron commented Sep 5, 2024

I think also probably disallowed (as structural) should be :scope, :host-context() and :host.

@tabatkins
Copy link
Member

I'd considered them, but left them out as I figured they could never match. But you're right, for clarity they should be disallowed explicitly.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 6, 2024
Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
aarongable pushed a commit to chromium/chromium that referenced this issue Sep 6, 2024
Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839421
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1351997}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 6, 2024
Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839421
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1351997}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 6, 2024
Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839421
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1351997}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 15, 2024
…sses after ::part()., a=testonly

Automatic update from web-platform-tests
Allow :active-view-transition pseudo-classes after ::part().

Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839421
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1351997}

--

wpt-commits: a75813a805d96b9ef5236a2b31fe877967dc881a
wpt-pr: 48013
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Sep 16, 2024
…sses after ::part()., a=testonly

Automatic update from web-platform-tests
Allow :active-view-transition pseudo-classes after ::part().

Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839421
Reviewed-by: Rune Lillesveen <futharkchromium.org>
Commit-Queue: David Baron <dbaronchromium.org>
Cr-Commit-Position: refs/heads/main{#1351997}

--

wpt-commits: a75813a805d96b9ef5236a2b31fe877967dc881a
wpt-pr: 48013

UltraBlame original commit: c38fc2e2446120b0a73631d83718dc055830e074
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Sep 16, 2024
…sses after ::part()., a=testonly

Automatic update from web-platform-tests
Allow :active-view-transition pseudo-classes after ::part().

Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839421
Reviewed-by: Rune Lillesveen <futharkchromium.org>
Commit-Queue: David Baron <dbaronchromium.org>
Cr-Commit-Position: refs/heads/main{#1351997}

--

wpt-commits: a75813a805d96b9ef5236a2b31fe877967dc881a
wpt-pr: 48013

UltraBlame original commit: c38fc2e2446120b0a73631d83718dc055830e074
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Sep 16, 2024
…sses after ::part()., a=testonly

Automatic update from web-platform-tests
Allow :active-view-transition pseudo-classes after ::part().

Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839421
Reviewed-by: Rune Lillesveen <futharkchromium.org>
Commit-Queue: David Baron <dbaronchromium.org>
Cr-Commit-Position: refs/heads/main{#1351997}

--

wpt-commits: a75813a805d96b9ef5236a2b31fe877967dc881a
wpt-pr: 48013

UltraBlame original commit: c38fc2e2446120b0a73631d83718dc055830e074
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Sep 16, 2024
…sses after ::part()., a=testonly

Automatic update from web-platform-tests
Allow :active-view-transition pseudo-classes after ::part().

Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839421
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1351997}

--

wpt-commits: a75813a805d96b9ef5236a2b31fe877967dc881a
wpt-pr: 48013
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Sep 17, 2024
…sses after ::part()., a=testonly

Automatic update from web-platform-tests
Allow :active-view-transition pseudo-classes after ::part().

Based on the discussion in
w3c/csswg-drafts#10806 and also in
w3c/csswg-drafts#10787, I think the conclusion
from #10806 applies to pseudo-classes as well, and I should reverse my
earlier decision to disallow the :active-view-transition pseudo-classes
after ::part(), even though today it is not possible for them to match.

This makes that change behind the CSSPartAllowsMoreSelectorsAfter flag
(status:experimental), which also contains other related changes.

This matches WebKit's current implementation of those pseudo-classes.

Bug: 40623497
Change-Id: I591fe30bb9e6c3a0953df318919f60dd6962d4a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5839421
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1351997}

--

wpt-commits: a75813a805d96b9ef5236a2b31fe877967dc881a
wpt-pr: 48013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment