diff --git a/index.html b/index.html index b0060bf..152c172 100644 --- a/index.html +++ b/index.html @@ -341,19 +341,24 @@

Window interface extensions

Each Window has:

+ +

In addition, each event loop has:

+ +

The requestIdleCallback method

@@ -367,8 +372,11 @@

The requestIdleCallback by one.
  • Let handle be the current value of window's idle callback identifier.
  • -
  • Push callback to the end of window's list - of idle request callbacks, associated with handle.
  • +
  • Let event_loop be the event loop associated with + window
  • +
  • Push callback to the end of event_loop's + list of idle request callbacks, associated with handle + and window.
  • Return handle and then continue running this algorithm asynchronously.

    The following steps run in parallel and queue a timer @@ -421,11 +429,13 @@

    The cancelIdleCallback

    1. Let window be this Window object.
    2. -
    3. Find the entry in either the window's list of idle +
    4. Let event_loop be the event loop associated with + window
    5. +
    6. Find the entry in either the event_loop's list of idle request callbacks or list of runnable idle callbacks that is - associated with the value handle. + associated with the value handle and window.
    7. -
    8. If there is such an entry, remove it from both window's +
    9. If there is such an entry, remove it from both event_loop's list of idle request callbacks and the list of runnable idle callbacks.
    10. @@ -479,7 +489,7 @@

      Start an idle period algorithm

      the event loop is otherwise idle:

      1. Let last_deadline be the last idle period deadline - associated with window + associated with event_loop
      2. If last_deadline is greater than the current time, return from this algorithm.
      3. Optionally, if the user agent determines the idle period should @@ -509,11 +519,11 @@

        Start an idle period algorithm

        responsiveness to new user input within the threshold of human perception.

      4. -
      5. Let pending_list be window's list of idle - request callbacks. +
      6. Let pending_list be event_loop's list of + idle request callbacks.
      7. -
      8. Let run_list be window's list of runnable - idle callbacks. +
      9. Let run_list be event_loop's list of + runnable idle callbacks.
      10. Append all entries from pending_list into run_list preserving order.
      11. @@ -521,19 +531,20 @@

        Start an idle period algorithm

      12. Queue a task on the queue associated with the idle-task task source, which performs the steps defined in the invoke idle callbacks algorithm with deadline and - window as parameters. + event_loop as parameters.
      13. Save deadline as the last idle period deadline - associated with window.
      14. + associated with event_loop.

      The task source for these tasks is the idle-task task source.

      The time between now and deadline is referred to as the idle period. There can only be one idle period - active at a given time for any given window. The idle period can end - early if the user agent determines that it is no longer idle. If so, - the next idle period cannot start until after deadline.

      + active at a given time for any given event loop. The idle period + can end early if the user agent determines that it is no longer idle. If + so, the next idle period cannot start until after deadline. +

  • @@ -544,9 +555,10 @@

    Invoke idle callbacks algorithm

    to newly scheduled high-priority work, return from the algorithm.
  • Let now be the current time.
  • If now is less than deadline and the - window's list of runnable idle callbacks is not empty: + event_loop's list of runnable idle callbacks is not + empty:
      -
    1. Pop the top callback from window's +
    2. Pop the top callback from event_loop's list of runnable idle callbacks.
    3. Let deadlineArg be a new IdleDeadline. Set the time associated with deadlineArg to @@ -555,10 +567,10 @@

      Invoke idle callbacks algorithm

    4. Call callback with deadlineArg as its argument. If an uncaught runtime script error occurs, then report the error.
    5. -
    6. If window's list of runnable idle callbacks +
    7. If event_loop's list of runnable idle callbacks is not empty, queue a task which performs the steps in the invoke idle callbacks algorithm with deadline - and window as a parameters and return from this + and event_loop as a parameters and return from this algorithm
  • @@ -572,16 +584,19 @@

    Invoke idle callbacks algorithm

    Invoke idle callback timeout algorithm

    The invoke idle callback timeout algorithm:

      +
    1. Let event_loop be the event loop associated with + window argument passed to the algorithm
    2. Let callback be the result of finding the entry in - window's list of idle request callbacks or the list + event_loop's list of idle request callbacks or the list of runnable idle callbacks that is associated with the value - given by the handle argument passed to the algorithm. + given by the handle and window arguments passed + to the algorithm.
    3. If callback is not undefined:
        -
      1. Remove callback from both window's list - of idle request callbacks and the list of runnable idle - callbacks.
      2. +
      3. Remove callback from both event_loop's + list of idle request callbacks and the list of runnable + idle callbacks.
      4. Let now be the current time.
      5. Let deadlineArg be a new IdleDeadline. Set the time associated with deadlineArg to