From 4ea6fa396b46e65e798a68daf82f5f24062d7e72 Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Thu, 4 Apr 2024 15:38:52 +0100 Subject: [PATCH] Correctly set Script element's internal slot when parsed. --- spec/index.bs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/spec/index.bs b/spec/index.bs index d03d083..8488c0d 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -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 type: dfn; text: get the text steps; url: get-the-text-steps type: dfn; text: set the inner text steps; url: set-the-inner-text-steps type: dfn; text: src; url: attr-script-src @@ -1208,6 +1210,28 @@ The {{HTMLScriptElement/src}} setter steps are: `script`. 1. Set [=this=]'s [=src=] content attribute to |value|. +#### 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: + +
+
An end tag whose tag name is "script"
+
+

...

+ +

Set script's [=script text=] value to its [=child text content=].

+ +

If the active speculative HTML parser is null, then prepare the script + element script. This might cause some script to execute, which might cause + new characters to be inserted into the tokenizer, and + might cause the tokenizer to output more tokens, resulting in a [=reentrant invocation of the parser=].

+ +

...

+
+
+ #### Slot value verification #### {#slot-value-verification} The first few steps of the [=prepare the script element=] algorithm are modified as follows: