[csswg-drafts] [css-view-transitions-1] Allow rAF/script based animations with view transitions. (#8132)

khushalsagar has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-view-transitions-1] Allow rAF/script based animations with view transitions. ==
View Transitions keep the pseudo DOM state alive until there is an active animation on any of the generated pseudo-elements. This is fine if the author is using CSS or Web Animations, but not if the animation is driven by script using rAF or setTimeout.

We can add an API as follows which allows the author to pass a promise indicating when a custom script driven animation has finished.

```js
function animateHeader(transition) {
  transition.waitUntil((async () => {
    // animate the header here, and return when done
  })());
}

async function startAnimations(transition) {
  await transition.ready;
  animateHeader(transition);
  animateFooter(transition);
  animateThumbnail(transition);
}
```

credits to @jakearchibald for the API suggestion.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8132 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 25 November 2022 12:15:17 UTC