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 Nov 7, 2022
1 parent 53346e4 commit 80cf9f0
Showing 1 changed file with 43 additions and 34 deletions.
77 changes: 43 additions & 34 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -95517,7 +95517,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 @@ -95585,7 +95585,6 @@ document.querySelector("button").addEventListener("click", bound);
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 @@ -96562,10 +96561,10 @@ document.querySelector("button").addEventListener("click", bound);
<li>
<p><span>Fetch a single module script</span> given <var>url</var>, <var>fetch client settings
object</var>, <var>destination</var>, <var>options</var>, <var>referringScript</var>'s
<span>settings object</span>, <var>referringScript</var>'s <span
data-x="concept-script-base-url">base URL</span>, <var>moduleRequest</var>, false, and
<var>onSingleFetchComplete</var> as defined below. If <var>performFetch</var> was given, pass
it along as well.</p>
<span data-x="concept-script-settings-object">settings object</span>,
<var>referringScript</var>'s <span data-x="concept-script-base-url">base URL</span>,
<var>moduleRequest</var>, false, and <var>onSingleFetchComplete</var> as defined below.
If <var>performFetch</var> was given, pass it along as well.</p>

<p><var>onSingleFetchComplete</var> given <var>result</var> is the following algorithm:</p>

Expand Down Expand Up @@ -96719,7 +96718,8 @@ document.querySelector("button").addEventListener("click", bound);
<var>moduleScript</var> and an optional <var>discoveredSet</var>:</p>

<ol>
<li><p>Let <var>moduleMap</var> be <var>moduleScript</var>'s <span>settings object</span>'s
<li><p>Let <var>moduleMap</var> be <var>moduleScript</var>'s
<span data-x="concept-script-settings-object">settings object</span>'s
<span data-x="concept-settings-object-module-map">module map</span>.</p></li>

<li><p>If <var>discoveredSet</var> was not given, let it be an empty <span>set</span>.</p></li>
Expand Down Expand Up @@ -96796,7 +96796,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 @@ -96848,7 +96849,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 @@ -96941,7 +96943,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 @@ -96980,7 +96983,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 @@ -97052,7 +97056,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 @@ -97133,7 +97138,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 a promise resolved with undefined.</p></li>
Expand Down Expand Up @@ -97364,9 +97370,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 @@ -97611,8 +97617,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 @@ -98382,8 +98388,8 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
<li><p>If <var>script</var> is a <span>classic script</span> and <var>script</var>'s <span>muted
errors</span> is true, terminate these steps.</p></li>

<li><p>Let <var>settings object</var> be <var>script</var>'s <span>settings object</span>.</p>
</li>
<li><p>Let <var>settings object</var> be <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>,
Expand Down Expand Up @@ -98622,8 +98628,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 @@ -98899,8 +98906,8 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
<li><p>Set <var>referencing script</var> to
<var>referencingScriptOrModule</var>.[[HostDefined]].</p>

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

<li><p>Set <var>fetch options</var> to the <span>descendant script fetch options</span> for
<var>referencing script</var>'s <span data-x="concept-script-script-fetch-options">fetch
Expand Down Expand Up @@ -98952,8 +98959,9 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
<li><p>Set <var>referencingScript</var> to
<var>referencingScriptOrModule</var>.[[HostDefined]].</p></li>

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

Expand Down Expand Up @@ -99286,7 +99294,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 @@ -108138,9 +108146,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 @@ -124292,10 +124300,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 80cf9f0

Please sign in to comment.