[csswg-drafts] [cssom] Selector pseudo-element serialization is outdated (#11997)

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

== [cssom] Selector pseudo-element serialization is outdated ==
CSSOM's ["serialize a selector"](https://drafts.csswg.org/cssom/#serializing-selectors) algorithm only says this for pseudo-elements:

> 4. If this is the last part of the chain of the selector and there is a pseudo-element, append "::" followed by the name of the pseudo-element, to s.

The issue with this is that newer specs have added features to pseudo-elements that don't fit this serialization:
1. Pseudo-elements can be functions with arguments. eg `::slotted()`, `::part()`, `::highlight()` and `::view-transition-group()`
2. There can be multiple pseudo-elements in a selector. eg, `::before::marker` - [CSS-PSEUDO-4](https://drafts.csswg.org/css-pseudo-4/#intro)
3. Pseudo-elements can have pseudo-classes. eg, `::first-line:hover` - [CSS-SELECTORS-4](https://drafts.csswg.org/selectors/#pseudo-element-states)

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


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

Received on Monday, 24 March 2025 13:12:21 UTC