-
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-anchor-positioning-1] [scroll-animations-1] [css-view-transitions-1] Scoping names on elements based on tree scope #10304
Comments
@khushalsagar Would you mind inventorying what we've got / decisions we've made about this so far? :) |
@fantasai did some digging around on this and landed on https://drafts.csswg.org/css-scoping-1/#shadow-names. This is the closest thing in CSS specs which is trying to define a generic concept of how global names should be handled. This was discussed on #1995. There's 2 relevant concepts:
When de-referencing a tree scoped reference, we start looking in the tree scope which matches the reference and keep going higher in the tree scope hierarchy until a match is found. This essentially means that names defined in a tree scope are visible to the descendants by default (if they are not overridden) but names defined in an inner tree scope are not visible to outer tree scope. This has been highlighted as an issue for anchor positioning, see #9408. But there's 2 issues with the above:
So adding this to the agenda to revisit the spec. |
@flackr pointed out that
|
The proposal here seems relevant to this problem: #8915 (comment). If the idea in the existing spec makes sense then the above proposal could be the opt-in to gate exposing of names as defined in that spec (in terms of priority order). The spec misses defining how an outer tree scope can use names in inner tree scopes but I think that could be as simple as deciding based on the DOM order of the roots associated with descendant tree scopes. |
Also |
I'm not convinced that what's described for at-rule declarations at https://drafts.csswg.org/css-scoping-1/#shadow-names applies to peer-to-peer names like |
Closing this based on the clarification at #10325 (comment). |
Both #10145 and #10303 are tackling how view-transition-name applies across tree scopes. But the conceptual problem seems common across other features like anchor positioning or scroll driven animations which have a similar pattern of assigning names to elements which are later used for animations/layout tied to a tree scope. Please add if I missed a feature!
Filing this issue to decide whether each feature needs to define their own behaviour when dealing with shadow DOM or do the choices we make on the VT issues make sense across all such naming properties in CSS.
@astearns.
The text was updated successfully, but these errors were encountered: