-
Notifications
You must be signed in to change notification settings - Fork 757
[css-view-transitions-1] Refactor timings of updateCallbackDone and related
#9774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
||
| although the render steps in the HTML spec act as if it's synchronous. | ||
| </div> | ||
|
|
||
| <div algorithm> | ||
|
|
@@ -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: | ||
noamr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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} | ||
|
|
@@ -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> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.