Skip to content

Commit

Permalink
[css-view-transitions-1] When skipping transitions, call the DOM-upda…
Browse files Browse the repository at this point in the history
…te 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
  • Loading branch information
noamr committed May 11, 2023
1 parent bdbe1db commit a55950d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
even if the transition is [=Skip the view transition|skipped=].
The reasons for this are discussed in [[#transitions-as-enhancements]].

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

1. Let |callbackPromise| be null.

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

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

1. Set |transition|'s [=ViewTransition/phase=] to "`update-callback-called`".
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|:
Expand All @@ -1500,7 +1500,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

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

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

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

Expand Down Expand Up @@ -1808,6 +1809,7 @@ Changes from <a href="https://www.w3.org/TR/2022/WD-css-view-transitions-1-20221
* Skip the transition if viewport size changes. See <a href="https://github.com/w3c/csswg-drafts/issues/8045">issue 8045</a>.
* Add support for :only-child. See <a href="https://github.com/w3c/csswg-drafts/issues/8057">issue 8057</a>.
* 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>.
* 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>

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

0 comments on commit a55950d

Please sign in to comment.