@@ -2389,16 +2389,13 @@ of a <var>node</var> into a <var>parent</var> before a <var>child</var>, run the
2389
2389
2390
2390
<p> <a lt="Other applicable specifications">Specifications</a> may define
2391
2391
<dfn export id=concept-node-insert-ext>insertion steps</dfn> for all or some <a for=/>nodes</a> . The
2392
- algorithm is passed <var ignore> insertedNode</var> , as indicated in the <a for=/>insert</a>
2393
- algorithm below.
2394
- <!-- See https://github.com/whatwg/dom/issues/34#issuecomment-125571750 for why we might need to
2395
- adjust this further based on the requirements of the script element. There might be other ways
2396
- to define that though as Olli suggests, so leaving that out for now. -->
2392
+ algorithm is passed <var ignore> insertedNode</var> and <var ignore> deferredStepsQueue</var> , as
2393
+ indicated in the <a for=/>insert</a> algorithm below.
2397
2394
2398
2395
<p> <a lt="other applicable specifications">Specifications</a> may define
2399
2396
<dfn export id=concept-node-children-changed-ext>children changed steps</dfn> for all or some
2400
- <a for=/>nodes</a> . The algorithm is passed no argument and is called from <a for=/>insert</a> ,
2401
- <a for=/>remove</a> , and <a for=/>replace data</a> .
2397
+ <a for=/>nodes</a> . The algorithm is passed <var ignore> deferredStepsQueue </var> and is called from
2398
+ <a for=/>insert</a> , <a for=/> remove</a> , and <a for=/>replace data</a> .
2402
2399
2403
2400
<p> To <dfn export id=concept-node-insert>insert</dfn> a <var> node</var> into a <var> parent</var>
2404
2401
before a <var> child</var> , with an optional <i> suppress observers flag</i> , run these steps:
@@ -2437,8 +2434,10 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
2437
2434
<li><p> Let <var> previousSibling</var> be <var> child</var> 's <a>previous sibling</a> or
2438
2435
<var> parent</var> 's <a>last child</a> if <var> child</var> is null.
2439
2436
2437
+ <li><p> Let <var> deferredStepsQueue</var> be an empty <a>queue</a> .
2438
+
2440
2439
<li>
2441
- <p> For each <var> node</var> in <var> nodes</var> , in <a>tree order</a > :
2440
+ <p> <a for=list> For each</a> <var> node</var> in <var> nodes</var> :
2442
2441
2443
2442
<ol>
2444
2443
<li><p> If <var> child</var> is null, then <a for=set>append</a> <var> node</var> to
@@ -2461,7 +2460,8 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
2461
2460
<var> node</var> , in <a>shadow-including tree order</a> :
2462
2461
2463
2462
<ol>
2464
- <li><p> Run the <a>insertion steps</a> with <var> inclusiveDescendant</var> .
2463
+ <li><p> Run the <a>insertion steps</a> with <var> inclusiveDescendant</var> and
2464
+ <var> deferredStepsQueue</var> .
2465
2465
2466
2466
<li>
2467
2467
<p> If <var> inclusiveDescendant</var> is <a>connected</a> , then:
@@ -2487,7 +2487,11 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
2487
2487
<li><p> If <i> suppress observers flag</i> is unset, then <a>queue a tree mutation record</a> for
2488
2488
<var> parent</var> with <var> nodes</var> , « », <var> previousSibling</var> , and <var> child</var> .
2489
2489
2490
- <li><p> Run the <a>children changed steps</a> for <var> parent</var> .
2490
+ <li><p> Run the <a>children changed steps</a> for <var> parent</var> with
2491
+ <var> deferredStepsQueue</var> .
2492
+
2493
+ <li><p> While <var> deferredStepsQueue</var> <a for=list>is not empty</a> , run the result of
2494
+ <a>dequeueing</a> <var> deferredStepsQueue</var> .
2491
2495
</ol>
2492
2496
2493
2497
0 commit comments