[csswg-drafts] [css-pseudo-4] "Singular" vs "plural" pseudo-elements (#9968)

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

== [css-pseudo-4] "Singular" vs "plural" pseudo-elements ==
We discussed in the F2F that a few things being worked on need to be able to distinguish whether a pseudo-element is "singular" or "plural" - that is, if you target the pseudo-element (via a selector, a getComputedStyle() argument, etc) from a particular originating element, will you *necessarily* get 0/1 pseudo-element, or is it possible get N>1 pseudo-elements?

For example:
* `::before` is singular - only one exists on an element. 
* [`::view-transition-group()`](https://drafts.csswg.org/css-view-transitions/#::view-transition-group) is singular if a VT name is used (because names have to be document-unique), but plural otherwise (multiple VTs can have the same VT class, or the `*` argument matches all VTs).
* [`::part()`](https://drafts.csswg.org/css-shadow-parts/#part) is always plural - the part name has the semantics of a class, and can refer to any number of elements.

We should reify this concept in Pseudo, and specify that APIs like getComputedStyle() can only refer to singular pseudos, or conditionally-singular pseudos if certain conditions are met.

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


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

Received on Thursday, 15 February 2024 22:21:44 UTC