Skip to content

Commit

Permalink
Editorial: Give script's settings object an unambiguous ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Oct 11, 2023
1 parent 3ca0811 commit a06afd8
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -103207,7 +103207,7 @@ document.querySelector("button").addEventListener("click", bound);
data-x="struct">structs</span>. All scripts have:</p>

<dl>
<dt>A <dfn for="script" export>settings object</dfn></dt>
<dt>A <dfn for="script" export data-x="concept-script-settings-object">settings object</dfn></dt>

<dd><p>An <span>environment settings object</span>, containing various settings that are shared
with other <span data-x="concept-script">scripts</span> in the same context.</p></dd>
Expand Down Expand Up @@ -103275,7 +103275,6 @@ document.querySelector("button").addEventListener("click", bound);
containing document, for inline scripts.</p></dd>
</dl>


<p>A <dfn export>classic script</dfn> is a type of <span data-x="concept-script">script</span>
that has the following additional <span data-x="struct item">item</span>:</p>

Expand Down Expand Up @@ -104276,7 +104275,8 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Let <var>script</var> be a new <span>classic script</span> that this algorithm will
subsequently initialize.</p></li>

<li><p>Set <var>script</var>'s <span>settings object</span> to <var>settings</var>.</p></li>
<li><p>Set <var>script</var>'s <span data-x="concept-script-settings-object">settings
object</span> to <var>settings</var>.</p></li>

<li><p>Set <var>script</var>'s <span data-x="concept-script-base-url">base URL</span> to
<var>baseURL</var>.</p></li>
Expand Down Expand Up @@ -104328,7 +104328,8 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Let <var>script</var> be a new <span>module script</span> that this algorithm will
subsequently initialize.</p></li>

<li><p>Set <var>script</var>'s <span>settings object</span> to <var>settings</var>.</p></li>
<li><p>Set <var>script</var>'s <span data-x="concept-script-settings-object">settings
object</span> to <var>settings</var>.</p></li>

<li><p>Set <var>script</var>'s <span data-x="concept-script-base-url">base URL</span> to
<var>baseURL</var>.</p></li>
Expand Down Expand Up @@ -104436,7 +104437,8 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Let <var>script</var> be a new <span>module script</span> that this algorithm will
subsequently initialize.</p></li>

<li><p>Set <var>script</var>'s <span>settings object</span> to <var>settings</var>.</p></li>
<li><p>Set <var>script</var>'s <span data-x="concept-script-settings-object">settings
object</span> to <var>settings</var>.</p></li>

<li><p>Set <var>script</var>'s <span data-x="concept-script-base-url">base URL</span> and
<span data-x="concept-script-script-fetch-options">fetch options</span> to null.</p></li>
Expand Down Expand Up @@ -104475,7 +104477,8 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Let <var>script</var> be a new <span>module script</span> that this algorithm will
subsequently initialize.</p></li>

<li><p>Set <var>script</var>'s <span>settings object</span> to <var>settings</var>.</p></li>
<li><p>Set <var>script</var>'s <span data-x="concept-script-settings-object">settings
object</span> to <var>settings</var>.</p></li>

<li><p>Set <var>script</var>'s <span data-x="concept-script-base-url">base URL</span> and
<span data-x="concept-script-script-fetch-options">fetch options</span> to null.</p></li>
Expand Down Expand Up @@ -104547,7 +104550,8 @@ document.querySelector("button").addEventListener("click", bound);
and an optional boolean <var>rethrow errors</var> (default false):</p>

<ol>
<li><p>Let <var>settings</var> be the <span>settings object</span> of <var>script</var>.</p></li>
<li><p>Let <var>settings</var> be the <span data-x="concept-script-settings-object">settings
object</span> of <var>script</var>.</p></li>

<li><p><span>Check if we can run script</span> with <var>settings</var>. If this returns "do
not run" then return <span>NormalCompletion</span>(empty).</p></li>
Expand Down Expand Up @@ -104628,7 +104632,8 @@ document.querySelector("button").addEventListener("click", bound);
and an optional boolean <var>preventErrorReporting</var> (default false):</p>

<ol>
<li><p>Let <var>settings</var> be the <span>settings object</span> of <var>script</var>.</p></li>
<li><p>Let <var>settings</var> be the <span data-x="concept-script-settings-object">settings
object</span> of <var>script</var>.</p></li>

<li><p><span>Check if we can run script</span> with <var>settings</var>. If this returns "do not
run", then return <span>a promise resolved with</span> with undefined.</p></li>
Expand Down Expand Up @@ -104861,9 +104866,9 @@ document.querySelector("button").addEventListener("click", bound);
data-x="concept-script">script</span>, with the problematic position (line number and column
number) in the resource containing the script, using the <span
data-x="concept-settings-object-global">global object</span> specified by the script's
<span>settings object</span> as the target. If the error is still <i
data-x="concept-error-nothandled">not handled</i> after this, then the error may be reported to a
developer console.</p>
<span data-x="concept-script-settings-object">settings object</span> as the target. If the error
is still <i data-x="concept-error-nothandled">not handled</i> after this, then the error may be
reported to a developer console.</p>

<p class="XXX">The existence of both <span data-x="report the error">report an error</span> and
<span data-x="report the exception">report an exception</span> is confusing, and both algorithms
Expand Down Expand Up @@ -105108,8 +105113,8 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
<p>If <var>referringScript</var> is not null, then:</p>

<ol>
<li><p>Set <var>settingsObject</var> to <var>referringScript</var>'s <span>settings
object</span>.</p></li>
<li><p>Set <var>settingsObject</var> to <var>referringScript</var>'s
<span data-x="concept-script-settings-object">settings object</span>.</p></li>

<li><p>Set <var>baseURL</var> to <var>referringScript</var>'s <span
data-x="concept-script-base-url">base URL</span>.</p></li>
Expand Down Expand Up @@ -105881,7 +105886,8 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
<li><p>Let <var>settings object</var> be the <span>current settings object</span>.</p></li>

<li><p>If <var>script</var> is not null, then set <var>settings object</var> to
<var>script</var>'s <span>settings object</span>.</p></li>
<var>script</var>'s <span data-x="concept-script-settings-object">settings
object</span>.</p></li>

<li>
<p>If <var>operation</var> is "<code data-x="">reject</code>", then:</p>
Expand Down Expand Up @@ -106157,8 +106163,9 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
<li>
<p>If <var>active script</var> is not null, set <var>script execution context</var> to a new
<span>JavaScript execution context</span>, with its Function field set to null, its Realm field
set to <var>active script</var>'s <span>settings object</span>'s <span data-x="environment
settings object's realm">realm</span>, and its ScriptOrModule set to <var>active script</var>'s
set to <var>active script</var>'s <span data-x="concept-script-settings-object">settings
object</span>'s <span data-x="environment settings object's realm">realm</span>, and its
ScriptOrModule set to <var>active script</var>'s
<span data-x="concept-script-record">record</span>.</p>

<p class="note">As seen below, this is used in order to propagate the current <span>active
Expand Down Expand Up @@ -106445,8 +106452,8 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
<ol>
<li><p>Set <var>referencingScript</var> to <var>referrer</var>.[[HostDefined]].</p>

<li><p>Set <var>settingsObject</var> to <var>referencingScript</var>'s <span>settings
object</span>.</p></li>
<li><p>Set <var>settingsObject</var> to <var>referencingScript</var>'s <span
data-x="concept-script-settings-object">settings object</span>.</p></li>

<li><p>Set <var>fetchOptions</var> to the new <span>descendant script fetch options</span> for
<var>referencingScript</var>'s <span data-x="concept-script-script-fetch-options">fetch
Expand Down Expand Up @@ -106822,7 +106829,7 @@ 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
return the script's <span data-x="concept-script-settings-object">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>

Expand Down Expand Up @@ -115904,9 +115911,9 @@ interface <dfn interface>SharedWorker</dfn> : <span>EventTarget</span> {
<li>
<p>If <var>worker global scope</var> is not null, but the user agent has been
configured to disallow communication between the worker represented by the <var>worker global
scope</var> and the <span data-x="concept-script">scripts</span> whose <span data-x="settings
object">settings object</span> is <var>outside settings</var>, then set <var>worker global
scope</var> to null.</p>
scope</var> and the <span data-x="concept-script">scripts</span> whose <span
data-x="concept-script-settings-object">settings object</span> is <var>outside settings</var>,
then set <var>worker global scope</var> to null.</p>

<p class="note">For example, a user agent could have a development mode that isolates a
particular <span>top-level traversable</span> from all other pages, and scripts in that
Expand Down Expand Up @@ -132107,10 +132114,11 @@ 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>'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>There exists no <span data-x="concept-script">script</span> whose <span
data-x="concept-script-settings-object">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 a06afd8

Please sign in to comment.