@@ -4536,32 +4536,23 @@ each <a for=tree>descendant</a> <a>exclusive <code>Text</code> node</a> <var>nod
4536
4536
<a lt="Other applicable specifications">Specifications</a> may define
4537
4537
<dfn export id=concept-node-clone-ext>cloning steps</dfn> for all or some <a for=/>nodes</a> . The
4538
4538
algorithm is passed <var ignore> node</var> , <var ignore> copy</var> , and <var ignore> subtree</var> as
4539
- indicated in the <a>clone a node and append </a> algorithm.
4539
+ indicated in the <a>clone a node</a> algorithm.
4540
4540
4541
4541
<p class=note> HTML defines <a>cloning steps</a> for several elements, such as <{input}> , <{script}> ,
4542
4542
and <{template}> . SVG ought to do the same for its <{script}> elements, but does not.
4543
4543
</div>
4544
4544
4545
4545
<div algorithm>
4546
- <p> To <dfn export id=concept-node-clone local-lt="clone">clone a node</dfn> given a
4547
- <a for=/>node</a> <var> node</var> and an optional <a for=/>document</a> <var> document</var> (default
4548
- <var> node</var> 's <a for=Node>node document</a> ) and boolean <var> subtree</var> (default false):
4546
+ <p> To <dfn export id=concept-node-clone>clone a node</dfn> given a <a for=/>node</a> <var> node</var>
4547
+ and an optional <a for=/>document</a> <dfn export for="clone a node"><var>document</var></dfn>
4548
+ (default <var> node</var> 's <a for=Node>node document</a> ), boolean
4549
+ <dfn export for="clone a node"><var>subtree</var></dfn> (default false), and
4550
+ <a for=/>node</a> -or-null <dfn export for="clone a node"><var>parent</var></dfn> (default null):
4549
4551
4550
4552
<ol>
4551
4553
<li><p> <a for=/>Assert</a> : <var> node</var> is not a <a for=/>document</a> or <var> node</var> is
4552
4554
<var> document</var> .
4553
4555
4554
- <li><p> Return the result of <a>cloning a node and append</a> given <var> node</var> , null,
4555
- <var> document</var> , and <var> subtree</var> .
4556
- </ol>
4557
- </div>
4558
-
4559
- <div algorithm>
4560
- <p> To <dfn export>clone a node and append</dfn> given a <a for=/>node</a> <var> node</var> , a
4561
- <a for=/>node</a> -or-null <var> parent</var> , a <a for=/>document</a> <var> document</var> , and a
4562
- boolean <var> subtree</var> :
4563
-
4564
- <ol>
4565
4556
<li><p> Let <var> copy</var> be the result of <a>cloning a single node</a> given <var> node</var> and
4566
4557
<var> document</var> .
4567
4558
@@ -4573,8 +4564,10 @@ boolean <var>subtree</var>:
4573
4564
<var> subtree</var> as parameters.
4574
4565
4575
4566
<li><p> If <var> subtree</var> is true, then for each <var> child</var> of <var> node</var> 's
4576
- <a for=tree>children</a> , in <a>tree order</a> : <a>clone a node and append</a> given
4577
- <var> child</var> , <var> copy</var> , <var> document</var> , and <var> subtree</var> .
4567
+ <a for=tree>children</a> , in <a>tree order</a> : <a>clone a node</a> given <var> child</var> with
4568
+ <a for="clone a node"><i>document</i></a> set to <var> document</var> ,
4569
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> , and
4570
+ <a for="clone a node"><i>parent</i></a> set to <var> copy</var> .
4578
4571
4579
4572
<li>
4580
4573
<p> If <var> node</var> is an <a for=/>element</a> , <a for=Element>shadow host</a> , and its
@@ -4593,9 +4586,10 @@ boolean <var>subtree</var>:
4593
4586
to <var> node</var> 's <a for=Element>shadow root</a>' s <a for=ShadowRoot>declarative</a> .
4594
4587
4595
4588
<li><p> For each <var> child</var> of <var> node</var> 's <a for=Element>shadow root</a>' s
4596
- <a for=tree>children</a> , in <a>tree order</a> : <a>clone a node and append</a> given
4597
- <var> child</var> , <var> copy</var> 's <a for=Element>shadow root</a> , <var> document</var> , and
4598
- <var> subtree</var> .
4589
+ <a for=tree>children</a> , in <a>tree order</a> : <a>clone a node</a> given <var> child</var> with
4590
+ <a for="clone a node"><i>document</i></a> set to <var> document</var> ,
4591
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> , and
4592
+ <a for="clone a node"><i>parent</i></a> set to <var> copy</var> 's <a for=Element>shadow root</a> .
4599
4593
</ol>
4600
4594
4601
4595
<li><p> Return <var> copy</var> .
@@ -4623,7 +4617,8 @@ boolean <var>subtree</var>:
4623
4617
<a for=Element>attribute list</a> :
4624
4618
4625
4619
<ol>
4626
- <li><p> Let <var> copyAttribute</var> be a <a>clone</a> of <var> attribute</var> .
4620
+ <li><p> Let <var> copyAttribute</var> be the result of <a>cloning a single node</a> given
4621
+ <var> attribute</var> .
4627
4622
4628
4623
<li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> .
4629
4624
</ol>
@@ -4678,8 +4673,8 @@ boolean <var>subtree</var>:
4678
4673
<li><p> If <a>this</a> is a <a for=/>shadow root</a> , then <a>throw</a> a
4679
4674
"{{NotSupportedError!!exception}} " {{DOMException}} .
4680
4675
4681
- <li><p> Return the result of <a>cloning a node</a> given <a>this</a> , <a>this</a> 's
4682
- <a for=Node>node document</a> , and <var> subtree</var> .
4676
+ <li><p> Return the result of <a>cloning a node</a> given <a>this</a> with
4677
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> .
4683
4678
</ol>
4684
4679
</div>
4685
4680
@@ -5606,8 +5601,9 @@ method steps are:
5606
5601
<li><p> If <var> node</var> is a <a>document</a> or <a for=/>shadow root</a> , then <a>throw</a> a
5607
5602
"{{NotSupportedError!!exception}} " {{DOMException}} .
5608
5603
5609
- <li><p> Return the result of <a>cloning a node</a> given <var> node</var> , <a>this</a> , and
5610
- <var> subtree</var> .
5604
+ <li><p> Return the result of <a>cloning a node</a> given <var> node</var> with
5605
+ <a for="clone a node"><i>document</i></a> set to <a>this</a> and
5606
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> .
5611
5607
</ol>
5612
5608
</div>
5613
5609
0 commit comments