@@ -52,9 +52,11 @@ spec:html; type:element
52
52
<p> This specification depends on the Infra Standard. [[!INFRA]]
53
53
54
54
<p> Some of the terms used in this specification are defined in <cite> Encoding</cite> ,
55
- <cite> Selectors</cite> , <cite> Web IDL</cite> , <cite> XML</cite> , and <cite> Namespaces in XML</cite> .
55
+ <cite> Selectors</cite> , <cite> Trusted Types</cite> , <cite> Web IDL</cite> , <cite> XML</cite> , and
56
+ <cite> Namespaces in XML</cite> .
56
57
[[!ENCODING]]
57
58
[[!SELECTORS4]]
59
+ [[!TRUSTED-TYPES]]
58
60
[[!WEBIDL]]
59
61
[[!XML]]
60
62
[[!XML-NAMES]]
@@ -3033,8 +3035,9 @@ standards that want to define APIs shared between <a for=/>documents</a> and
3033
3035
3034
3036
<h4 id=interface-parentnode>Mixin {{ParentNode}}</h4>
3035
3037
3036
- <p> To <dfn export lt="converting nodes into a node">convert nodes into a node</dfn> , given
3037
- <var> nodes</var> and <var> document</var> , run these steps:
3038
+ <p> To <dfn export lt="converting nodes into a node">convert nodes into a node</dfn> , given a
3039
+ <a for=/>node</a> <var> parent</var> , <a for=/>list</a> of <a for=/>nodes</a> <var> nodes</var> , and
3040
+ <a for=/>document</a> <var> document</var> :
3038
3041
3039
3042
<ol>
3040
3043
<li><p> Let <var> node</var> be null.
@@ -3043,12 +3046,37 @@ standards that want to define APIs shared between <a for=/>documents</a> and
3043
3046
<a for=CharacterData>data</a> is the string and <a for=Node>node document</a> is
3044
3047
<var> document</var> .
3045
3048
3046
- <li><p> If <var> nodes</var> contains one <a for=/>node</a> , then set <var> node</var> to
3047
- <var> nodes</var> [0] .
3049
+ <li><p> Let <var> isScriptElement</var> be true if <var> parent</var> is an {{HTMLScriptElement}}
3050
+ <a for=/>node</a> ; otherwise false.
3051
+
3052
+ <li><p> Let <var> newNodes</var> be « ».
3053
+
3054
+ <li>
3055
+ <p> <a for=list>For each</a> <var> value</var> of <var> nodes</var> :
3056
+
3057
+ <ol>
3058
+ <li><p> Let <var> newValue</var> be <var> value</var> .
3059
+
3060
+ <li><p> If <var> value</var> is a {{Text}} <a for=/>node</a> and <var> isScriptElement</var> is
3061
+ true, then set <var> newValue</var> to a new {{Text}} <a for=/>node</a> whose
3062
+ <a for=Node>node document</a> is <var> document</var> and <a for=CharacterData>data</a> is the
3063
+ result of calling <a abstract-op>Get Trusted Type compliant string</a> , with {{TrustedScript}} ,
3064
+ <var> document</var> 's <a>relevant global object</a>, <var>value</var>' s
3065
+ <a for=CharacterData>data</a> , "<code> HTMLScriptElement text</code> ", and "<code> script</code> ".
3066
+
3067
+ <li><p> If <var> value</var> is a {{TrustedScript}} , then set <var> newValue</var> to a new {{Text}}
3068
+ <a for=/>node</a> whose <a for=CharacterData>data</a> is <var> value</var> 's
3069
+ <a for=TrustedScript>data</a> and <a for=Node>node document</a> is <var> document</var> .
3070
+
3071
+ <li><p> <a for=list>Append</a> <var> newValue</var> to <var> newNodes</var> .
3072
+ </ol>
3073
+
3074
+ <li><p> If <var> newNodes</var> contains one <a for=/>node</a> , then set <var> node</var> to
3075
+ <var> newNodes</var> [0] .
3048
3076
3049
3077
<li><p> Otherwise, set <var> node</var> to a new {{DocumentFragment}} <a for=/>node</a> whose
3050
3078
<a for=Node>node document</a> is <var> document</var> , and then <a>append</a> each <a for=/>node</a>
3051
- in <var> nodes </var> , if any, to it.
3079
+ in <var> newNodes </var> , if any, to it.
3052
3080
3053
3081
<li><p> Return <var> node</var> .
3054
3082
</ol>
@@ -3060,9 +3088,9 @@ interface mixin ParentNode {
3060
3088
readonly attribute Element? lastElementChild;
3061
3089
readonly attribute unsigned long childElementCount;
3062
3090
3063
- [CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes);
3064
- [CEReactions, Unscopable] undefined append((Node or DOMString)... nodes);
3065
- [CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes);
3091
+ [CEReactions, Unscopable] undefined prepend((Node or TrustedScript or DOMString)... nodes);
3092
+ [CEReactions, Unscopable] undefined append((Node or TrustedScript or DOMString)... nodes);
3093
+ [CEReactions, Unscopable] undefined replaceChildren((Node or TrustedScript or DOMString)... nodes);
3066
3094
3067
3095
Element? querySelector(DOMString selectors);
3068
3096
[NewObject] NodeList querySelectorAll(DOMString selectors);
@@ -3136,8 +3164,8 @@ the number of <a for=tree>children</a> of <a>this</a> that are <a for=/>elements
3136
3164
<p> The <dfn method for=ParentNode><code>prepend(<var>nodes</var>)</code></dfn> method steps are:
3137
3165
3138
3166
<ol>
3139
- <li><p> Let <var> node</var> be the result of <a>converting nodes into a node</a> given
3140
- <var> nodes</var> and <a>this</a> 's <a for=Node>node document</a> .
3167
+ <li><p> Let <var> node</var> be the result of <a>converting nodes into a node</a> given <a>this</a> ,
3168
+ <var> nodes</var> , and <a>this</a> 's <a for=Node>node document</a> .
3141
3169
3142
3170
<li><p> <a>Pre-insert</a> <var> node</var> into <a>this</a> before <a>this</a> 's
3143
3171
<a for=tree>first child</a> .
@@ -3146,8 +3174,8 @@ the number of <a for=tree>children</a> of <a>this</a> that are <a for=/>elements
3146
3174
<p> The <dfn method for=ParentNode><code>append(<var>nodes</var>)</code></dfn> method steps are:
3147
3175
3148
3176
<ol>
3149
- <li><p> Let <var> node</var> be the result of <a>converting nodes into a node</a> given
3150
- <var> nodes</var> and <a>this</a> 's <a for=Node>node document</a> .
3177
+ <li><p> Let <var> node</var> be the result of <a>converting nodes into a node</a> given <a>this</a> ,
3178
+ <var> nodes</var> , and <a>this</a> 's <a for=Node>node document</a> .
3151
3179
3152
3180
<li><p> <a>Append</a> <var> node</var> to <a>this</a> .
3153
3181
</ol>
@@ -3156,8 +3184,8 @@ the number of <a for=tree>children</a> of <a>this</a> that are <a for=/>elements
3156
3184
are:
3157
3185
3158
3186
<ol>
3159
- <li><p> Let <var> node</var> be the result of <a>converting nodes into a node</a> given
3160
- <var> nodes</var> and <a>this</a> 's <a for=Node>node document</a> .
3187
+ <li><p> Let <var> node</var> be the result of <a>converting nodes into a node</a> given <a>this</a> ,
3188
+ <var> nodes</var> , and <a>this</a> 's <a for=Node>node document</a> .
3161
3189
3162
3190
<li><p> <a>Ensure pre-insertion validity</a> of <var> node</var> into <a>this</a> before
3163
3191
null.
@@ -3212,9 +3240,9 @@ steps are to return the first <a>following</a> <a for=tree>sibling</a> that is a
3212
3240
3213
3241
<pre class=idl>
3214
3242
interface mixin ChildNode {
3215
- [CEReactions, Unscopable] undefined before((Node or DOMString)... nodes);
3216
- [CEReactions, Unscopable] undefined after((Node or DOMString)... nodes);
3217
- [CEReactions, Unscopable] undefined replaceWith((Node or DOMString)... nodes);
3243
+ [CEReactions, Unscopable] undefined before((Node or TrustedScript or DOMString)... nodes);
3244
+ [CEReactions, Unscopable] undefined after((Node or TrustedScript or DOMString)... nodes);
3245
+ [CEReactions, Unscopable] undefined replaceWith((Node or TrustedScript or DOMString)... nodes);
3218
3246
[CEReactions, Unscopable] undefined remove();
3219
3247
};
3220
3248
DocumentType includes ChildNode;
@@ -3262,7 +3290,7 @@ CharacterData includes ChildNode;
3262
3290
<a for=tree>sibling</a> not in <var> nodes</var> ; otherwise null.
3263
3291
3264
3292
<li><p> Let <var> node</var> be the result of <a>converting nodes into a node</a> , given
3265
- <var> nodes</var> and <a>this</a> 's <a for=Node>node document</a> .
3293
+ <var> parent </var> , <var> nodes</var> , and <a>this</a> 's <a for=Node>node document</a> .
3266
3294
3267
3295
<li><p> If <var> viablePreviousSibling</var> is null, then set it to <var> parent</var> 's
3268
3296
<a for=tree>first child</a> ; otherwise to <var> viablePreviousSibling</var> 's
@@ -3283,7 +3311,7 @@ CharacterData includes ChildNode;
3283
3311
<a for=tree>sibling</a> not in <var> nodes</var> ; otherwise null.
3284
3312
3285
3313
<li><p> Let <var> node</var> be the result of <a>converting nodes into a node</a> , given
3286
- <var> nodes</var> and <a>this</a> 's <a for=Node>node document</a> .
3314
+ <var> parent </var> , <var> nodes</var> , and <a>this</a> 's <a for=Node>node document</a> .
3287
3315
3288
3316
<li><p> <a>Pre-insert</a> <var> node</var> into <var> parent</var> before
3289
3317
<var> viableNextSibling</var> .
@@ -3300,7 +3328,7 @@ CharacterData includes ChildNode;
3300
3328
<a for=tree>sibling</a> not in <var> nodes</var> ; otherwise null.
3301
3329
3302
3330
<li><p> Let <var> node</var> be the result of <a>converting nodes into a node</a> , given
3303
- <var> nodes</var> and <a>this</a> 's <a for=Node>node document</a> .
3331
+ <var> parent </var> , <var> nodes</var> , and <a>this</a> 's <a for=Node>node document</a> .
3304
3332
3305
3333
<li>
3306
3334
<p> If <a>this</a> 's <a for=tree>parent</a> is <var> parent</var> , <a>replace</a> <a>this</a> with
0 commit comments