-
Notifications
You must be signed in to change notification settings - Fork 735
Description
The general principle behind shadow DOM is for style rules to be isolated to a particular tree scope. That was the rationale behind the resolution at #10145.
But the ::part pseudo-element is explicitly meant for rules in a tree scope to target elements in an embedded tree scope. So it's unclear how we should treat such elements. If the name on an element inside shadow DOM came via the ::part
selector, should it be visible to a transition started on the outer Document. Should this name apply to transitions started within the shadow DOM (will be relevant for upcoming features), since it came from style rules outside the shadow DOM.
My reading is that the part
and exportparts
attribute are by design meant to make elements inside a shadow DOM visible to CSS in their parent DOM. And if an element is visible to CSS in a DOM, then it should be allowed to participate in transitions initiated in that DOM.
An alternative would be to track which tree scope a name came from and decide whether it applies based on that. That is, if the name came via the ::part
selector then it only applies for transitions started in the parent DOM. And if it came from CSS rules within the shadow DOM then it only applies to transitions started within the shadow DOM. That seems more complicated to me. That said, I'm not super familiar with how authors generally use shadow DOM + ::part
so not sure if this is the expected behaviour.
@nt1m @emilio @bramus @noamr @argyleink any suggestions?