Closed noamr closed 2 years ago
I only gave this a "respec review", as I'm not very familiar with requestidlecallback... however, if you want a proper review, I can dive a little deeper in requestidlecallback.
Not necessary, we will discuss it in TPAC and people more familiar with it can review together with the corresponding HTML-spec changes. Thanks for the editorial review!
@yoavweiss I think this is ready for an actual review, now that the corresponding HTML PR has landed.
@marcoscaceres any changes still requested?
No, apologies for the delay.
In conjunction with https://github.com/whatwg/html/pull/7166
Instead of defining the idle period deadline in prose, rely on the event model processing in the HTML spec to provide a more precise computation of the current idle period deadline.
This is accomplished by passing a
getDeadline
algorithm from the HTML spec to this spec when starting an idle period, and re-computing that deadline between idle callbacks, or whentimeRemaining()
is called.This ensures (more formally) that adding timeouts that expire before the end of the idle period, or
requestAnimationFrame
calls from within the idle period, which currently are specified to fire before the next idle tasks due to event loop priorities, will also be reflected when callingtimeRemaining
.Closes #71
Preview | Diff