From 4d422bde5f901abdee6402ebd6a52f15141cc44d Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Wed, 16 Mar 2022 10:06:04 -0400 Subject: [PATCH] Remove "responsible document" concept It was confusing to have this as a generic on environment settings objects, since it only applied to window environment settings objects. Instead, specifications should get the Window object's associated Document directly, if necessary by looking at the settings object's global object (which will, in some cases, be a Window object). Closes #4335. --- source | 85 ++++++++++++++++++++++------------------------------------ 1 file changed, 32 insertions(+), 53 deletions(-) diff --git a/source b/source index cda6693fee5..6d8c47aa991 100644 --- a/source +++ b/source @@ -82753,12 +82753,6 @@ interface BarProp { Document.

-
The responsible document
-
-

Return window's associated - Document.

-
-
The API URL character encoding

Return the current character encoding @@ -85814,11 +85808,12 @@ interface BarProp { environment is the result of running these steps:

    -
  1. Assert: environment has a responsible document.

  2. +
  3. Assert: environment's global + object is a Window.

  4. -
  5. Return environment's responsible document's browsing context's top-level browsing context's - browsing session.

  6. +
  7. Return environment's global + object's browsing context's top-level browsing + context's browsing session.

@@ -91134,10 +91129,12 @@ interface BeforeUnloadEvent : Event {

A URL that represents the location of the resource with which this environment is associated.

-

In the case of an environment settings object, this URL might be - distinct from the environment settings object's responsible - document's URL, due to mechanisms such as - history.pushState().

+

In the case of a Window environment settings object, + this URL might be distinct from its global + object's associated + Document's URL, due to + mechanisms such as history.pushState() which modify + the latter.

A BeforeUnloadEvent : Event {

A module map that is used when importing JavaScript modules.

-
A responsible document
- -
-

A Document that is assigned responsibility for actions taken by the scripts that - use this environment settings object.

- -

For example, the URL of the - responsible document is used to set the URL of the Document after it has been reset - using document.open().

- -

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

-
-
An API URL character encoding
@@ -94843,7 +94825,9 @@ import "https://example.com/foo/../module2.mjs"; the browsing context's active document.

  • If the task is being queued by or for a script, then - return the script's settings object's responsible document.

  • + return the script's settings object's global object's associated Document.

  • Assert: this step is never reached, because one of the previous conditions must be true. Really?

  • @@ -101490,11 +101474,10 @@ dictionary StructuredSerializeOptions { the port's relevant global object's associated Document.

    -

    If the 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 not be received unless and until the documents become - fully active again.

    +

    If the document is fully active, but the event listeners were all + created in the context of documents that are not fully active, then the + messages will not be received unless and until the documents become fully active + again.

    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 @@ -102750,15 +102733,16 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope global scope. This list includes the implicit MessagePort in the case of dedicated workers.

    -

    Given an environment settings object - o when creating or obtaining a worker, the relevant owner to add depends on - the type of global object specified by - o. If o specifies a global - object that is a WorkerGlobalScope object (i.e., if we are creating a nested - dedicated worker), then the relevant owner is that global object. Otherwise, o - specifies a global object that is a - Window object, and the relevant owner is the responsible document - specified by o.

    +

    Given an environment settings + object o when creating or obtaining a worker, the relevant owner to + add depends on the type of global + object specified by o. If o's global object is a WorkerGlobalScope + object (i.e., if we are creating a nested dedicated worker), then the relevant owner is that + global object. Otherwise, o's global + object is a Window object, and the relevant owner is that + Window's associated + Document.


    @@ -103219,10 +103203,6 @@ interface SharedWorkerGlobalScope : WorkerGlobalScope data-x="concept-WorkerGlobalScope-module-map">module map.

    -
    The responsible document
    -

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

    -
    The API URL character encoding

    Return UTF-8.

    @@ -104381,10 +104361,6 @@ interface WorkletGlobalScope {}; data-x="concept-WorkletGlobalScope-module-map">module map.

    -
    The responsible document
    -

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

    -
    The API URL character encoding

    Return UTF-8.

    @@ -119613,7 +119589,10 @@ if (s = prompt('What is your name?')) {
  • None of the elements in the Document are in any of the following namespaces: HTML namespace, SVG namespace, MathML namespace
  • The Document has no focusable area (e.g. from XLink) other than the viewport.
  • The Document has no hyperlinks (e.g. from XLink). -
  • There exists no script whose settings object specifies this Document as the responsible document. +
  • There exists no script whose settings + object's global object is a + Window object with this Document as its associated Document.
  • None of the elements in the Document have any registered event listeners.