Skip to content

Commit 77dcd61

Browse files
committed
Address review comments
1 parent 4de6eb9 commit 77dcd61

File tree

1 file changed

+19
-30
lines changed

1 file changed

+19
-30
lines changed

dom.bs

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,41 +3034,31 @@ 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+
3039+
<li><p>Replace each string in <var>nodes</var> with a new {{Text}} <a for=/>node</a> whose
3040+
<a for=CharacterData>data</a> is the string and <a for=Node>node document</a> is
3041+
<var>document</var>.
3042+
30373043
<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>:
3044+
3045+
<li><p><a for=set>For each</a> <var>value</var> in <var>nodes</var>:
30393046
<ol>
30403047
<li>If <var>value</var> is a <a for=/>node</a>, then:
30413048
<ol>
30423049
<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>.
3050+
<li>If <var>value</var> is not a {{Text}} <a for=/>node</a>, then <a for=iteration>continue</a>.
3051+
<li>Let <var>text</var> be the result of executing the [$Get Trusted Type compliant string$] algorithm, with the following arguments:
3052+
* {{TrustedScript}} as <span>expectedType</span>,
3053+
* <var>document</var>'s [=relevant global object=] as <span>global</span>,
3054+
* <var>value</var>'s <a for=CharacterData>data</a> as <span>input</span>,
3055+
* `HTMLScriptElement text` as <span>sink</span>,
3056+
* `script` as <span>sinkGroup</span>.
3057+
3058+
<p>If the algorithm threw an error, rethrow the error.
3059+
<li>Set <var>value</var>'s <a for=CharacterData>data</a> to <var>text</var>.
30533060
</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>
3061+
30723062
<li>If <var>value</var> is a {{TrustedScript}}, then:
30733063
<ol>
30743064
<li>Let <var>text</var> be <var>value</var>'s Data internal slot value.
@@ -3077,7 +3067,6 @@ standards that want to define APIs shared between <a for=/>documents</a> and
30773067
<li>Replace <var>value</var> with <var>newValue</var>.
30783068
</ol>
30793069
</ol>
3080-
<li><p>Let <var>node</var> be null.
30813070

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

0 commit comments

Comments
 (0)