@@ -2404,8 +2404,26 @@ algorithm below.
2404
2404
before a <var> child</var> , with an optional <i> suppress observers flag</i> , run these steps:
2405
2405
2406
2406
<ol>
2407
- <li><p> Let <var> count</var> be the number of <a>children</a> of <var> node</var> if it is a
2408
- {{DocumentFragment}} <a>node</a> , and one otherwise.
2407
+ <li><p> Let <var> nodes</var> be <var> node</var> 's <a>children</a> , if <var> node</var> is a
2408
+ {{DocumentFragment}} <a>node</a> ; otherwise « <var> node</var> ».
2409
+
2410
+ <li><p> Let <var> count</var> be <var> nodes</var> 's <a for=set>size</a> .
2411
+
2412
+ <li><p> If <var> count</var> is 0, then return.
2413
+
2414
+ <li>
2415
+ <p> If <var> node</var> is a {{DocumentFragment}} <a>node</a> , then:
2416
+
2417
+ <ol>
2418
+ <li><p> <a for=/>Remove</a> its <a>children</a> with the <i> suppress observers flag</i> set.
2419
+
2420
+ <li>
2421
+ <p> <a>queue a tree mutation record</a> for <var> node</var> with « », <var> nodes</var> , null, and
2422
+ null.
2423
+
2424
+ <p class="note no-backref"> This step intentionally does not pay attention to the
2425
+ <i> suppress observers flag</i> .
2426
+ </ol>
2409
2427
2410
2428
<li>
2411
2429
<p> If <var> child</var> is non-null, then:
@@ -2420,20 +2438,6 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
2420
2438
its <a for=range>end offset</a> by <var> count</var> .
2421
2439
</ol>
2422
2440
2423
- <li><p> Let <var> nodes</var> be <var> node</var> 's <a>children</a> , if <var> node</var> is a
2424
- {{DocumentFragment}} <a>node</a> ; otherwise « <var> node</var> ».
2425
-
2426
- <li><p> If <var> node</var> is a {{DocumentFragment}} <a>node</a> , then <a for=/>remove</a> its
2427
- <a>children</a> with the <i> suppress observers flag</i> set.
2428
-
2429
- <li>
2430
- <p> If <var> node</var> is a {{DocumentFragment}} <a for=/>node</a> , then
2431
- <a>queue a tree mutation record</a> for <var> node</var> with « », <var> nodes</var> , null, and
2432
- null.
2433
-
2434
- <p class="note no-backref"> This step intentionally does not pay attention to the
2435
- <i> suppress observers flag</i> .
2436
-
2437
2441
<li><p> Let <var> previousSibling</var> be <var> child</var> 's <a>previous sibling</a> or
2438
2442
<var> parent</var> 's <a>last child</a> if <var> child</var> is null.
2439
2443
0 commit comments