-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
We need something like requestFinalFrame()
to run logic after all *Observer
callbacks
#9721
Comments
requestFinalFrame()
to run logic after all *Observer callbacksrequestFinalFrame()
to run logic after all *Observer
callbacks
I don't understand why you can't schedule updates and make them during Also, this would benefit a lot from reading through https://whatwg.org/faq#adding-new-features and applying it. Thanks! |
@annevk Wish it was that easy! Some observer APIs that run callbacks between rAF and browser paint (f.e. With
|
Hadn't seen this thread, posted some solutions here |
One problem I can see with yet another callback in the event-loop, it that the changes made in that callback would get missed by all these observers. Then we'll want a I feel the best would be to have a way to limit the possible actions in this hook to compositing related actions only, so maybe a |
The problem is clearly described in
ResizeObserver.takeRecords()
orResizeObserver.hasRecords()
(the canvas flickering problem) w3c/csswg-drafts#9717but I'll paste it here too (click to expand):
Solution
Something like
requestFinalFrame()
would allow running a frame after animation frame callbacks and*Observer
callbacks (including callbacks of any frame-based*Observer
APIs added in the future, and potentially any other type of frame-based callbacks added in the future that currently don't exist), so that final state and rendering can be performed in a consistent manner without duplication of final state derivation or rendering logic (see the problem and codepen example in the other issue).The text was updated successfully, but these errors were encountered: