Skip to content

Commit caa217c

Browse files
committed
Address review comments
1 parent 4de6eb9 commit caa217c

File tree

1 file changed

+16
-30
lines changed

1 file changed

+16
-30
lines changed

dom.bs

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,41 +3034,28 @@ standards that want to define APIs shared between <a for=/>documents</a> and
30343034
<var>parent</var>, <var>nodes</var> and <var>document</var>, run these steps:
30353035

30363036
<ol>
3037+
<li><p>Let <var>node</var> be null.
3038+
<li><p>Replace each string in <var>nodes</var> with a new {{Text}} <a for=/>node</a> whose
3039+
<a for=CharacterData>data</a> is the string and <a for=Node>node document</a> is
3040+
<var>document</var>.
30373041
<li><p>Let <var>isScriptElement</var> be <var>parent</var> is a {{HTMLScriptElement}}.
3038-
<li><p>For each <var>value</var> in <var>nodes</var>:
3042+
<li><p><a for=set>For each</a> <var>value</var> in <var>nodes</var>:
30393043
<ol>
30403044
<li>If <var>value</var> is a <a for=/>node</a>, then:
30413045
<ol>
30423046
<li>If <var>isScriptElement</var> is false, skip to the next <var>value</var>.
3043-
<li>If <var>value</var>'s {{nodeType}} is not {{TEXT_NODE}}, skip to the next <var>value</var>.
3044-
<li>Let <var>text</var> be the result of executing the [$Get Trusted Type compliant string$] algorithm, with the following arguments:
3045-
* {{TrustedScript}} as <var>expectedType</var>,
3046-
* <var>document</var>'s [=relevant global object=] as <var>global</var>,
3047-
* <var>value</var>'s <a for=CharacterData>data</a> as <var>input</var>,
3048-
* `HTMLScriptElement text` as <var>sink</var>,
3049-
* `script` as <var>sinkGroup</var>.
3050-
3051-
<p>If the algorithm threw an error, rethrow the error.
3052-
<li>Set <var>value</var>'s <a for=CharacterData>data</a> to <var>text</var>.
3047+
<li>If <var>value</var> is not a {{Text}} <a for=/>node</a>, then <a for=iteration>continue</a>.
3048+
<li>Let <var>text</var> be the result of executing the [$Get Trusted Type compliant string$] algorithm, with the following arguments:
3049+
* {{TrustedScript}} as <span>expectedType</span>,
3050+
* <var>document</var>'s [=relevant global object=] as <span>global</span>,
3051+
* <var>value</var>'s <a for=CharacterData>data</a> as <span>input</span>,
3052+
* `HTMLScriptElement text` as <span>sink</span>,
3053+
* `script` as <span>sinkGroup</span>.
3054+
3055+
<p>If the algorithm threw an error, rethrow the error.
3056+
<li>Set <var>value</var>'s <a for=CharacterData>data</a> to <var>text</var>.
30533057
</ol>
3054-
<li>If <var>value</var> is a string, then:
3055-
<ol>
3056-
<li>Let <var>text</var> be <var>value</var>.
3057-
<li>If <var>isScriptElement</var> is true:
3058-
<ol>
3059-
<li>Let <var>text</var> be the result of executing the [$Get Trusted Type compliant string$] algorithm, with the following arguments:
3060-
* {{TrustedScript}} as <var>expectedType</var>,
3061-
* <var>document</var>'s [=relevant global object=] as <var>global</var>,
3062-
* <var>value</var> as <var>input</var>,
3063-
* `HTMLScriptElement text` as <var>sink</var>,
3064-
* `script` as <var>sinkGroup</var>.
3065-
3066-
If the algorithm threw an error, rethrow the error.
3067-
<li>Let <var>newValue</var> be a new {{Text}} <a for=/>node</a> whose
3068-
<a for=CharacterData>data</a> is <var>text</var> and <a for=Node>node document</a> is <var>document</var>.
3069-
<li>Replace <var>value</var> with <var>newValue</var>.
3070-
</ol>
3071-
</ol>
3058+
30723059
<li>If <var>value</var> is a {{TrustedScript}}, then:
30733060
<ol>
30743061
<li>Let <var>text</var> be <var>value</var>'s Data internal slot value.
@@ -3077,7 +3064,6 @@ standards that want to define APIs shared between <a for=/>documents</a> and
30773064
<li>Replace <var>value</var> with <var>newValue</var>.
30783065
</ol>
30793066
</ol>
3080-
<li><p>Let <var>node</var> be null.
30813067

30823068
<li><p>If <var>nodes</var> contains one <a for=/>node</a>, then set <var>node</var> to
30833069
<var>nodes</var>[0].

0 commit comments

Comments
 (0)