[csswg-drafts] [css-view-transitions-1] Naming elements inside shadow DOM via `::part` (#10303)

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

== [css-view-transitions-1] Naming elements inside shadow DOM via `::part` ==
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 https://github.com/w3c/csswg-drafts/issues/10145.

But the [::part](https://drafts.csswg.org/css-shadow-parts/#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?

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


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

Received on Thursday, 9 May 2024 22:00:29 UTC