Skip to content

Commit d437792

Browse files
committed
[css-view-transition-2] Clarify timeout behavior for inbound view transition
The previous wording of this was somewhat handwavy, made it more rigorous. - The timeout starts when the transition is created (before pageswap) - If the timeout expires before the transition is resolved (pagereveal), the inbound transition params are cleared and the behavior is similar to having the transition skipped at pageswap. - If the timeout expires while the navigation is active, it is skipped with a `TimeoutError`. Closes #10800
1 parent ae201f5 commit d437792

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

css-view-transitions-2/Overview.bs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,9 @@ It has the following [=struct/items=]:
875875

876876
: <dfn>initial snapshot containing block size</dfn>
877877
:: a [=tuple=] of two numbers (width and height).
878+
879+
: <dfn>resolved transition</dfn>
880+
:: a {{ViewTransition}} or null, initially null.
878881
</dl>
879882

880883
## Additions to the view transition page-visibility change steps ## {#page-visibility-change-steps-additions}
@@ -992,6 +995,15 @@ The [=captured element=] struct should contain these fields, in addition to the
992995

993996
Note: The inbound transition is activated after the dispatch of {{Window/pagereveal}} to ensure mutations made in this event apply to the captured new state.
994997

998+
1.At any given time, the UA may decide to skip the inbound transition, e.g. after an [=implementation-defined=] timeout. To do so, the UA should [=queue a global task=] on the [=DOM manipulation task source=] given |newDocument|'s [=relevant global object=] to perform the following steps:
999+
1000+
1. If |newDocument|'s [=inbound view transition params=] is |params|, then set |newDocument|'s [=inbound view transition params=] to null.
1001+
1002+
1. If |newDocument|'s [=active view transition=] is |params|'s [=view transition params/resolved transition=], and |newDocument|'s [=active view transition=]'s [=ViewTransition/phase=] is not "`done`",
1003+
then [=skip the view transition|skip=] |newDocument|'s [=active view transition=] with a "{{TimeoutError}}" {{DOMException}}.
1004+
1005+
Note: This allows user agents to
1006+
9951007
1. Call |proceedWithNavigation|.
9961008

9971009
1. Set |oldDocument|'s [=active view transition=] to |outboundTransition|.
@@ -1087,9 +1099,9 @@ Prepend the following step to the [=Perform pending transition operations=] algo
10871099

10881100
1. Set |transition|'s [=ViewTransition/active types=] to |resolvedRule|.
10891101

1090-
1. At any given time, the UA may decide to skip the inbound transition, e.g. after an [=implementation-defined=] timeout.
1091-
To do so, the UA should [=queue a global task=] on the [=DOM manipulation task source=] given |document|'s [=relevant global object=] to perform the following step:
1092-
If |transition|'s [=ViewTransition/phase=] is not "`done`", then [=skip the view transition=] |transition| with a "{{TimeoutError}}" {{DOMException}}.
1102+
1. Set |inboundViewTransitionParams|'s [=view transition params/resolved transition=] to |transition|.
1103+
1104+
Note: this allows skipping the transition after an [=implementation-defined=] timeout.
10931105

10941106
1. Return |transition|.
10951107
</div>

0 commit comments

Comments
 (0)