[csswg-drafts] need definition of which pseudo-classes can follow :part() that is sufficient to produce interoperability (#10787)

dbaron has just created a new issue for https://github.com/w3c/csswg-drafts:

== need definition of which pseudo-classes can follow :part() that is sufficient to produce interoperability ==
[The spec](https://drafts.csswg.org/css-shadow-parts-1/#part) for `::part()` says:

> The [::part()](https://drafts.csswg.org/css-shadow-parts-1/#selectordef-part) pseudo-element can take additional pseudo-classes after it, such as x-button::part(label):hover, but never matches the [structural pseudo-classes](https://drafts.csswg.org/selectors-4/#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](https://wpt.fyi/results/css/css-shadow-parts/pseudo-classes-after-part.html) to WPT (see also [the results from the PR](https://wpt.fyi/results/css/css-shadow-parts/pseudo-classes-after-part.html?label=pr_head&max-count=1&pr=47795) if the main results haven't populated yet) 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.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10787 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 27 August 2024 01:00:10 UTC