Re: [csswg-drafts] [css-view-transitions-1] Should view transition names be tree scoped? (#10145)

I think this discussion transcends View Transitions and touches all CSS properties that define a name: `view-transition-name`, `scroll-timeline-name`, `anchor-name`, `container-name` (and any others I can’t think of right now).

In general I think we should respect the aspect that these names don’t leak out of shadow roots. However, in some cases authors would explicitly want this, e.g. websites where they have a big tree of Web Components.

_(For context: the re-opening of this issue was sparked by [this report](https://x.com/shawnorium/status/1801963376584667163) from an author in which they let us know that the View Transitions from the overview to the detail page [on their site](https://divicards-site.pages.dev/) are no longer working in Chrome 126. Culprit is the `view-transition-name` being set on an element that is contained in a Web Component)_

In https://github.com/w3c/csswg-drafts/issues/8915#issuecomment-1883461265 there was talk of breaking style containment into two parts: containing names and all the rest. I would love to see a solution where names are contained by default – to not break one of the premises of using shadow DOM – but that there is a way to make the names visible only after the author opts-in (and only for open shadowroots).

This “contain by default” could be part of the UA stylesheet – e.g. `:host { contain: names; } – which authors could then choose to unset/reset/adjust.

-- 
GitHub Notification of comment by bramus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10145#issuecomment-2174045257 using your GitHub account


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

Received on Monday, 17 June 2024 18:17:56 UTC