forked from whatwg/html
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an explicit algorithm for idle callback deadline
The algorithm replaces the algorithm that is currently defined in prose here: https://w3c.github.io/requestidlecallback/#start-an-idle-period-algorithm. It works like so: * Timers can calculate their estimated next callback timestamps, based on their start time and document-inactive time so far. * The deadline for idle tasks for an event loop is the earliest between: * The time until the next timer callback in this event loop is estimated to fire. * The time until the next render, estimated at 1000 ms / refresh rate after the start of the previous task that had a rendering opportunity, if there are pending animation frame callbacks (or if the user agent believes a render is coming). * 50ms The deadline computation is passed as a set of algorithm steps to the requestIdleCallback() spec, so that it can always return the up-to-date deadline. Helps with w3c/requestidlecallback#71.
- Loading branch information
Showing
1 changed file
with
135 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters