Description
This issue tracks an open question about the behavior of Scoped View Transitions. Further context appears in the document Self-Participating Scopes.
Q: When we encounter a tag collision, which transition is skipped?
A "collision" means two transitions wanting to use the same element as a participant.
<div id="scope1">
<div id="scope2">
<div style="view-transition-name: foo"> PARTICIPANT </div>
</div>
</div>
<script>
scope1.startViewTransition(() => { ... });
scope2.startViewTransition(() => { ... });
</script>
When a new transition wants to use an element that is already a participant in an existing transition, we have a few options:
- first wins - the new transition is skipped and the existing transition continues to run
- last wins - the existing transition is skipped and the new transition begins to run
- outermost wins - skip the transition whose scope is deeper in the DOM
@noamr pointed out that the outermost transition is probably more "important" visually. For example, it is more jarring to skip a whole-page transition than to skip a button transition. This argues in favor of the "outermost wins" strategy.
Note that this question only matters if a developer fails to set contain: view-transition
on a scope. If every potential scope has contain: view-transition
, then there cannot be any collisions.