diff --git a/css-view-transitions-1/Overview.bs b/css-view-transitions-1/Overview.bs
index 061334f6c02..bf0deba5f57 100644
--- a/css-view-transitions-1/Overview.bs
+++ b/css-view-transitions-1/Overview.bs
@@ -1262,7 +1262,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
1. [=Queue a global task=] on the [=DOM manipulation task source=],
given |transition|'s [=relevant global object=],
- to execute the following steps:
+ to perform the following steps:
Note: A task is queued here because the texture read back in [=capturing the image=] may be async,
although the render steps in the HTML spec act as if it's synchronous.
@@ -1270,35 +1270,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
1. If |transition|'s [=ViewTransition/phase=] is "`done`", then abort these steps.
Note: This happens if |transition| was [=skip the view transition|skipped=] before this point.
- The [=skip the view transition=] steps [=call the update callback=],
- ensuring the |transition|'s [=ViewTransition/update callback=] is always called.
- 1. [=Call the update callback=] of |transition|.
-
- 1. [=promise/React=] to |transition|'s [=ViewTransition/update callback done promise=]:
-
- * If the promise does not settle within an implementation-defined timeout, then:
-
- 1. If |transition|'s [=ViewTransition/phase=] is "`done`", then return.
-
- Note: This happens if |transition| was [=skip the view transition|skipped=] before this point.
-
- 1. [=Skip the view transition=] |transition| with a "{{TimeoutError}}" {{DOMException}}.
-
- * If the promise was rejected with reason |reason|, then:
-
- 1. If |transition|'s [=ViewTransition/phase=] is "`done`", then return.
-
- Note: This happens if |transition| was [=skip the view transition|skipped=] before this point.
-
- 1. [=Mark as handled=] |transition|'s [=ViewTransition/ready promise=].
-
- Note: |transition|'s [=ViewTransition/update callback done promise=] will provide the {{unhandledrejection}}.
- This step avoids a duplicate.
-
- 1. [=Skip the view transition=] |transition| with |reason|.
-
- * If the promise was fulfilled, then [=activate view transition|activate=] |transition|.
+ 1. [=call the update callback=].
@@ -1319,6 +1292,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
If failure is returned, then [=skip the view transition=] for |transition| with an "{{InvalidStateError}}" {{DOMException}} in |transition|'s [=relevant Realm=],
and return.
+ 1. [=Resolve=] |transition|'s [=ViewTransition/update callback done promise=] with undefined.
+
1. [=list/For each=] |capturedElement| of |transition|'s [=ViewTransition/named elements=]' [=map/values=]:
1. If |capturedElement|'s [=captured element/new element=] is not null,
@@ -1633,13 +1608,41 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
1. If |transition|'s [=ViewTransition/phase=] is not "`done`", then set |transition|'s [=ViewTransition/phase=] to "`update-callback-called`".
- 1. [=Resolve=] |transition|'s [=ViewTransition/update callback done promise=]
- with the result of [=reacting=] to |callbackPromise|:
+ 1. Let |fulfillSteps| be to following steps:
+ 1. [=Activate view transition|Activate=] |transition|.
- - If the promise was fulfilled, then return undefined.
+ 1. [=Resolve=] |transition|'s [=ViewTransition/update callback done promise=] with undefined.
+
+ Note: This would be a no-op if the previous step already resolved the promise.
+
+ 1. Let |rejectSteps| be the following steps given |reason|:
+ 1. [=Reject=] |transition|'s [=ViewTransition/update callback done promise=] with |reason|.
+
+ 1. If |transition|'s [=ViewTransition/phase=] is "`done`", then return.
+
+ Note: This happens if |transition| was [=skip the view transition|skipped=] before this point.
+
+ 1. [=Mark as handled=] |transition|'s [=ViewTransition/ready promise=].
+
+ Note: |transition|'s [=ViewTransition/update callback done promise=] will provide the {{unhandledrejection}}.
+ This step avoids a duplicate.
+
+ 1. [=Skip the view transition=] |transition| with |reason|.
+
+ 1. [=React=] to |callbackPromise| with |fulfillSteps| and |rejectSteps|.
+
+ 1. To skip a transition after a timeout, the user agent may perform the following steps [=in parallel=]:
+ 1. Wait for an implementation-defined [=duration=].
+
+ 1. [=Queue a global task=] on the [=DOM manipulation task source=],
+ given |transition|'s [=relevant global object=], to perform the following steps:
+
+ 1. If |transition|'s [=ViewTransition/phase=] is "`done`", then return.
+
+ Note: This happens if |transition| was [=skip the view transition|skipped=] before this point.
+
+ 1. [=skip the view transition|Skip=] |transition| with a "{{TimeoutError}}" {{DOMException}}.
- Note: Since the rejection of |callbackPromise| isn't explicitly handled here,
- if |callbackPromise| rejects, then |transition|'s [=ViewTransition/update callback done promise=] will reject with the same reason.
## [=Skip the view transition=] ## {#skip-the-view-transition-algorithm}
@@ -1951,6 +1954,7 @@ Changes from issue 9639.
* Add note to explain paint order for entry animations. See issue 9672.
* Add note to explain how the named elements are cleaned up. See issue 9669.
+* Refactor algorithm to clarify timing, especially of `updateCallbackDone. See issue 9762.