-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-view-transitions-1] Naming elements inside shadow DOM via ::part
#10303
Comments
I realize tree-scoping VT comes with a bunch of issues, especially with the pseudo-elements being created only on the root element. Even if you scope VT name to a subtree, that VT name will be exposed to the Document through the pseudo-elements which breaks the scoping. cc @fantasai |
What if styling the pseudo-elements (everything under |
@khushalsagar I'm a bit confused about which part of the spec says that this shouldn't work today. |
I checked and also |
It was added here. Though now that you asked maybe "tree context" is not the right term since it's associated with a selector not a node. So the spec text might need to be fixed. But the intent of the resolution was to exclude names from nodes in inner tree scopes. |
Turns out this is not an issue. @andruud clarified that the scoping spec already takes care of |
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
andexportparts
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?
The text was updated successfully, but these errors were encountered: