@@ -972,8 +972,8 @@ object, an <a>event listener</a> is a broader concept as can be seen above.
972
972
which takes an <a>event</a> <var> event</var> , and returns an {{EventTarget}} object. Unless
973
973
specified otherwise it returns null.
974
974
975
- <p class=note> <a for=/>Nodes</a> , <a for=/>shadow roots</a> , and <a>documents</a>
976
- override the <a>get the parent</a> algorithm.
975
+ <p class=note> <a for=/>Nodes</a> , <a for=/>shadow roots</a> , and <a for=/ >documents</a> override the
976
+ <a>get the parent</a> algorithm.
977
977
978
978
<p> Each {{EventTarget}} object can have an associated
979
979
<dfn export for=EventTarget>activation behavior</dfn> algorithm. The
@@ -2218,7 +2218,7 @@ It is represented as follows:
2218
2218
2219
2219
<ul class=domTree>
2220
2220
<li>
2221
- <a>Document</a>
2221
+ <a for=/ >Document</a>
2222
2222
<ul>
2223
2223
<li class=t10> <a>Doctype</a> : <code> html</code>
2224
2224
<li class=t1> {{Element}} : <code> html</code> <span class=t2><code class="attribute name"> class</code> ="<code class="attribute value"> e</code> "</span>
@@ -4097,7 +4097,7 @@ interface Node : EventTarget {
4097
4097
[CEReactions] attribute DOMString? textContent;
4098
4098
[CEReactions] undefined normalize();
4099
4099
4100
- [CEReactions, NewObject] Node cloneNode(optional boolean deep = false);
4100
+ [CEReactions, NewObject] Node cloneNode(optional boolean subtree = false);
4101
4101
boolean isEqualNode(Node? otherNode);
4102
4102
boolean isSameNode(Node? otherNode); // legacy alias of ===
4103
4103
@@ -4294,7 +4294,7 @@ statement, switching on the interface <a>this</a> <a>implements</a>:
4294
4294
<dt><code><var> node</var> . {{Node/ownerDocument}} </code>
4295
4295
<dd>
4296
4296
Returns the <a for=Node>node document</a> .
4297
- Returns null for <a>documents</a> .
4297
+ Returns null for <a for=/ >documents</a> .
4298
4298
4299
4299
<dt><code><var> node</var> . {{Node/getRootNode()}} </code>
4300
4300
<dd> Returns <var> node</var> 's <a for=tree>root</a> .
@@ -4521,9 +4521,9 @@ each <a for=tree>descendant</a> <a>exclusive <code>Text</code> node</a> <var>nod
4521
4521
<hr>
4522
4522
4523
4523
<dl class=domintro>
4524
- <dt><code><var> node</var> . <a method for=Node lt=cloneNode()>cloneNode([<var>deep </var> = false])</a> </code>
4524
+ <dt><code><var> node</var> . <a method for=Node lt=cloneNode()>cloneNode([<var>subtree </var> = false])</a> </code>
4525
4525
<dd> Returns a copy of <var> node</var> . If
4526
- <var> deep </var> is true, the copy also includes the
4526
+ <var> subtree </var> is true, the copy also includes the
4527
4527
<var> node</var> 's <a for=tree>descendants</a> .
4528
4528
4529
4529
<dt><code><var> node</var> . {{Node/isEqualNode(otherNode)}} </code>
@@ -4533,33 +4533,83 @@ each <a for=tree>descendant</a> <a>exclusive <code>Text</code> node</a> <var>nod
4533
4533
4534
4534
<div class=impl>
4535
4535
4536
+ <div algorithm>
4536
4537
<a lt="Other applicable specifications">Specifications</a> may define
4537
4538
<dfn export id=concept-node-clone-ext>cloning steps</dfn> for all or some <a for=/>nodes</a> . The
4538
- algorithm is passed <var> copy </var> , <var> node </var> , <var> document </var> , and an optional
4539
- <i> clone children flag </i> , as indicated in the <a lt=" clone a node">clone </a> algorithm.
4539
+ algorithm is passed <var ignore> node </var> , <var ignore> copy </var> , and <var ignore> subtree </var> as
4540
+ indicated in the <a> clone a node</a> algorithm.
4540
4541
4541
- <p class=note> HTML defines <a>cloning steps</a> for <{script}> and <{input}>
4542
- elements . SVG ought to do the same for its <{script}> elements, but does not call this out
4543
- at the moment.
4542
+ <p class=note> HTML defines <a>cloning steps</a> for several elements, such as <{input}> , <{script}> ,
4543
+ and <{template}> . SVG ought to do the same for its <{script}> elements, but does not.
4544
+ </div>
4544
4545
4545
- <p> To <dfn export id=concept-node-clone lt="clone a node" local-lt="clone">clone</dfn> a
4546
- <var> node</var> , with an optional <var> document</var> and <i> clone children flag</i> , run these
4547
- steps:
4548
- <!-- This algorithm is used by dom-Node-cloneNode, dom-Document-importNode,
4549
- dom-Range-extractContents, dom-Range-cloneContents -->
4546
+ <div algorithm="clone a node">
4547
+ <p> To <dfn export id=concept-node-clone>clone a node</dfn> given a <a for=/>node</a> <var> node</var>
4548
+ and an optional <a for=/>document</a> <dfn export for="clone a node"><var>document</var></dfn>
4549
+ (default <var> node</var> 's <a for=Node>node document</a> ), boolean
4550
+ <dfn export for="clone a node"><var>subtree</var></dfn> (default false), and
4551
+ <a for=/>node</a> -or-null <dfn export for="clone a node"><var>parent</var></dfn> (default null):
4550
4552
4551
4553
<ol>
4552
- <li><p> If < var>document </var> is not given, then set <var > document</var> to <var> node</var> 's
4553
- <a for=Node>node document</a > .
4554
+ <li><p> <a for=/>Assert</a> : < var>node </var> is not a <a for=/ >document</a> or <var> node</var> is
4555
+ <var> document</var > .
4554
4556
4555
- <li> <a for=/>Assert</a> : <var> node </var> is not a <a for=/>document </a> or <var> node</var> is
4557
+ <li><p> Let <var> copy </var> be the result of <a>cloning a single node </a> given <var> node</var> and
4556
4558
<var> document</var> .
4557
4559
4560
+ <li><p> Run any <a>cloning steps</a> defined for <var> node</var> in
4561
+ <a>other applicable specifications</a> and pass <var> node</var> , <var> copy</var> , and
4562
+ <var> subtree</var> as parameters.
4563
+
4564
+ <li><p> If <var> parent</var> is non-null, then <a for=/>append</a> <var> copy</var> to
4565
+ <var> parent</var> .
4566
+
4567
+ <li><p> If <var> subtree</var> is true, then for each <var> child</var> of <var> node</var> 's
4568
+ <a for=tree>children</a> , in <a>tree order</a> : <a>clone a node</a> given <var> child</var> with
4569
+ <a for="clone a node"><i>document</i></a> set to <var> document</var> ,
4570
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> , and
4571
+ <a for="clone a node"><i>parent</i></a> set to <var> copy</var> .
4572
+
4573
+ <li>
4574
+ <p> If <var> node</var> is an <a for=/>element</a> , <var> node</var> is a
4575
+ <a for=Element>shadow host</a> , and <var> node</var> 's <a for=Element>shadow root</a>' s
4576
+ <a for=ShadowRoot>clonable</a> is true:
4577
+
4578
+ <ol>
4579
+ <li><p> <a for=/>Assert</a> : <var> copy</var> is not a <a for=Element>shadow host</a> .
4580
+
4581
+ <li><p> <a>Attach a shadow root</a> with <var> copy</var> , <var> node</var> 's
4582
+ <a for=Element>shadow root</a> 's <a for=ShadowRoot>mode</a>, true, <var>node</var>' s
4583
+ <a for=Element>shadow root</a> 's <a for=ShadowRoot>serializable</a>, <var>node</var>' s
4584
+ <a for=Element>shadow root</a> 's <a for=ShadowRoot>delegates focus</a>, and <var>node</var>' s
4585
+ <a for=Element>shadow root</a> 's <a for=ShadowRoot>slot assignment</a> .
4586
+
4587
+ <li><p> Set <var> copy</var> 's <a for=Element>shadow root</a>' s <a for=ShadowRoot>declarative</a>
4588
+ to <var> node</var> 's <a for=Element>shadow root</a>' s <a for=ShadowRoot>declarative</a> .
4589
+
4590
+ <li><p> For each <var> child</var> of <var> node</var> 's <a for=Element>shadow root</a>' s
4591
+ <a for=tree>children</a> , in <a>tree order</a> : <a>clone a node</a> given <var> child</var> with
4592
+ <a for="clone a node"><i>document</i></a> set to <var> document</var> ,
4593
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> , and
4594
+ <a for="clone a node"><i>parent</i></a> set to <var> copy</var> 's <a for=Element>shadow root</a> .
4595
+ </ol>
4596
+
4597
+ <li><p> Return <var> copy</var> .
4598
+ </ol>
4599
+ </div>
4600
+
4601
+ <div algorithm>
4602
+ <p> To <dfn>clone a single node</dfn> given a <a for=/>node</a> <var> node</var> and
4603
+ <a for=/>document</a> <var> document</var> :
4604
+
4605
+ <ol>
4606
+ <li><p> Let <var> copy</var> be null.
4607
+
4558
4608
<li>
4559
4609
<p> If <var> node</var> is an <a for=/>element</a> :
4560
4610
4561
4611
<ol>
4562
- <li><p> Let <var> copy</var> be the result of <a>creating an element</a> , given
4612
+ <li><p> Set <var> copy</var> to the result of <a>creating an element</a> , given
4563
4613
<var> document</var> , <var> node</var> 's <a for=Element>local name</a>, <var>node</var>' s
4564
4614
<a for=Element>namespace</a> , <var> node</var> 's <a for=Element>namespace prefix</a> , and
4565
4615
<var> node</var> 's <a><code>is</code> value</a> .
@@ -4569,16 +4619,15 @@ dom-Range-extractContents, dom-Range-cloneContents -->
4569
4619
<a for=Element>attribute list</a> :
4570
4620
4571
4621
<ol>
4572
- <li><p> Let <var> copyAttribute</var> be a <a>clone</a> of <var> attribute</var> .
4622
+ <li><p> Let <var> copyAttribute</var> be the result of <a>cloning a single node</a> given
4623
+ <var> attribute</var> and <var> document</var> .
4573
4624
4574
4625
<li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> .
4575
4626
</ol>
4576
- </li>
4577
4627
</ol>
4578
- </li>
4579
4628
4580
4629
<li>
4581
- <p> Otherwise, let <var> copy</var> be a <a for=/>node</a> that <a>implements</a> the same
4630
+ <p> Otherwise, set <var> copy</var> to a <a for=/>node</a> that <a>implements</a> the same
4582
4631
interfaces as <var> node</var> , and fulfills these additional requirements, switching on the
4583
4632
interface <var> node</var> <a>implements</a> :
4584
4633
@@ -4608,54 +4657,28 @@ dom-Range-extractContents, dom-Range-cloneContents -->
4608
4657
<dd><p> Do nothing.
4609
4658
</dl>
4610
4659
4660
+ <li><p> <a for=/>Assert</a> : <var> copy</var> is a <a for=/>node</a> .
4661
+
4611
4662
<li><p> If <var> node</var> is a <a for=/>document</a> , then set <var> document</var> to
4612
4663
<var> copy</var> .
4613
4664
4614
4665
<li><p> Set <var> copy</var> 's <a for=Node>node document</a> to <var> document</var> .
4615
4666
4616
- <li><p> Run any <a>cloning steps</a> defined for <var> node</var> in
4617
- <a>other applicable specifications</a> and pass <var> copy</var> , <var> node</var> ,
4618
- <var> document</var> , and the <i> clone children flag</i> if set, as parameters.
4619
-
4620
- <li><p> If the <i> clone children flag</i> is set, then for each <a for=tree>child</a>
4621
- <var> child</var> of <var> node</var> , in <a>tree order</a> : <a>append</a> the result of
4622
- <a lt="clone a node">cloning</a> <var> child</var> with <var> document</var> and the
4623
- <i> clone children flag</i> set, to <var> copy</var> .
4624
-
4625
- <li>
4626
- <p> If <var> node</var> is a <a for=Element>shadow host</a> whose <a for=/>shadow root</a> 's
4627
- <a for=ShadowRoot>clonable</a> is true:
4628
-
4629
- <ol>
4630
- <li><p> Assert: <var> copy</var> is not a <a for=Element>shadow host</a> .
4631
-
4632
- <li><p> Run <a>attach a shadow root</a> with <var> copy</var> , <var> node</var> 's
4633
- <a for=Element>shadow root</a> 's <a for=ShadowRoot>mode</a>, true, <var>node</var>' s
4634
- <a for=Element>shadow root</a> 's <a for=ShadowRoot>serializable</a>, <var>node</var>' s
4635
- <a for=Element>shadow root</a> 's <a for=ShadowRoot>delegates focus</a>, and <var>node</var>' s
4636
- <a for=Element>shadow root</a> 's <a for=ShadowRoot>slot assignment</a> .
4637
-
4638
- <li><p> Set <var> copy</var> 's <a for=Element>shadow root</a>' s <a for=ShadowRoot>declarative</a>
4639
- to <var> node</var> 's <a for=Element>shadow root</a>' s <a for=ShadowRoot>declarative</a> .
4640
-
4641
- <li><p> For each <a for=tree>child</a> <var> child</var> of <var> node</var> 's
4642
- <a for=Element>shadow root</a> , in <a>tree order</a> : <a>append</a> the result of
4643
- <a lt="clone a node">cloning</a> <var> child</var> with <var> document</var> and the
4644
- <i> clone children flag</i> set, to <var> copy</var> 's <a for=Element>shadow root</a> .
4645
- </ol>
4646
-
4647
4667
<li><p> Return <var> copy</var> .
4648
4668
</ol>
4669
+ </div>
4649
4670
4650
- <p> The <dfn method for=Node><code>cloneNode(<var>deep</var>)</code></dfn> method steps are:
4671
+ <div algorithm>
4672
+ <p> The <dfn method for=Node><code>cloneNode(<var>subtree</var>)</code></dfn> method steps are:
4651
4673
4652
4674
<ol>
4653
4675
<li><p> If <a>this</a> is a <a for=/>shadow root</a> , then <a>throw</a> a
4654
4676
"{{NotSupportedError!!exception}} " {{DOMException}} .
4655
4677
4656
- <li><p> Return a <a lt="clone a node">clone </a> of <a>this</a> , with the
4657
- <i> clone children flag < /i> set if <var> deep </var> is true .
4678
+ <li><p> Return the result of <a>cloning a node</a> given <a>this</a> with
4679
+ <a for=" clone a node"><i>subtree< /i></a> set to <var> subtree </var> .
4658
4680
</ol>
4681
+ </div>
4659
4682
4660
4683
<p> A <a for=/>node</a> <var> A</var> <dfn export for=Node id=concept-node-equals>equals</dfn> a
4661
4684
<a for=/>node</a> <var> B</var> if all of the following conditions are true:
@@ -5127,7 +5150,7 @@ interface Document : Node {
5127
5150
[NewObject] Comment createComment(DOMString data);
5128
5151
[NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
5129
5152
5130
- [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false);
5153
+ [CEReactions, NewObject] Node importNode(Node node, optional boolean subtree = false);
5131
5154
[CEReactions] Node adoptNode(Node node);
5132
5155
5133
5156
[NewObject] Attr createAttribute(DOMString localName);
@@ -5188,9 +5211,9 @@ is "<code>quirks</code>", and
5188
5211
<a for=Document>mode</a> is "<code> limited-quirks</code> ".
5189
5212
5190
5213
<div class=note>
5191
- <p> The <a for=Document>mode</a> is only ever changed from the default for <a>documents</a> created
5192
- by the <a>HTML parser</a> based on the presence, absence, or value of the DOCTYPE string, and by a
5193
- new <a for=/>browsing context</a> (initial "<code> about:blank</code> "). [[!HTML]]
5214
+ <p> The <a for=Document>mode</a> is only ever changed from the default for <a for=/ >documents</a>
5215
+ created by the <a>HTML parser</a> based on the presence, absence, or value of the DOCTYPE string,
5216
+ and by a new <a for=/>browsing context</a> (initial "<code> about:blank</code> "). [[!HTML]]
5194
5217
5195
5218
<p> <a>No-quirks mode</a> was originally known as "standards mode" and <a>limited-quirks mode</a>
5196
5219
was once known as "almost standards mode". They have been renamed because their details are now
@@ -5554,9 +5577,9 @@ method steps are:
5554
5577
<hr>
5555
5578
5556
5579
<dl class=domintro>
5557
- <dt><var> clone</var> = <var> document</var> . <a method for=Document lt=importNode()>importNode(<var>node</var> [, <var>deep </var> = false])</a>
5580
+ <dt><var> clone</var> = <var> document</var> . <a method for=Document lt=importNode()>importNode(<var>node</var> [, <var>subtree </var> = false])</a>
5558
5581
<dd>
5559
- <p> Returns a copy of <var> node</var> . If <var> deep </var> is true, the copy also includes the
5582
+ <p> Returns a copy of <var> node</var> . If <var> subtree </var> is true, the copy also includes the
5560
5583
<var> node</var> 's <a for=tree>descendants</a> .
5561
5584
5562
5585
<p> If <var> node</var> is a <a for=/>document</a> or a <a for=/>shadow root</a> , throws a
@@ -5573,16 +5596,19 @@ method steps are:
5573
5596
"{{HierarchyRequestError!!exception}} " {{DOMException}} .
5574
5597
</dl>
5575
5598
5576
- <p> The <dfn method for=Document><code>importNode(<var>node</var>, <var>deep</var>)</code></dfn>
5599
+ <div algorithm>
5600
+ <p> The <dfn method for=Document><code>importNode(<var>node</var>, <var>subtree</var>)</code></dfn>
5577
5601
method steps are:
5578
5602
5579
5603
<ol>
5580
5604
<li><p> If <var> node</var> is a <a for=/>document</a> or <a for=/>shadow root</a> , then <a>throw</a>
5581
5605
a "{{NotSupportedError!!exception}} " {{DOMException}} .
5582
5606
5583
- <li><p> Return a <a lt="clone a node">clone</a> of <var> node</var> , with <a>this</a> and the
5584
- <i> clone children flag</i> set if <var> deep</var> is true.
5607
+ <li><p> Return the result of <a>cloning a node</a> given <var> node</var> with
5608
+ <a for="clone a node"><i>document</i></a> set to <a>this</a> and
5609
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> .
5585
5610
</ol>
5611
+ </div>
5586
5612
5587
5613
<p> <a lt="Other applicable specifications">Specifications</a> may define
5588
5614
<dfn export id=concept-node-adopt-ext>adopting steps</dfn> for all or some <a for=/>nodes</a> . The
@@ -10402,6 +10428,7 @@ Daniel Clark,
10402
10428
Daniel Glazman,
10403
10429
Darien Maillet Valentine<!-- bhathos; GitHub -->,
10404
10430
Darin Fisher,
10431
+ David Baron,
10405
10432
David Bruant,
10406
10433
David Flanagan,
10407
10434
David Håsäther,
0 commit comments