-
Notifications
You must be signed in to change notification settings - Fork 759
Description
A goal of Scoped View Transitions is to enable composition: outer and inner components, possibly from different authors or libraries, can both run view transitions at the same time without coordinating with each other or knowing about each other.
This means we need some way to encapsulate view-transition-name tags so that each component can choose its own tag names without worrying about conflicts in a shared namespace.
The solution proposed in the explainer (and currently implemented by Chromium) is to support CSS contain: view-transition and encourage developers to set this property on elements that will be used as scopes (i.e. that will have startViewTransition() called on them). An outer transition's tag search will not descend into an inner element that has contain: view-transition.
This is similar to @flackr's proposal at #8915 (comment) for containing other kinds of named items.
Alternatively, we could have a different API that establishes a containment boundary by declaring that an element will be used as a scope, such as:
view-transition-scope: <ident> | none(@vmpstr floated this idea a long time ago)will-change: view-transitionthis-element-will-be-a-view-transition-scope: true
Alternatively, we could not have any API for this, but I would be opposed to that as explained in #12321 (comment). Applying containment "behind the scenes" during an active view transition is not a sufficient answer, since tags might be picked up by an outer transition before the inner transition starts.