-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Event loop: update the rendering step mismatches implementations in subtle ways #9824
Comments
I think we should make "update the rendering" its own task with its own task source. The implicit task source prioritization algorithm would then attempt to make that task hit the desired frame rate. The issue with UI events has been known for a long time. w3c/uievents#238 (comment) describes (rather briefly) what needs to be done: we need to turn the OS inputs into abstract algorithms from which we integrate with the event loop, create the relevant event objects, initialize their fields correctly, handle dispatch and cancelation, etc. cc @rniwa @smaug---- |
But then again, there is the pointerawupdate event that should not be throttled the same way. Probably having clearer hooks, or even more inclusion of UI events into HTML would help here. |
The way I would spec it in a way that's closer to implementations is that there are "in parallel" step that continuously wait for a rendering opportunity, save the timestamp when that rendering opportunity was available, and then the main event loop would read that timestamp (or some such). VSync or not etc. would be more implementation defined.
Yes, this is observable in
Yes, I think several events are frame-throttled, and potentially differently at different browsers, and this is observable and unspecced (except for |
FWIW, scroll/resize aren't UI events. WICG/scheduling-apis#67 has some information about the current behavior. |
Finally got around to this, see #10007 |
Instead of "updating the rendering" after each task, we wait for rendering opportunities in parallel, and post a special task to update the rendering. This is more in line with existing implementations, and fixes weird cases where e.g. a microtask queue can run without a current task. Helps with #9824.
What is the issue with the HTML Standard?
There are a few places in the event loop processing model, specifically in its relationship with updating the rendering, that differs from how it's implemented in the difference browser. This is web observable in subtle ways:
update the rendering
phase in webkitupdate the rendering
phase in the spec (see How can microtasks run without a task? #7845). In Chromium, there is a special task for rendering (In Gecko too I think, but not familiar enough). In WebKit, the concept of tasks is not 100% integrated. This is observable e.g. in APIs like longtasks.The text was updated successfully, but these errors were encountered: