Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 40 additions & 36 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,43 +1262,16 @@ 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:

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.
to perform the following steps:

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}}.
1. [=call the update callback=].

* 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|.
Note: A task is queued here because the texture read back in [=capturing the image=] may be async,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind restoring the position of this note? Nicer to have this next to where we post the task. Otherwise its part of this sub-point which is less clearer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

although the render steps in the HTML spec act as if it's synchronous.
</div>

<div algorithm>
Expand All @@ -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,
Expand Down Expand Up @@ -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.
</div>

## [=Skip the view transition=] ## {#skip-the-view-transition-algorithm}
Expand Down Expand Up @@ -1951,6 +1954,7 @@ Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230
* `view-transition-name: auto` should be an invalid value. See <a href="https://github.com/w3c/csswg-drafts/issues/9639">issue 9639</a>.
* Add note to explain paint order for entry animations. See <a href="https://github.com/w3c/csswg-drafts/issues/9672">issue 9672</a>.
* Add note to explain how the named elements are cleaned up. See <a href="https://github.com/w3c/csswg-drafts/issues/9669">issue 9669</a>.
* Refactor algorithm to clarify timing, especially of `updateCallbackDone. See <a href="https://github.com/w3c/csswg-drafts/issues/9762">issue 9762</a>.

<h3 id="changes-since-2022-05-25">
Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230525/">2022-05-25 Working Draft</a>
Expand Down