Skip to content

Commit

Permalink
Allow :active-view-transition pseudo-classes after ::part().
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
dbaron authored and chromium-wpt-export-bot committed Sep 6, 2024
1 parent 1f2b488 commit a75813a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions css/css-shadow-parts/pseudo-classes-after-part.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

// Test that non-structural pseudo-classes are allowed after ::part().
test_valid_selector("::part(mypart):active");
test_valid_selector("::part(mypart):active-view-transition");
test_valid_selector("::part(mypart):active-view-transition-type(mytype)");
test_valid_selector("::part(mypart):any-link");
test_valid_selector("::part(mypart):autofill");
test_valid_selector("::part(mypart):checked");
Expand Down Expand Up @@ -68,16 +70,13 @@
test_invalid_selector("::part(mypart):nth-of-type(1)");
test_invalid_selector("::part(mypart):only-child");
test_invalid_selector("::part(mypart):only-of-type");
// These are structural because they only match the root element.
test_invalid_selector("::part(mypart):active-view-transition");
test_invalid_selector("::part(mypart):active-view-transition-type(mytype)");

// Test that pseudo-classes that match based on tree information are not allowed after ::part.
test_invalid_selector("::part(mypart):host");
test_invalid_selector("::part(mypart):host-context(:hover)");
test_invalid_selector("::part(mypart):has(p)");
test_invalid_selector("::part(mypart):has(:hover)");
test_invalid_selector("::part(mypart):scope)");
test_invalid_selector("::part(mypart):scope");

// Test that :not() applies appropriate constraints for being after ::part(),
// but that :is() and :where() (which accept <forgiving-selector-list>) do
Expand Down

0 comments on commit a75813a

Please sign in to comment.