Skip to content

Commit b58d8ad

Browse files
committed
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](w3c#7904 (comment)). Closes w3c#7904
1 parent e7eb9e2 commit b58d8ad

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

css-view-transitions-1/Overview.bs

Lines changed: 4 additions & 3 deletions
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

0 commit comments

Comments
 (0)