Contact emails
Spec
Summary
Make <slot> elements participate in a flat tree, with UA style: "display: contents".
Until now, we exclude <slot> elements from a flat tree (layout tree). Thus, applying a CSS selector to <slot> doesn't have any affect so far.
"Slots in a flat tree" allows users to apply a CSS selector to <slot> elements, and let <slot>'s assigned nodes inherit a style from its parent <slot> element because the slot becomes the parent in a flat tree.
A <slot> element still doesn't have a Layout Box by default because its UA style is "display: contents".
Motivation
There are two motivations:
1. Improve spec conformance.
We decided to exclude slots from a flat tree intentionally when we shipped Shadow DOM v1.
It's time to update the current behavior to improve spec conformance.
2. This change is a necessary part of "Incremental Shadow DOM".
Interoperability Risk
Since this is a part of Shadow DOM v1, interoperability matters only with Safari, as of now.
Edge: Public support for Shadow DOM v1
Firefox: Public support for Shadow DOM v1
Safari: Shipped with slots with "display: contents"
Web developers: No signals
Compatibility Risk
Low - Medium.
Unless an existing CSS selector matches <slot> elements, there should be no visible change.
However, for example, if users use "*" (universal CSS selector), the existing selector would unintentionally match <slot> elements.
Then, this would be a user-visible change because slot's assigned nodes would inherit a style from the slot.
I am thinking of adding a use counter to measure this usage.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes
Link to entry on the feature dashboard
Requesting approval to ship?
No
My concern is that this feature is difficult to implement behind a runtime flag because this feature is tightly related to the heart of rendering, and will change a structure of a flat tree.
I expect that I have to touch a lot of code. It might be unrealistic to implement this behind a runtime flag.
I'll send "Intent to Ship" later once I get more insights on this.