Skip to content

Commit

Permalink
Remove "responsible document" concept
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
domenic authored Mar 16, 2022
1 parent a54ae27 commit 4d422bd
Showing 1 changed file with 32 additions and 53 deletions.
85 changes: 32 additions & 53 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -82753,12 +82753,6 @@ interface <dfn interface>BarProp</dfn> {
<code>Document</code></span>.</p>
</dd>

<dt>The <span>responsible document</span></dt>
<dd>
<p>Return <var>window</var>'s <span data-x="concept-document-window">associated
<code>Document</code></span>.</p>
</dd>

<dt>The <span>API URL character encoding</span></dt>
<dd>
<p>Return the current <span data-x="document's character encoding">character encoding</span>
Expand Down Expand Up @@ -85814,11 +85808,12 @@ interface <dfn interface>BarProp</dfn> {
<var>environment</var> is the result of running these steps:</p>

<ol>
<li><p>Assert: <var>environment</var> has a <span>responsible document</span>.</p></li>
<li><p>Assert: <var>environment</var>'s <span data-x="concept-settings-object-global">global
object</span> is a <code>Window</code>.</p></li>

<li><p>Return <var>environment</var>'s <span>responsible document</span>'s <span
data-x="concept-document-bc">browsing context</span>'s <span>top-level browsing context</span>'s
<span data-x="tlbc browsing session">browsing session</span>.</p></li>
<li><p>Return <var>environment</var>'s <span data-x="concept-settings-object-global">global
object</span>'s <span data-x="window bc">browsing context</span>'s <span>top-level browsing
context</span>'s <span data-x="tlbc browsing session">browsing session</span>.</p></li>
</ol>

</div>
Expand Down Expand Up @@ -91134,10 +91129,12 @@ interface <dfn interface>BeforeUnloadEvent</dfn> : <span>Event</span> {
<p>A <span>URL</span> that represents the location of the resource with which this
<span>environment</span> is associated.</p>

<p class="note">In the case of an <span>environment settings object</span>, this URL might be
distinct from the <span>environment settings object</span>'s <span>responsible
document</span>'s <span data-x="concept-document-url">URL</span>, due to mechanisms such as
<code data-x="dom-history-pushstate">history.pushState()</code>.</p>
<p class="note">In the case of a <code>Window</code> <span>environment settings object</span>,
this URL might be distinct from its <span data-x="concept-settings-object-global">global
object</span>'s <span data-x="concept-document-window">associated
<code>Document</code></span>'s <span data-x="concept-document-url">URL</span>, due to
mechanisms such as <code data-x="dom-history-pushstate">history.pushState()</code> which modify
the latter.</p>
</dd>

<dt>A <dfn id="concept-environment-top-level-creation-url" export
Expand Down Expand Up @@ -91211,21 +91208,6 @@ interface <dfn interface>BeforeUnloadEvent</dfn> : <span>Event</span> {
<p>A <span>module map</span> that is used when importing JavaScript modules.</p>
</dd>

<dt>A <dfn export for="environment settings object">responsible document</dfn></dt>

<dd>
<p>A <code>Document</code> that is assigned responsibility for actions taken by the scripts that
use this <span>environment settings object</span>.</p>

<p class="example">For example, the <span data-x="concept-document-url">URL</span> of the
<span>responsible document</span> is used to set the <span
data-x="concept-document-url">URL</span> of the <code>Document</code> after it has been reset
using <code data-x="dom-document-open">document.open()</code>.</p>

<p>If the <span>responsible event loop</span> is not a <span>window event loop</span>, then the
<span>environment settings object</span> has no <span>responsible document</span>.</p>
</dd>

<dt>An <dfn export for="environment settings object">API URL character encoding</dfn></dt>

<dd>
Expand Down Expand Up @@ -94843,7 +94825,9 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
the browsing context's <span>active document</span>.</p></li>

<li><p>If the task is being queued by or for a <span data-x="concept-script">script</span>, then
return the script's <span>settings object</span>'s <span>responsible document</span>.</p></li>
return the script's <span>settings object</span>'s <span
data-x="concept-settings-object-global">global object</span>'s <span
data-x="concept-document-window">associated <code>Document</code></span>.</p></li>

<li><p>Assert: this step is never reached, because one of the previous conditions must be true.
<span class="&#x0058;&#x0058;&#x0058;">Really?</span></p></li>
Expand Down Expand Up @@ -101490,11 +101474,10 @@ dictionary <dfn dictionary>StructuredSerializeOptions</dfn> {
the port's <span>relevant global object</span>'s <span data-x="concept-document-window">associated
<code>Document</code></span>.</p>

<p class="note">If the document is <span>fully active</span>, but the event listeners all have
scripts whose <span data-x="settings object">settings objects</span> specify <span
data-x="responsible document">responsible documents</span> that are <em>not</em> <span>fully
active</span>, then the messages will not be received unless and until the documents become
<span>fully active</span> again.</p>
<p class="note">If the document is <span>fully active</span>, but the event listeners were all
created in the context of documents that are <em>not</em> <span>fully active</span>, then the
messages will not be received unless and until the documents become <span>fully active</span>
again.</p>

<p>Each <span>event loop</span> has a <span>task source</span> called the <dfn>unshipped port
message queue</dfn>. This is a virtual <span>task source</span>: it must act as if it contained
Expand Down Expand Up @@ -102750,15 +102733,16 @@ interface <dfn interface>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope
global scope</var>. This list includes the implicit <code>MessagePort</code> in the case of <span
data-x="DedicatedWorkerGlobalScope">dedicated workers</span>.</p>

<p id="list-of-relevant-document-objects-to-add">Given an <span>environment settings object</span>
<var>o</var> when creating or obtaining a worker, the <dfn>relevant owner to add</dfn> depends on
the type of <span data-x="concept-settings-object-global">global object</span> specified by
<var>o</var>. If <var>o</var> specifies a <span data-x="concept-settings-object-global">global
object</span> that is a <code>WorkerGlobalScope</code> object (i.e., if we are creating a nested
dedicated worker), then the relevant owner is that global object. Otherwise, <var>o</var>
specifies a <span data-x="concept-settings-object-global">global object</span> that is a
<code>Window</code> object, and the relevant owner is the <span>responsible document</span>
specified by <var>o</var>.</p>
<p id="list-of-relevant-document-objects-to-add">Given an <span>environment settings
object</span> <var>o</var> when creating or obtaining a worker, the <dfn>relevant owner to
add</dfn> depends on the type of <span data-x="concept-settings-object-global">global
object</span> specified by <var>o</var>. If <var>o</var>'s <span
data-x="concept-settings-object-global">global object</span> is a <code>WorkerGlobalScope</code>
object (i.e., if we are creating a nested dedicated worker), then the relevant owner is that
global object. Otherwise, <var>o</var>'s <span data-x="concept-settings-object-global">global
object</span> is a <code>Window</code> object, and the relevant owner is that
<code>Window</code>'s <span data-x="concept-document-window">associated
<code>Document</code></span>.</p>

<hr>

Expand Down Expand Up @@ -103219,10 +103203,6 @@ interface <dfn interface>SharedWorkerGlobalScope</dfn> : <span>WorkerGlobalScope
data-x="concept-WorkerGlobalScope-module-map">module map</span>.</p>
</dd>

<dt>The <span>responsible document</span></dt>
<dd><p>Not applicable (the <span>responsible event loop</span> is not a <span>window event
loop</span>).</p></dd>

<dt>The <span>API URL character encoding</span></dt>
<dd>
<p>Return <span>UTF-8</span>.</p>
Expand Down Expand Up @@ -104381,10 +104361,6 @@ interface <dfn interface>WorkletGlobalScope</dfn> {};</code></pre>
data-x="concept-WorkletGlobalScope-module-map">module map</span>.</p>
</dd>

<dt>The <span>responsible document</span></dt>
<dd><p>Not applicable (the <span>responsible event loop</span> is not a <span>window event
loop</span>).</p></dd>

<dt>The <span>API URL character encoding</span></dt>
<dd>
<p>Return <span>UTF-8</span>.</p>
Expand Down Expand Up @@ -119613,7 +119589,10 @@ if (s = prompt('What is your name?')) {
<li>None of the elements in the <code>Document</code> are in any of the following namespaces: <span>HTML namespace</span>, <span>SVG namespace</span>, <span>MathML namespace</span>
<li>The <code>Document</code> has no <span>focusable area</span> (e.g. from XLink) other than the <span>viewport</span>.
<li>The <code>Document</code> has no <span data-x="hyperlink">hyperlinks</span> (e.g. from XLink).
<li>There exists no <span data-x="concept-script">script</span> whose <span>settings object</span> specifies this <code>Document</code> as the <span>responsible document</span>.
<li>There exists no <span data-x="concept-script">script</span> whose <span>settings
object</span>'s <span data-x="concept-settings-object-global">global object</span> is a
<code>Window</code> object with this <code>Document</code> as its <span
data-x="concept-document-window">associated <code>Document</code></span>.
<li>None of the elements in the <code>Document</code> have any registered event listeners.
</ul>

Expand Down

0 comments on commit 4d422bd

Please sign in to comment.