From 08de33bda69baf56ca114389b258b805d91048fb Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 28 Nov 2018 14:16:50 +0100 Subject: [PATCH 1/9] Make event loops 1:1 with agents Event loops ought to be 1:1 with agents, let's make it so. Helps with #4198. --- source | 87 ++++++++++++++++++++++------------------------------------ 1 file changed, 33 insertions(+), 54 deletions(-) diff --git a/source b/source index 15ab2b6d64d..dea71fb37f5 100644 --- a/source +++ b/source @@ -77649,11 +77649,6 @@ console.assert(iframeWindow.frameElement === null); any other group. Each such group is a unit of related similar-origin browsing contexts.

-

There is also at most one event loop per unit of related - similar-origin browsing contexts (though several units of related similar-origin browsing contexts can - have a shared event loop).

- @@ -79154,13 +79149,9 @@ interface BarProp {
The responsible event loop
-
- -

Return the event loop that is associated with the unit of related - similar-origin browsing contexts to which window's browsing - context belongs.

- -
+

Return the event loop associated with the agent whose set of + realms contains window's relevant + Realm.

The responsible document
@@ -88925,7 +88916,7 @@ import "https://example.com/foo/../module2.mjs";

JavaScript is expected to define agents in more detail; in particular that they hold a set of realms: tc39/ecma262 issue #882.

+ href="https://github.com/tc39/ecma262/issues/1357">tc39/ecma262 issue #1357.

Conceptually, the agent concept is an architecture-independent, idealized "thread" in which JavaScript code runs. Such code can involve multiple globals/PromiseRejectionEventInit : EventInit {

To coordinate events, user interaction, scripts, rendering, networking, and so forth, user agents must use event loops as - described in this section. There are two kinds of event loops: those for browsing contexts, and those for workers.

+ described in this section. Each agent has one event loop. -

There must be at least one browsing context event loop per user - agent, and at most one per unit of related similar-origin browsing contexts.

- -

When there is more than one event loop for a unit of related - browsing contexts, complications arise when a browsing context in that group - is navigated such that it switches from one unit of related - similar-origin browsing contexts to another. This specification does not currently describe - how to handle these complications.

- -

A browsing context event loop always has at least one browsing - context. If such an event loop's browsing - contexts all go away, then the event loop goes away as well. A browsing - context always has an event loop coordinating its activities.

- -

Worker event loops are simpler: each worker has one - event loop, and the worker processing model - manages the event loop's lifetime.

+

This specification does not currently describe how to handle the complications + arising from navigating between similar-origin window agents.

@@ -89448,18 +89423,19 @@ dictionary PromiseRejectionEventInit : EventInit { -

Each task in a browsing context event - loop is associated with a Document; if the task was queued in the context of - an element, then it is the element's node document; if the task was queued in the context - of a browsing context, then it is the browsing context's active - document at the time the task was queued; if the task was queued by or for a script then the document is the responsible document - specified by the script's settings object.

+

Each task in an event loop for a + similar-origin window agent is associated with a Document; if the task + was queued in the context of an element, then it is the element's node document; if + the task was queued in the context of a browsing context, then it is the + browsing context's active document at the time the task was queued; if + the task was queued by or for a script then the document is + the responsible document specified by the script's settings object.

A task is intended for a specific event loop: the event loop that is handling tasks for the task's associated Document or worker.

+

When a user agent is to queue a task, it must add the given task to one of the task queues of the relevant event @@ -89467,7 +89443,7 @@ dictionary PromiseRejectionEventInit : EventInit {

Each task is defined as coming from a specific task source. All the tasks from one particular task source and - destined to a particular event loop (e.g. the callbacks generated by timers of a + destined to a particular event loop (e.g., the callbacks generated by timers of a Document, the events fired for mouse movements over that Document, the tasks queued for the parser of that Document) must always be added to the same task queue, but tasks from different PromiseRejectionEventInit : EventInit {

  • Let oldestTask be the oldest task on one of the event loop's task queues, if any, - ignoring, in the case of a browsing context event loop, tasks whose - associated Documents are not fully active. The user agent may pick any - task queue. If there is no task to select, then jump to the microtasks step - below.

  • + ignoring, in the case of a similar-origin window agent event loop, + tasks whose associated Documents are not fully active. The user agent + may pick any task queue. If there is no task to select, then jump to the + microtasks step below.

  • Report the duration of time during which the user agent does not execute this loop by @@ -89557,9 +89533,8 @@ dictionary PromiseRejectionEventInit : EventInit {

  • -

    Update the rendering: If this event loop is a - browsing context event loop (as opposed to a worker event loop), then run the following substeps.

    +

    Update the rendering: if this event loop is for a + similar-origin window agent, then:

    1. @@ -89683,10 +89658,9 @@ dictionary PromiseRejectionEventInit : EventInit {
  • -
  • If this is a browsing context event loop (as opposed to a worker event loop), and there are no tasks in the event loop's task queues which are associated with a Document that is +

  • If this is an event loop for a similar-origin window agent, and + there are no tasks in the event loop's task queues which are associated with a Document that is fully active, and the event loop's microtask queue is empty, and none of the browsing contexts have a rendering opportunity, then for each browsing context, run the steps in @@ -89712,14 +89686,16 @@ dictionary PromiseRejectionEventInit : EventInit {

  • -

    If this is a worker event loop (i.e., one running for - a WorkerGlobalScope):

    +

    If this is an event loop that is not for a similar-origin window + agent or worklet agent (e.g., one for a dedicated worker + agent):

    1. If this is a supported DedicatedWorkerGlobalScope and the user agent believes that it would benefit from having its rendering updated at this time, then:

      +
      1. Let now be the current high resolution time. SharedWorkerGlobalScope : WorkerGlobalScope {

        The event loop

        + +

        Each WorkerGlobalScope object has a distinct event loop, separate from those used by units of related similar-origin browsing contexts. This event loop has no associated From 9339d99d06f83b2d8d9cac0472510a8feddf179e Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 11 Jan 2019 12:11:33 +0100 Subject: [PATCH 2/9] nit --- source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source b/source index dea71fb37f5..eb098e50a08 100644 --- a/source +++ b/source @@ -79150,8 +79150,8 @@ interface BarProp {

        The responsible event loop

        Return the event loop associated with the agent whose set of - realms contains window's relevant - Realm.

        + realms contains window's relevant Realm.

  • The responsible document
    From 28fe7e50456f4eb70fc6702a354d2300895adab8 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 30 Jan 2019 16:06:00 +0100 Subject: [PATCH 3/9] wip (will fail to build) --- source | 116 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 65 insertions(+), 51 deletions(-) diff --git a/source b/source index eb098e50a08..b4527983849 100644 --- a/source +++ b/source @@ -8035,9 +8035,8 @@ interface DOMStringList {

    Serializable objects support being serialized, and later deserialized, in a way that is independent of any given JavaScript Realm. This allows them to be stored on - disk and later restored, or cloned across document and worker boundaries (including across - documents of different origins or in different event loops).

    + disk and later restored, or cloned across agent and even agent cluster + boundaries.

    Not all objects are serializable objects, and not all aspects of objects that are serializable objects are necessarily preserved when they are serialized.

    @@ -8149,8 +8148,8 @@ interface DOMStringList {

    Transferable objects

    -

    Transferable objects support being transferred across event loops. Transferring is effectively recreating the object while sharing a +

    Transferable objects support being transferred across agents. Transferring is effectively recreating the object while sharing a reference to the underlying data and then detaching the object being transferred. This is useful to transfer ownership of expensive resources. Not all objects are transferable objects and not all aspects of objects that are transferable objects are @@ -89369,7 +89368,20 @@ dictionary PromiseRejectionEventInit : EventInit {

    To coordinate events, user interaction, scripts, rendering, networking, and so forth, user agents must use event loops as - described in this section. Each agent has one event loop. + described in this section. Each agent has an associated event loop.

    + +

    A window event loop is the event loop used by similar-origin window agents. + +

    A worker event loop is the event loop used by dedicated worker agents, shared worker + agents, and service worker agents.

    + +

    A worklet event loop is the event loop used by worklet agents.

    + +

    User agents are encouraged to have one event loop per agent. User + agents may share ...

    This specification does not currently describe how to handle the complications arising from navigating between task in an event loop for a - similar-origin window agent is associated with a Document; if the task - was queued in the context of an element, then it is the element's node document; if - the task was queued in the context of a browsing context, then it is the - browsing context's active document at the time the task was queued; if - the task was queued by or for a script then the document is - the responsible document specified by the script's settings object.

    +

    Each task in a window event loop is associated + with a Document; if the task was queued in the context of an element, then it is the + element's node document; if the task was queued in the context of a browsing + context, then it is the browsing context's active document at the + time the task was queued; if the task was queued by or for a script then the document is the responsible document + specified by the script's settings object.

    A task is intended for a specific event loop: the event loop that is handling tasks for the @@ -89478,10 +89490,10 @@ dictionary PromiseRejectionEventInit : EventInit {

  • Let oldestTask be the oldest task on one of the event loop's task queues, if any, - ignoring, in the case of a similar-origin window agent event loop, - tasks whose associated Documents are not fully active. The user agent - may pick any task queue. If there is no task to select, then jump to the - microtasks step below.

  • + ignoring, in the case of a window event loop, tasks whose associated + Documents are not fully active. The user agent may pick any task + queue. If there is no task to select, then jump to the microtasks step + below.

  • Report the duration of time during which the user agent does not execute this loop by @@ -89533,8 +89545,8 @@ dictionary PromiseRejectionEventInit : EventInit {

  • -

    Update the rendering: if this event loop is for a - similar-origin window agent, then:

    +

    Update the rendering: if this is a window event loop, + then:

    1. @@ -89658,14 +89670,23 @@ dictionary PromiseRejectionEventInit : EventInit {
  • -
  • If this is an event loop for a similar-origin window agent, and - there are no tasks in the event loop's task queues which are associated with a Document that is - fully active, and the event loop's microtask queue is - empty, and none of the browsing contexts have a - rendering opportunity, then for each browsing context, run the steps in - the start an idle period algorithm, passing the Window associated with - that browsing context.

  • +
  • +

    If all of the following are true + +

      +
    • this is a window event loop
    • +
    • there are no tasks in the event loop's + task queues which are associated with a Document + that is fully active
    • +
    • the event loop's microtask queue is empty
    • +
    • none of the browsing contexts have a + rendering opportunity
    • +
    + +

    then for each browsing context, run the steps in the start an idle period + algorithm, passing the Window associated with that browsing + context.

    +
  • Report the duration of the update the rendering step by performing the @@ -89686,9 +89707,7 @@ dictionary PromiseRejectionEventInit : EventInit {

  • -

    If this is an event loop that is not for a similar-origin window - agent or worklet agent (e.g., one for a dedicated worker - agent):

    +

    If this is a worker event loop, then:

    1. @@ -89709,8 +89728,8 @@ dictionary PromiseRejectionEventInit : EventInit {

    Similar to the notes for updating the - rendering in a browsing context event loop, a user agent can - determine the rate of rendering in the dedicated worker.

    + rendering in a window event loop, a user agent can determine the rate of + rendering in the dedicated worker.

  • If there are no tasks in the event @@ -92137,7 +92156,7 @@ scheduleWork(); // queues a task to do lots of work a callback on the microtask queue. This allows their code to run after the currently-executing task has run to completion and the JavaScript execution context stack is empty, but without yielding control back to the - browser's event loop, as would be the case when using, for example, event loop, as would be the case when using, for example, setTimeout(f, 0).

    Authors ought to be aware that scheduling a lot of microtasks has the same performance @@ -96857,10 +96876,10 @@ dictionary PostMessageOptions {

    When a port's port message queue is enabled, the event loop must use it as one of its task sources. When a port's owner specifies a responsible event loop that is a - browsing context event loop, all tasks queued on its port - message queue must be associated with the responsible document specified by - the port's owner.

    + window event loop, all tasks queued on its port message queue must be associated with the + responsible document specified by the port's owner.

    If the port's owner specifies a responsible document that is fully active, but the event listeners all @@ -96967,9 +96986,9 @@ dictionary PostMessageOptions { port message queue of value, if any, leaving value's port message queue in its initial disabled state, and, if value's owner specifies a responsible - event loop that is a browsing context event loop, associating - the moved tasks with the responsible document - specified by value's owner.

  • + event loop that is a window event loop, associating the moved tasks with the responsible document specified by + value's owner.

  • If dataHolder.[[RemotePort]] is not null, then entangle dataHolder.[[RemotePort]] and value. (This will disentangle @@ -97340,10 +97359,9 @@ interface BroadcastChannel : EventTarget {

    The tasks must use the DOM manipulation task source, and, for those where the event loop specified by the target BroadcastChannel object's BroadcastChannel settings - object is a browsing context event loop, must be associated - with the responsible document specified by that target - BroadcastChannel object's BroadcastChannel settings - object.

    + object is a window event loop, must be associated with the responsible + document specified by that target BroadcastChannel object's + BroadcastChannel settings object.

  • @@ -98597,7 +98615,7 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope {
  • Let inherited origin be outside settings's origin.

  • -
  • Let worker event loop be a newly created event +

  • Let worker event loop be a newly created worker event loop.

  • Let realm be the value of execution context's Realm @@ -98643,12 +98661,8 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope {

  • The responsible document
    -
    - -

    Not applicable (the responsible event loop is not a browsing context - event loop).

    - -
    +

    Not applicable (the responsible event loop is not a window event + loop).

    The API URL character encoding
    From c9b9b591f93422e2001e7ae27341931d41e5230c Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 31 Jan 2019 14:50:11 +0100 Subject: [PATCH 4/9] more fixes (let's continue to not fail?) --- source | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/source b/source index b4527983849..16a4dfe944b 100644 --- a/source +++ b/source @@ -65839,10 +65839,10 @@ interface OffscreenCanvasRenderingContext2D {
  • Queue a task in the placeholder canvas element's - relevant settings object's responsible event loop (which will be a - browsing context event loop) to set the placeholder canvas element's - output bitmap to be a reference to image.

    + relevant agent's event loop (which will be a window event + loop) to set the placeholder + canvas element's output bitmap to be a reference to + image.

    If image has different dimensions than the bitmap previously referenced as the placeholder canvas @@ -65854,9 +65854,9 @@ interface OffscreenCanvasRenderingContext2D {

    Implementations are encouraged to short-circuit the graphics update steps of - the browsing context event loop for the purposes of updating the - contents of a placeholder canvas - element to the display. This could mean, for example, that the window event loop for the purposes of updating the contents of a placeholder canvas element to the + display. This could mean, for example, that the commit() method can copy the bitmap contents directly to a graphics buffer that is mapped to the physical display location of the placeholder canvas element. This or @@ -79148,9 +79148,8 @@ interface BarProp {

  • The responsible event loop
    -

    Return the event loop associated with the agent whose set of - realms contains window's relevant Realm.

    +

    Return the event loop associated with window's relevant + agent.

    The responsible document
    @@ -86775,8 +86774,8 @@ interface ApplicationCache : EventTarget { data-x="concept-document-url">URL of the Document after it has been reset using document.open().

    -

    If the responsible event loop is not a browsing context event loop, - then the environment settings object has no responsible document.

    +

    If the responsible event loop is not a window event loop, then the + environment settings object has no responsible document.

    @@ -89371,21 +89370,21 @@ dictionary PromiseRejectionEventInit : EventInit { described in this section. Each agent has an associated event loop.

    A window event loop is the event loop used by similar-origin window agents. + data-x="similar-origin window agent">similar-origin window agents. User agents may share an + event loop across similar-origin window + agents as long as they are same-site and same-scheme. + +

    This specification does not currently describe how to handle the complications + arising from navigating between similar-origin window agents.

    A worker event loop is the event loop used by dedicated worker agents, shared worker - agents, and service worker agents.

    + agents, and service worker agents. There must be + one worker event loop per such agent.

    A worklet event loop is the event loop used by worklet agents.

    - -

    User agents are encouraged to have one event loop per agent. User - agents may share ...

    - -

    This specification does not currently describe how to handle the complications - arising from navigating between similar-origin window agents.

    + agent">worklet agents. ???

    From 5f6435153181a2b2f3ed50ef6bc62c747012b549 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 31 Jan 2019 15:01:55 +0100 Subject: [PATCH 5/9] add example --- source | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source b/source index 16a4dfe944b..b2872818938 100644 --- a/source +++ b/source @@ -89376,7 +89376,9 @@ dictionary PromiseRejectionEventInit : EventInit {

    This specification does not currently describe how to handle the complications arising from navigating between similar-origin window agents.

    + agent">similar-origin window agents. E.g., when a browsing context navigates from https://example.com/ to https://shop.invalid/.

    A worker event loop is the event loop used by dedicated worker agents, shared worker From 616ca10d98b8e806cf80d188d86975ee98340d1c Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 31 Jan 2019 16:14:04 +0100 Subject: [PATCH 6/9] clean up worker bits somewhat (and remaining "unit of related" mentions) --- source | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/source b/source index b2872818938..6f9dcca9fe0 100644 --- a/source +++ b/source @@ -80681,9 +80681,8 @@ interface History {

    The session history event loop helps coordinate cross-browsing-context transitions of the joint session history: since each browsing context might, at any - particular time, have a different event loop (this can happen if the user agent has - more than one event loop per unit of related browsing contexts), - transitions would otherwise have to involve cross-event-loop synchronization.

    + particular time, have a different event loop, transitions would otherwise have to + involve cross-event-loop synchronization.


    @@ -98153,22 +98152,16 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope {

    The event loop

    - - -

    Each WorkerGlobalScope object has a distinct event loop, separate - from those used by units of related - similar-origin browsing contexts. This event loop has no associated - browsing context, and its task queues only have +

    A worker event loop's task queues only have events, callbacks, and networking activity as tasks. These event loops are created by the run a - worker algorithm.

    - -

    Each WorkerGlobalScope object also has a closing flag, which must be initially - false, but which can get set to true by the algorithms in the processing model - section belowwhen the worker is requested to close.

    + w-nodev> These worker event loops are created by the + run a worker algorithm.

    + +

    Each WorkerGlobalScope object has a closing flag, which must be initially false, but which can get set to true by the + algorithms in the processing model section belowwhen the worker is requested to + close.

    Once the WorkerGlobalScope's closing flag is set to true, the event From d464885d5939a6901077d2b0dce424cce1eb8b21 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 4 Feb 2019 16:21:25 +0100 Subject: [PATCH 7/9] address some feedback --- source | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/source b/source index 6f9dcca9fe0..74d8df4a26f 100644 --- a/source +++ b/source @@ -89371,13 +89371,15 @@ dictionary PromiseRejectionEventInit : EventInit {

    A window event loop is the event loop used by similar-origin window agents. User agents may share an event loop across similar-origin window - agents as long as they are same-site and same-scheme. + agents.

    +

    This specification does not currently describe how to handle the complications arising from navigating between similar-origin window agents. E.g., when a browsing context navigates from https://example.com/ to https://shop.invalid/.

    + data-x="">https://shop.example/
    .

    A worker event loop is the event loop used by dedicated worker agents, shared worker @@ -89493,7 +89495,7 @@ dictionary PromiseRejectionEventInit : EventInit { ignoring, in the case of a window event loop, tasks whose associated Documents are not fully active. The user agent may pick any task queue. If there is no task to select, then jump to the microtasks step - below.

    + below.

  • Report the duration of time during which the user agent does not execute this loop by @@ -96875,26 +96877,24 @@ dictionary PostMessageOptions {

    When a port's port message queue is enabled, the event loop must use it as one of its task sources. When a port's owner specifies a responsible event loop that is a - window event loop, all tasks queued on its port message queue must be associated with the - responsible document specified by the port's owner.

    - -

    If the port's owner specifies a - responsible document that is fully active, but the event listeners all - have scripts whose settings objects specify responsible documents that are not fully - active, then the messages will be lost.

    + data-x="concept-port-owner">owner's responsible event loop is a window + event loop, all tasks queued on its port message queue must be associated with the port's + owner's responsible document.

    + +

    If the port's owner's responsible + document is fully active, but the event listeners all have scripts whose settings objects specify responsible documents that are not fully active, then the + messages will be lost.

    Each event loop has a task source called the unshipped port message queue. This is a virtual task source: it must act as if it contained the tasks of each port message queue of each MessagePort whose has been shipped flag is false, whose port - message queue is enabled, and whose owner - specifies that event loop as the responsible event loop, in the order in - which they were added to their respective task source. When a is enabled, and whose owner's + responsible event loop is that event loop, in the order in which they + were added to their respective task source. When a task would be removed from the unshipped port message queue, it must instead be removed from its port message queue.

    @@ -96985,10 +96985,10 @@ dictionary PostMessageOptions { data-x="event-message">message
    events in dataHolder.[[PortMessageQueue]] to the port message queue of value, if any, leaving value's port message queue in its initial disabled state, and, if - value's owner specifies a responsible - event loop that is a window event loop, associating the moved tasks with the responsible document specified by - value's owner.

  • + value's owner's responsible event + loop is a window event loop, associating the moved tasks with value's owner's responsible document.

  • If dataHolder.[[RemotePort]] is not null, then entangle dataHolder.[[RemotePort]] and value. (This will disentangle From 50b9dfa18b1960dc4afadefb20a64ec6a41f5082 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 6 Feb 2019 17:08:13 +0100 Subject: [PATCH 8/9] address remaining comments --- source | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/source b/source index 74d8df4a26f..2ba0b65524c 100644 --- a/source +++ b/source @@ -89368,6 +89368,9 @@ dictionary PromiseRejectionEventInit : EventInit { agents must use event loops as described in this section. Each agent has an associated event loop.

    +

    In the future, this standard hopes to define exactly when event loops can be created or reused. +

    A window event loop is the event loop used by similar-origin window agents. User agents may share an event loop across similar-origin window @@ -89387,7 +89390,11 @@ dictionary PromiseRejectionEventInit : EventInit { one worker event loop per such agent.

    A worklet event loop is the event loop used by worklet agents. ???

    + agent">worklet agents.

    + +

    As detailed in issue #4213 the situation for worklets is + more complicated.

    @@ -89449,7 +89456,7 @@ dictionary PromiseRejectionEventInit : EventInit { the event loop that is handling tasks for the task's associated Document or worker.

    - +

    When a user agent is to queue a task, it must add the given task to one of the task queues of the relevant event @@ -89713,10 +89720,12 @@ dictionary PromiseRejectionEventInit : EventInit {

    1. -

      If this is a supported +

      If the surrounding agent's single realm's global + object is a supported DedicatedWorkerGlobalScope and the user agent believes that it would benefit from having its rendering updated at this time, then:

      - +
      1. Let now be the current high resolution time. Date: Thu, 7 Feb 2019 11:01:29 +0100 Subject: [PATCH 9/9] final feedback --- source | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source b/source index 2ba0b65524c..125c78bf882 100644 --- a/source +++ b/source @@ -80681,8 +80681,9 @@ interface History {

        The session history event loop helps coordinate cross-browsing-context transitions of the joint session history: since each browsing context might, at any - particular time, have a different event loop, transitions would otherwise have to - involve cross-event-loop synchronization.

        + particular time, have a different event loop (this can happen if the user navigates + from example.com to shop.example), transitions would + otherwise have to involve cross-event-loop synchronization.


        @@ -89369,7 +89370,7 @@ dictionary PromiseRejectionEventInit : EventInit { described in this section. Each agent has an associated event loop.

        In the future, this standard hopes to define exactly when event loops can be created or reused. + loop">event loops can be created or reused.

        A window event loop is the event loop used by similar-origin window agents. User agents may share an @@ -89720,9 +89721,9 @@ dictionary PromiseRejectionEventInit : EventInit {

        1. -

          If the surrounding agent's single realm's global - object is a supported +

          If this event loop's agent's single realm's global object is a supported DedicatedWorkerGlobalScope and the user agent believes that it would benefit from having its rendering updated at this time, then: