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

Relation to update-the-rendering #87

Open
chrishtr opened this issue Dec 16, 2021 · 3 comments
Open

Relation to update-the-rendering #87

chrishtr opened this issue Dec 16, 2021 · 3 comments
Labels
animations useful for animation-related explainers

Comments

@chrishtr
Copy link

(related to #85)

Re: https://github.com/WebKit/explainers/tree/main/animation-frame-rate

If there is an animation declared to be at a different frame rate than the update-the-rendering steps, then how does the processing model for updates work?

  • Is the proposal to do some updates that skip some of these steps, and "only" update the animation? i.e. are you proposing that requestAnimationFrame, ResizeObserver, resize event, IntersectionObserver, etc steps don't run in such updates? Or only if it happens to coincide with the update-the-rendering timing?

  • How should the developer indicate that they'd like animations to be synced if possible?

  • If the regular update-the-rendering steps are not customizable, that could lose an opportunity for lowering the frame rate for devices that are low on battery.

@smfr
Copy link

smfr commented Dec 17, 2021

These are good questions, and I think the explainer should explain them!

@graouts graouts added the animations useful for animation-related explainers label Dec 17, 2021
@graouts
Copy link
Contributor

graouts commented Dec 17, 2021

@chrishtr when you say:

How should the developer indicate that they'd like animations to be synced if possible?

What is the thing you'd like the animations to be synced with? Issue #84 has a fair bit of discussion about how animations are synced with each other, but since you mention others steps from the "update the rendering" procedure, I wanted to be sure this was what you meant.

@chrishtr
Copy link
Author

What is the thing you'd like the animations to be synced with? Issue #84 has a fair bit of discussion about how animations are synced with each other, but since you mention others steps from the "update the rendering" procedure, I wanted to be sure this was what you meant.

You might want scrolling and an animation to have the same frame rate, for example. This particular example is also related to the update-the-rendering steps, because scroll events happen during update-the-rendering.

I am skeptical that it's a good idea to have main thread animation or scroll updates that require style / layout, but that don't invoke some of the update-the-rendering steps, because all of the related specs and APIs depend on this processing model, and implementations are architected around it.

And if the animation does run those steps, that means requestAnimationFrame fires at that rate. So it's unclear to me how to make a main-thread animation that doesn't run at the same frame rate as requestAnimationFrame, or that implies the latter runs faster than 60fps.

I do think there is room to consider running some animations slower than 60fps, but if it isn't an integer multiple of the update-the-rendering steps, then it'll cause even more update-the renderings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
animations useful for animation-related explainers
Projects
None yet
Development

No branches or pull requests

3 participants