w3c / requestidlecallback

Cooperative Scheduling of Background Tasks
https://w3c.github.io/requestidlecallback/
Other
50 stars 19 forks source link

Editorial: Use the HTML spec's timers infrastructure for `timeout` #98

Open andreubotella opened 2 years ago

andreubotella commented 2 years ago

In whatwg/html#7349, the HTML spec factored out part of the infrastructure for setTimeout() into a "run steps after a timeout" algorithm for use by other specs. This change updates requestIdleCallback() to use that algorithm when the timeout property is present and positive.


Preview | Diff

w3cbot commented 2 years ago

andreubotella marked as non substantive for IPR from ash-nazg.

andreubotella commented 2 years ago

Come to think about it, this change is not in fact editorial, since the "run steps after a timeout" algorithm adds an entry to the map of active timers, which in turn affects the idle deadline. It might still be worth making the change, though.

yoavweiss commented 2 years ago

@andreubotella - For some reason, we never clicked the green button and merged this.. Any reason I shouldn't? :)