@@ -57958,6 +57958,7 @@ o............A....e
57958
57958
elements.
57959
57959
</p>
57960
57960
57961
+ <!-- Cleanup? But see https://github.com/whatwg/html/pull/964#issuecomment-204384209 -->
57961
57962
<li><p>Let <var>settings object</var> be the element's <span>node document</span>'s
57962
57963
<code>Window</code> object's <span>environment settings object</span>.</p></li>
57963
57964
@@ -58221,11 +58222,12 @@ o............A....e
58221
58222
<p class="note">If a <code>script</code> element that blocks a parser gets moved to another
58222
58223
<code>Document</code> before it would normally have stopped blocking that parser, it nonetheless
58223
58224
continues blocking that parser until the condition that causes it to be blocking the parser no
58224
- longer applies (e.g. if the script is a <span>pending parsing-blocking script</span> because there
58225
- was <span>a style sheet that is blocking scripts</span> when it was parsed, but then the script is
58226
- moved to another <code>Document</code> before the style sheet loads, the script still blocks the
58227
- parser until the style sheets are all loaded, at which time the script executes and the parser is
58228
- unblocked).</p>
58225
+ longer applies. For example, consider a script that is a <span>pending parsing-blocking
58226
+ script</span> because there was <span>a style sheet that is blocking scripts</span> when it was
58227
+ parsed. If the script is moved to another <code>Document</code> before the style sheet loads, the
58228
+ script still blocks the parser until the style sheets are all loaded, at which time the <span
58229
+ data-x="execute the script block">execute a script block</span> algorithm runs immediately returns
58230
+ without evaluating any script. At this point, the parser is finally unblocked.</p>
58229
58231
58230
58232
<!-- also (and this would be worth testing): the way the spec is written, if you do not have a
58231
58233
style sheet that is blocking scripts, then you parse a <script src>, then while waiting for the
@@ -58237,46 +58239,52 @@ o............A....e
58237
58239
block</dfn>, it must run the following steps.</p>
58238
58240
58239
58241
<ol>
58242
+ <li><p>If <span data-x="concept-script-script">the script's script</span> is null, <span
58243
+ data-x="concept-event-fire">fire an event</span> named <code data-x="event-error">error</code>
58244
+ at the element, and return.</p></li>
58240
58245
58241
- <li>
58246
+ <li><p>Let <var>document</var> be the <code>script</code> element's <span>node
58247
+ document</span>.</p></li>
58242
58248
58243
- <p>If the element is flagged as <span>"parser-inserted"</span>, but the element's
58244
- <span>node document</span> is not the <code>Document</code> of the parser that created the element,
58245
- then return.</p>
58249
+ <li>
58250
+ <p>If <var>document</var>'s <span>relevant settings object</span> is not equal to <span
58251
+ data-x="concept-script-script">the script's script</span>'s <span>settings object</span>, then
58252
+ return.</p>
58246
58253
58254
+ <p class="note">This can occur if, while the script was being fetched inside the <span>prepare a
58255
+ script</span> algorithm, the element was moved to a document in a different
58256
+ <code>Window</code>.</p>
58247
58257
</li>
58248
58258
58249
58259
<li>
58260
+ <p>If <span data-x="concept-n-noscript">scripting is disabled</span> for the element, then
58261
+ return.</p>
58250
58262
58251
- <p>If <span data-x="concept-script-script">the script's script</span> is null, <span
58252
- data-x="concept-event-fire">fire an event</span> named <code data-x="event-error">error</code>
58253
- at the element, and return.</p>
58254
-
58263
+ <p class="note">This can occur if, while the script was being fetched inside the <span>prepare a
58264
+ script</span> algorithm, the element was moved to a document without a <span
58265
+ data-x="concept-document-bc">browsing context</span>.</p>
58255
58266
</li>
58256
58267
58257
- <!-- SCRIPT EXEC -->
58258
-
58259
58268
<li>
58269
+ <p>If the element is flagged as <span>"parser-inserted"</span>, but <var>document</var> is
58270
+ not the <code>Document</code> of the parser that created the element, then return.</p>
58260
58271
58261
- <p>If the script is <span data-x="concept-script-external">from an external file</span>, or
58262
- <span data-x="concept-script-type">the script's type</span> is "<code data-x="">module</code>",
58263
- then increment the <span>ignore-destructive-writes counter</span> of the <code>script</code>
58264
- element's <span>node document</span>. Let <var>neutralized doc</var> be that
58265
- <code>Document</code>.</p>
58266
-
58272
+ <p class="note">This can occur if the element was <span
58273
+ data-x="concept-node-adopt">adopted</span> into a new document during parsing, before the
58274
+ <span>prepare a script</span> algorithm ran.</p>
58267
58275
</li>
58268
58276
58269
- <li >
58277
+ <!-- SCRIPT EXEC -- >
58270
58278
58271
- <p>Let <var>old script element</var> be the value to which the <code>script</code>
58272
- element 's < span>node document</span>'s < code
58273
- data-x="dom-document-currentScript">currentScript</code> object was most recently
58274
- set .</p>
58279
+ <li><p>If the script is <span data-x="concept-script-external">from an external file</span>, or
58280
+ <span data-x="concept-script-type">the script 's type</ span> is "<code data-x="">module</ code>",
58281
+ then increment the <span>ignore-destructive-writes counter</span> of
58282
+ <var>document</var> .</p></li >
58275
58283
58276
- </li>
58284
+ <li><p>Let <var>old script element</var> be the value to which <var>document</var>'s <code
58285
+ data-x="dom-document-currentScript">currentScript</code> object was most recently set.</p></li>
58277
58286
58278
58287
<li>
58279
-
58280
58288
<p>Switch on <span data-x="concept-script-type">the script's type</span>:</p>
58281
58289
58282
58290
<dl class="switch">
@@ -58285,7 +58293,7 @@ o............A....e
58285
58293
<ol>
58286
58294
<li>
58287
58295
<p>If the <code>script</code> element's <span>root</span> is <em>not</em> a <span>shadow
58288
- root</span>, then set the <code>script</code> element's <span>node document</span >'s <code
58296
+ root</span>, then set <var> document</var >'s <code
58289
58297
data-x="dom-document-currentScript">currentScript</code> attribute to the
58290
58298
<code>script</code> element. Otherwise, set it to null.</p>
58291
58299
@@ -58311,31 +58319,17 @@ o............A....e
58311
58319
</ol>
58312
58320
</dd>
58313
58321
</dl>
58314
-
58315
- </li>
58316
-
58317
- <li>
58318
-
58319
- <p>Set the <code>script</code> element's <span>node document</span>'s <code
58320
- data-x="dom-document-currentScript">currentScript</code> attribute to <var>old script
58321
- element</var>.</p>
58322
-
58323
58322
</li>
58324
58323
58325
- <li>
58326
-
58327
- <p>Decrement the <span>ignore-destructive-writes counter</span> of <var>neutralized doc</var>, if it was incremented in the earlier step.</p>
58324
+ <li><p>Set <var>document</var>'s <code data-x="dom-document-currentScript">currentScript</code>
58325
+ attribute to <var>old script element</var>.</p></li>
58328
58326
58329
- </li>
58330
-
58331
- <li>
58332
-
58333
- <p>If the script is <span data-x="concept-script-external">from an external file</span>, then
58334
- <span data-x="concept-event-fire">fire an event</span> named <code
58335
- data-x="event-load">load</code> at the <code>script</code> element.</p>
58336
-
58337
- </li>
58327
+ <li><p>Decrement the <span>ignore-destructive-writes counter</span> of <var>document</var>, if it
58328
+ was incremented in the earlier step.</p></li>
58338
58329
58330
+ <li><p>If the script is <span data-x="concept-script-external">from an external file</span>, then
58331
+ <span data-x="concept-event-fire">fire an event</span> named <code
58332
+ data-x="event-load">load</code> at the <code>script</code> element.</p></li>
58339
58333
</ol>
58340
58334
58341
58335
</div>
0 commit comments