Skip to content

Commit 4ea6fa3

Browse files
committed
Correctly set Script element's internal slot when parsed.
1 parent 54cf168 commit 4ea6fa3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

spec/index.bs

+24
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ spec:ECMA-262; urlPrefix: https://tc39.github.io/ecma262/
120120
type:dfn; text:current realm record; url: current-realm
121121
spec: HTML; urlPrefix: https://html.spec.whatwg.org/
122122
type: dfn; text: prepare the script element; url: prepare-the-script-element
123+
type: dfn; text: The text insertion mode; url: parsing-main-incdata
124+
type: dfn; text: reentrant invocation of the parser; url: nestedParsing
123125
type: dfn; text: get the text steps; url: get-the-text-steps
124126
type: dfn; text: set the inner text steps; url: set-the-inner-text-steps
125127
type: dfn; text: src; url: attr-script-src
@@ -1208,6 +1210,28 @@ The {{HTMLScriptElement/src}} setter steps are:
12081210
`script`.</ins>
12091211
1. <ins>Set [=this=]'s [=src=] content attribute to |value|.</ins>
12101212

1213+
#### Setting slot values from parser #### {#setting-slot-values-from-parser}
1214+
1215+
This document modifies the HTML parser to set the [=script text=] value when the script is created.
1216+
1217+
Modify the [=The text insertion mode=] algorithm as follows:
1218+
1219+
<dl class="switch">
1220+
<dt id="scriptEndTag">An end tag whose tag name is "script"</dt>
1221+
<dd>
1222+
<p>...</p>
1223+
1224+
<ins><p>Set <var>script</var>'s [=script text=] value to its [=child text content=].</p></ins>
1225+
1226+
<p>If the <span>active speculative HTML parser</span> is null, then <span>prepare the script
1227+
element</span> <var>script</var>. This might cause some script to execute, which might cause
1228+
<span data-x="dom-document-write">new characters to be inserted into the tokenizer</span>, and
1229+
might cause the tokenizer to output more tokens, resulting in a [=reentrant invocation of the parser=].</p>
1230+
1231+
<p>...</p>
1232+
</dd>
1233+
</dl>
1234+
12111235
#### Slot value verification #### {#slot-value-verification}
12121236

12131237
The first few steps of the [=prepare the script element=] algorithm are modified as follows:

0 commit comments

Comments
 (0)