Skip to content

Commit a55950d

Browse files
authored
[css-view-transitions-1] When skipping transitions, call the DOM-update callback from a task (#8827)
* When skipping transitions, call the DOM-update callback from a task Amend assert to allow calling the callback from a "done" state The "finished" promise is bound to the update callback promise, so it doesn't need to change (the update callback is async anyway). See [resolution](#7904 (comment)). Closes #7904 * Add changelist entry
1 parent bdbe1db commit a55950d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

css-view-transitions-1/Overview.bs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
14681468
even if the transition is [=Skip the view transition|skipped=].
14691469
The reasons for this are discussed in [[#transitions-as-enhancements]].
14701470

1471-
1. [=Assert=]: |transition|'s [=ViewTransition/phase=] is [=phases/before=] "`update-callback-called`".
1471+
1. [=Assert=]: |transition|'s [=ViewTransition/phase=] is "`done`", or [=phases/before=] "`update-callback-called`".
14721472

14731473
1. Let |callbackPromise| be null.
14741474

@@ -1478,7 +1478,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
14781478

14791479
1. Otherwise, set |callbackPromise| to the result of [=/invoking=] |transition|'s [=ViewTransition/update callback=].
14801480

1481-
1. Set |transition|'s [=ViewTransition/phase=] to "`update-callback-called`".
1481+
1. If |transition|'s [=ViewTransition/phase=] is not "`done`", then set |transition|'s [=ViewTransition/phase=] to "`update-callback-called`".
14821482

14831483
1. [=Resolve=] |transition|'s [=ViewTransition/update callback done promise=]
14841484
with the result of [=reacting=] to |callbackPromise|:
@@ -1500,7 +1500,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
15001500

15011501
1. [=Assert=]: |transition|'s [=ViewTransition/phase=] is not "`done`".
15021502

1503-
1. If |transition|'s [=ViewTransition/phase=] is [=phases/before=] "`update-callback-called`", then [=call the update callback=] of |transition|.
1503+
1. If |transition|'s [=ViewTransition/phase=] is [=phases/before=] "`update-callback-called`", then [=queue a global task=] on the [=DOM manipulation task source=],
1504+
given |transition|'s [=relevant global object=], to [=call the update callback=] of |transition|.
15041505

15051506
1. Set [=document/transition suppressing rendering=] to false.
15061507

@@ -1808,6 +1809,7 @@ Changes from <a href="https://www.w3.org/TR/2022/WD-css-view-transitions-1-20221
18081809
* Skip the transition if viewport size changes. See <a href="https://github.com/w3c/csswg-drafts/issues/8045">issue 8045</a>.
18091810
* Add support for :only-child. See <a href="https://github.com/w3c/csswg-drafts/issues/8057">issue 8057</a>.
18101811
* Add concept of a tree of pseudo-elements under [=pseudo-element root=]. See <a href="https://github.com/w3c/csswg-drafts/issues/8113">issue 8113</a>.
1812+
* When skipping a transition, the {{UpdateCallback}} is called in own task rather than synchronosly. See <a href="https://github.com/w3c/csswg-drafts/issues/7904">issue 7904</a>
18111813

18121814
<h3 id="changes-since-2022-10-25">
18131815
Changes from <a href="https://www.w3.org/TR/2022/WD-css-view-transitions-1-20221025/">2022-10-25 Working Draft (FPWD)</a>

0 commit comments

Comments
 (0)