diff --git a/index.html b/index.html index b0060bf..ccd0f24 100644 --- a/index.html +++ b/index.html @@ -83,7 +83,8 @@

Dependencies

The terms browsing context - , event loop, + , similar-origin + window agent, event loop, event loop processing model, spin the event loop, fully active, @@ -341,19 +342,25 @@

Window interface extensions

Each Window has:

+ +

In addition, each similar-origin window agent has:

+ +

The requestIdleCallback method

@@ -367,8 +374,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 agent be the similar-origin window agent + associated with window
  • +
  • Push callback to the end of agent'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 +431,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 agent be the similar-origin window agent + associated with window
    5. +
    6. Find the entry in either the agent'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 agent's list of idle request callbacks and the list of runnable idle callbacks.
    10. @@ -475,11 +487,12 @@

      Processing

      Start an idle period algorithm

      The start an idle period algorithm, which is called - by the event loop processing model when it determines that - the event loop is otherwise idle:

      + by the event loop processing model, when it determines that + the event loop is otherwise idle, passing a similar-origin + window agent as the argument agent:

      1. Let last_deadline be the last idle period deadline - associated with window + associated with agent
      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 +522,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 agent's list of + idle request callbacks.
      7. -
      8. Let run_list be window's list of runnable - idle callbacks. +
      9. Let run_list be agent's list of + runnable idle callbacks.
      10. Append all entries from pending_list into run_list preserving order.
      11. @@ -521,19 +534,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. + agent as parameters.
      13. Save deadline as the last idle period deadline - associated with window.
      14. + associated with agent.

      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 similar-origin window agent. + 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 +558,10 @@

      Invoke idle callbacks algorithm

      to newly scheduled high-priority work, return from the algorithm.
    11. Let now be the current time.
    12. If now is less than deadline and the - window's list of runnable idle callbacks is not empty: + agent's list of runnable idle callbacks is not + empty:
        -
      1. Pop the top callback from window's +
      2. Pop the top callback from agent's list of runnable idle callbacks.
      3. Let deadlineArg be a new IdleDeadline. Set the time associated with deadlineArg to @@ -555,10 +570,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 agent'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 agent as a parameters and return from this algorithm
    13. @@ -572,16 +587,19 @@

      Invoke idle callbacks algorithm

      Invoke idle callback timeout algorithm

      The invoke idle callback timeout algorithm:

        +
      1. Let agent be the similar-origin window agent + 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 + agent'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 agent'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