Implementing requestIdleCallback

# Ryosuke Niwa (2 days ago)

I'm starting the effort to implement requestIdleCallback [1] in WebKit in bugs.webkit.org/show_bug.cgi?id=164193. It's an API for executing scripts when the browser is idle. It's supported by both Gecko & Blink as well as the old Edge engine.

Because we don't plan on implementing any sort of scheduler or the literal event loop in WebKit, the major part of this effort involves identifying task sources [2] that interact with the idleness as discussed in w3c/requestidlecallback#71, and contributing to more explicitly define what "idle" means in the cooperative scheduling specification itself.

This would entail studying the use thereof and refactoring of Timer, GenericTaskQueue, GenericEventQueue, etc... in order to track origins of tasks and determining the quality of service of each task; e.g. whether a given task is considered as a task that should delay requestIdleCallback if it's author observable, and if not, then its relative priority with requestIdleCallback.

[1] Spec: w3c.github.io/requestidlecallback [2] html.spec.whatwg.org/multipage/webappapis.html#generic-task-sources

  • R. Niwa
Contact us to advertise here

Want more features?

Request early access to our private beta of readable email premium.