In the following example, the invoke idle callbacks algorithm would be called with an empty list of runnable idle callbacks for the iframe's content window.
In this example, the following events would take place:
Callback A is added to the list of idle request callbacks, and the task to start an idle period algorithm (SIPA-A) is queued. Currently schedule tasks are: [SIPA-A].
Callback B is added to the list of idle request callbacks, and the task to start an idle period algorithm (SIPA-B) is queued. Currently schedule tasks are: [SIPA-A, SIPA-B].
SIPA-A runs. A is moved from top-level window's list of idle request callbacks to the list of runnable idle callbacks, and a new task to invoke idle callbacks (IIC-A) is scheduled. Currently schedule tasks are: [SIPA-B, IIC-A].
SIPA-B runs. B is moved from iframe's content window's list of idle request callbacks to the list of runnable idle callbacks, and a new task to invoke idle callbacks (IIC-B) is scheduled. Currently schedule tasks are: [IIC-A, IIC-B].
IIC-A runs. The callback A is called and B is removed from the list of runnable idle callbacks of iframe's content window. Currently schedule tasks are: [IIC-B].
IIC-B runs. The step to pop the top callback from window's list of runnable idle callbacks fails because there is nothing left in the list of runnable idle callbacks of the iframe's content window.
Yeah this seems like a spec bug. Should be easy enough to fix by adding "and the window's list of runnable idle callbacks is not empty:" to step 3 of the invoke idle callbacks algorithm, WDYT?
In the following example, the invoke idle callbacks algorithm would be called with an empty list of runnable idle callbacks for the iframe's content window.
In this example, the following events would take place: