Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-view-transitions-2] Clarify what happens if a transition is initiated during a rendering update #8875

Closed
noamr opened this issue May 25, 2023 · 3 comments
Labels
css-view-transitions-2 View Transitions; New feature requests

Comments

@noamr
Copy link
Collaborator

noamr commented May 25, 2023

Currently it's defined that the new state is captured on the next frame. But what happens if we're already in the middle of a frame? e.g.

<head>
   <script>
     requestAnimationFrame(() => {
       startViewTranstiion(...);
     });
   </script>
</head>
@noamr
Copy link
Collaborator Author

noamr commented May 25, 2023

/cc @khushalsagar

@fantasai fantasai added the css-view-transitions-2 View Transitions; New feature requests label Jun 1, 2023
@vmpstr
Copy link
Member

vmpstr commented Jun 7, 2023

The steps in view transitions "Monkey patches to rendering" define that the pending-capture phase which does the initial set up runs "before the intersection observer steps" in the update the rendering which is step 7.16. Animation frame callbacks are step 7.13. So it looks like the spec says the frame which runs the animation frame callback is also the same frame that sets the transition up, which is what we want.

This is also true if you start the transition in the resize observer callbacks which are run in 7.14 loop

@khushalsagar
Copy link
Member

@noamr I'm assuming this answers the question. Feel free to re-open if something is still not clear. And file a crbug if the Blink implementation doesn't align with the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-2 View Transitions; New feature requests
Projects
None yet
Development

No branches or pull requests

4 participants