Skip to content

Commit

Permalink
Correctly set Script element's internal slot when parsed.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewarlow committed Apr 17, 2024
1 parent 74e413e commit 36c8319
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ spec:ECMA-262; urlPrefix: https://tc39.github.io/ecma262/
type:dfn; text:current realm record; url: current-realm
spec: HTML; urlPrefix: https://html.spec.whatwg.org/
type: dfn; text: prepare the script element; url: prepare-the-script-element
type: dfn; text: The text insertion mode; url: parsing-main-incdata
type: dfn; text: reentrant invocation of the parser; url: nestedParsing
</pre>

<pre class="link-defaults">
Expand Down Expand Up @@ -1168,6 +1170,28 @@ On setting the {{HTMLElement/innerText}}, {{Node/textContent}} and {{HTMLScriptE
1. Set [=script text=] value to the stringified attribute value.
1. Perform the usual attribute setter steps.

#### Setting slot values from parser #### {#setting-slot-values-from-parser}

This document modifies the HTML parser to set the [=script text=] value when the script is created.

Modify the [=The text insertion mode=] algorithm as follows:

<dl class="switch">
<dt id="scriptEndTag">An end tag whose tag name is "script"</dt>
<dd>
<p>...</p>

<ins><p>Set <var>script</var>'s [=script text=] value to its [=child text content=].</p></ins>

<p>If the <span>active speculative HTML parser</span> is null, then <span>prepare the script
element</span> <var>script</var>. This might cause some script to execute, which might cause
<span data-x="dom-document-write">new characters to be inserted into the tokenizer</span>, and
might cause the tokenizer to output more tokens, resulting in a [=reentrant invocation of the parser=].</p>

<p>...</p>
</dd>
</dl>

#### Slot value verification #### {#slot-value-verification}

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

0 comments on commit 36c8319

Please sign in to comment.