- From: Bramus via GitHub <noreply@w3.org>
- Date: Fri, 24 Oct 2025 09:23:46 +0000
- To: public-css-archive@w3.org
bramus has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-view-transitions-2] Extend `waitUntil` so that it can delay the start of the View Transition (animation phase) ==
In https://github.com/w3c/csswg-drafts/issues/9901 we resolved on adding [`ViewTransition.waitUntil()`](https://drafts.csswg.org/css-view-transitions-2/#dom-viewtransition-waituntil) which delays the view transition finish until the given promise is settled.
In https://github.com/WebKit/standards-positions/issues/564 @nt1m [brought up](https://github.com/WebKit/standards-positions/issues/564#issuecomment-3428561660) the following point:
> - Not clear from the name that it delays completion, it could also delay the start of the transition.
Authors can currently to this manually by pausing the View Transition right after the snapshots have been taken:
```js
const t = document.startViewTransition(…);
…
await t.ready;
pauseViewTransition(t);
await somePromise;
resumeViewTransition(t);
```
(Try it in a live demo: https://codepen.io/bramus/pen/NPxMvVE/45d641af16538a491532ca1dbcc1a741)
The code for `pauseViewTransition` and `resumeViewTransition` relies on [getting all animations associated with the View Transition](https://www.bram.us/2025/01/01/view-transitions-snippets-getting-all-animations-linked-to-a-view-transition/) and then pausing those animations. This is a bit stupid, because one of the reasons we added `ViewTransition.waitUntil()` was so that authors would no longer need to extract and pause all the VT animations. So essentially, we are requiring them to do the same thing again.
To make this easier for authors, perhaps we could extend `waitUntil` to accept an object? I’m thinking of an extra `phase` option to indicate which phase should be delayed. By default it would be `"finished"`
```js
ViewTransition.waitUntil({
promise: myPromise,
phase: 'animating',
});
```
/cc @vmpstr @noamr @jakearchibald
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13013 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 24 October 2025 09:23:47 UTC