Skip to content

Commit 86f20cc

Browse files
authored
[css-view-transitions-1] Swap the order between setting the phase and calling the update callback (w3c#10826)
* [css-view-transitions-1] Swap the order between setting the phase and calling the update callback. This fixes an issue where skipping the transition from within thet update callback would call the update callback twice. Closes w3c#10822 * Change order around * Change order around
1 parent b11e256 commit 86f20cc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

css-view-transitions-1/Overview.bs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
15981598

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

1601+
1. If |transition|'s [=ViewTransition/phase=] is not "`done`", then set |transition|'s [=ViewTransition/phase=] to "`update-callback-called`".
1602+
16011603
1. Let |callbackPromise| be null.
16021604

16031605
1. If |transition|'s [=ViewTransition/update callback=] is null,
@@ -1606,8 +1608,6 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
16061608

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

1609-
1. If |transition|'s [=ViewTransition/phase=] is not "`done`", then set |transition|'s [=ViewTransition/phase=] to "`update-callback-called`".
1610-
16111611
1. Let |fulfillSteps| be to following steps:
16121612
1. [=Resolve=] |transition|'s [=ViewTransition/update callback done promise=] with undefined.
16131613

@@ -1986,6 +1986,7 @@ Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230
19861986
* Scope view transition names to matching tree context. See <a href="https://github.com/w3c/csswg-drafts/issues/10145">issue 10145</a>.
19871987
* Fix scoping to match name instead of element. See <a href="https://github.com/w3c/csswg-drafts/issues/10145">issue 10145</a>.
19881988
* Add a rendering characteristics note about out-of-viewport elements. See <a href="https://github.com/w3c/csswg-drafts/issues/8282">issue 8282</a>.
1989+
* Swap the order of invoking the update callback and setting the phase. See <a href="https://github.com/w3c/csswg-drafts/issues/10822">issue 10822</a>.
19891990

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

0 commit comments

Comments
 (0)