@@ -974,8 +974,8 @@ object, an <a>event listener</a> is a broader concept as can be seen above.
974
974
which takes an <a>event</a> <var> event</var> , and returns an {{EventTarget}} object. Unless
975
975
specified otherwise it returns null.
976
976
977
- <p class=note> <a for=/>Nodes</a> , <a for=/>shadow roots</a> , and <a>documents</a>
978
- override the <a>get the parent</a> algorithm.
977
+ <p class=note> <a for=/>Nodes</a> , <a for=/>shadow roots</a> , and <a for=/ >documents</a> override the
978
+ <a>get the parent</a> algorithm.
979
979
980
980
<p> Each {{EventTarget}} object can have an associated
981
981
<dfn export for=EventTarget>activation behavior</dfn> algorithm. The
@@ -2220,7 +2220,7 @@ It is represented as follows:
2220
2220
2221
2221
<ul class=domTree>
2222
2222
<li>
2223
- <a>Document</a>
2223
+ <a for=/ >Document</a>
2224
2224
<ul>
2225
2225
<li class=t10> <a>Doctype</a> : <code> html</code>
2226
2226
<li class=t1> {{Element}} : <code> html</code> <span class=t2><code class="attribute name"> class</code> ="<code class="attribute value"> e</code> "</span>
@@ -4107,7 +4107,7 @@ interface Node : EventTarget {
4107
4107
[CEReactions] attribute DOMString? textContent;
4108
4108
[CEReactions] undefined normalize();
4109
4109
4110
- [CEReactions, NewObject] Node cloneNode(optional boolean deep = false);
4110
+ [CEReactions, NewObject] Node cloneNode(optional boolean subtree = false);
4111
4111
boolean isEqualNode(Node? otherNode);
4112
4112
boolean isSameNode(Node? otherNode); // legacy alias of ===
4113
4113
@@ -4304,7 +4304,7 @@ statement, switching on the interface <a>this</a> <a>implements</a>:
4304
4304
<dt><code><var> node</var> . {{Node/ownerDocument}} </code>
4305
4305
<dd>
4306
4306
Returns the <a for=Node>node document</a> .
4307
- Returns null for <a>documents</a> .
4307
+ Returns null for <a for=/ >documents</a> .
4308
4308
4309
4309
<dt><code><var> node</var> . {{Node/getRootNode()}} </code>
4310
4310
<dd> Returns <var> node</var> 's <a for=tree>root</a> .
@@ -4531,9 +4531,9 @@ each <a for=tree>descendant</a> <a>exclusive <code>Text</code> node</a> <var>nod
4531
4531
<hr>
4532
4532
4533
4533
<dl class=domintro>
4534
- <dt><code><var> node</var> . <a method for=Node lt=cloneNode()>cloneNode([<var>deep </var> = false])</a> </code>
4534
+ <dt><code><var> node</var> . <a method for=Node lt=cloneNode()>cloneNode([<var>subtree </var> = false])</a> </code>
4535
4535
<dd> Returns a copy of <var> node</var> . If
4536
- <var> deep </var> is true, the copy also includes the
4536
+ <var> subtree </var> is true, the copy also includes the
4537
4537
<var> node</var> 's <a for=tree>descendants</a> .
4538
4538
4539
4539
<dt><code><var> node</var> . {{Node/isEqualNode(otherNode)}} </code>
@@ -4543,33 +4543,83 @@ each <a for=tree>descendant</a> <a>exclusive <code>Text</code> node</a> <var>nod
4543
4543
4544
4544
<div class=impl>
4545
4545
4546
+ <div algorithm>
4546
4547
<a lt="Other applicable specifications">Specifications</a> may define
4547
4548
<dfn export id=concept-node-clone-ext>cloning steps</dfn> for all or some <a for=/>nodes</a> . The
4548
- algorithm is passed <var> copy </var> , <var> node </var> , <var> document </var> , and an optional
4549
- <i> clone children flag </i> , as indicated in the <a lt=" clone a node">clone </a> algorithm.
4549
+ algorithm is passed <var ignore> node </var> , <var ignore> copy </var> , and <var ignore> subtree </var> as
4550
+ indicated in the <a> clone a node</a> algorithm.
4550
4551
4551
- <p class=note> HTML defines <a>cloning steps</a> for <{script}> and <{input}>
4552
- elements . SVG ought to do the same for its <{script}> elements, but does not call this out
4553
- at the moment.
4552
+ <p class=note> HTML defines <a>cloning steps</a> for several elements, such as <{input}> , <{script}> ,
4553
+ and <{template}> . SVG ought to do the same for its <{script}> elements, but does not.
4554
+ </div>
4554
4555
4555
- <p> To <dfn export id=concept-node-clone lt="clone a node" local-lt="clone">clone</dfn> a
4556
- <var> node</var> , with an optional <var> document</var> and <i> clone children flag</i> , run these
4557
- steps:
4558
- <!-- This algorithm is used by dom-Node-cloneNode, dom-Document-importNode,
4559
- dom-Range-extractContents, dom-Range-cloneContents -->
4556
+ <div algorithm="clone a node">
4557
+ <p> To <dfn export id=concept-node-clone>clone a node</dfn> given a <a for=/>node</a> <var> node</var>
4558
+ and an optional <a for=/>document</a> <dfn export for="clone a node"><var>document</var></dfn>
4559
+ (default <var> node</var> 's <a for=Node>node document</a> ), boolean
4560
+ <dfn export for="clone a node"><var>subtree</var></dfn> (default false), and
4561
+ <a for=/>node</a> -or-null <dfn export for="clone a node"><var>parent</var></dfn> (default null):
4560
4562
4561
4563
<ol>
4562
- <li><p> If < var>document </var> is not given, then set <var > document</var> to <var> node</var> 's
4563
- <a for=Node>node document</a > .
4564
+ <li><p> <a for=/>Assert</a> : < var>node </var> is not a <a for=/ >document</a> or <var> node</var> is
4565
+ <var> document</var > .
4564
4566
4565
- <li> <a for=/>Assert</a> : <var> node </var> is not a <a for=/>document </a> or <var> node</var> is
4567
+ <li><p> Let <var> copy </var> be the result of <a>cloning a single node </a> given <var> node</var> and
4566
4568
<var> document</var> .
4567
4569
4570
+ <li><p> Run any <a>cloning steps</a> defined for <var> node</var> in
4571
+ <a>other applicable specifications</a> and pass <var> node</var> , <var> copy</var> , and
4572
+ <var> subtree</var> as parameters.
4573
+
4574
+ <li><p> If <var> parent</var> is non-null, then <a for=/>append</a> <var> copy</var> to
4575
+ <var> parent</var> .
4576
+
4577
+ <li><p> If <var> subtree</var> is true, then for each <var> child</var> of <var> node</var> 's
4578
+ <a for=tree>children</a> , in <a>tree order</a> : <a>clone a node</a> given <var> child</var> with
4579
+ <a for="clone a node"><i>document</i></a> set to <var> document</var> ,
4580
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> , and
4581
+ <a for="clone a node"><i>parent</i></a> set to <var> copy</var> .
4582
+
4583
+ <li>
4584
+ <p> If <var> node</var> is an <a for=/>element</a> , <var> node</var> is a
4585
+ <a for=Element>shadow host</a> , and <var> node</var> 's <a for=Element>shadow root</a>' s
4586
+ <a for=ShadowRoot>clonable</a> is true:
4587
+
4588
+ <ol>
4589
+ <li><p> <a for=/>Assert</a> : <var> copy</var> is not a <a for=Element>shadow host</a> .
4590
+
4591
+ <li><p> <a>Attach a shadow root</a> with <var> copy</var> , <var> node</var> 's
4592
+ <a for=Element>shadow root</a> 's <a for=ShadowRoot>mode</a>, true, <var>node</var>' s
4593
+ <a for=Element>shadow root</a> 's <a for=ShadowRoot>serializable</a>, <var>node</var>' s
4594
+ <a for=Element>shadow root</a> 's <a for=ShadowRoot>delegates focus</a>, and <var>node</var>' s
4595
+ <a for=Element>shadow root</a> 's <a for=ShadowRoot>slot assignment</a> .
4596
+
4597
+ <li><p> Set <var> copy</var> 's <a for=Element>shadow root</a>' s <a for=ShadowRoot>declarative</a>
4598
+ to <var> node</var> 's <a for=Element>shadow root</a>' s <a for=ShadowRoot>declarative</a> .
4599
+
4600
+ <li><p> For each <var> child</var> of <var> node</var> 's <a for=Element>shadow root</a>' s
4601
+ <a for=tree>children</a> , in <a>tree order</a> : <a>clone a node</a> given <var> child</var> with
4602
+ <a for="clone a node"><i>document</i></a> set to <var> document</var> ,
4603
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> , and
4604
+ <a for="clone a node"><i>parent</i></a> set to <var> copy</var> 's <a for=Element>shadow root</a> .
4605
+ </ol>
4606
+
4607
+ <li><p> Return <var> copy</var> .
4608
+ </ol>
4609
+ </div>
4610
+
4611
+ <div algorithm>
4612
+ <p> To <dfn>clone a single node</dfn> given a <a for=/>node</a> <var> node</var> and
4613
+ <a for=/>document</a> <var> document</var> :
4614
+
4615
+ <ol>
4616
+ <li><p> Let <var> copy</var> be null.
4617
+
4568
4618
<li>
4569
4619
<p> If <var> node</var> is an <a for=/>element</a> :
4570
4620
4571
4621
<ol>
4572
- <li><p> Let <var> copy</var> be the result of <a>creating an element</a> , given
4622
+ <li><p> Set <var> copy</var> to the result of <a>creating an element</a> , given
4573
4623
<var> document</var> , <var> node</var> 's <a for=Element>local name</a>, <var>node</var>' s
4574
4624
<a for=Element>namespace</a> , <var> node</var> 's <a for=Element>namespace prefix</a> , and
4575
4625
<var> node</var> 's <a><code>is</code> value</a> .
@@ -4579,16 +4629,15 @@ dom-Range-extractContents, dom-Range-cloneContents -->
4579
4629
<a for=Element>attribute list</a> :
4580
4630
4581
4631
<ol>
4582
- <li><p> Let <var> copyAttribute</var> be a <a>clone</a> of <var> attribute</var> .
4632
+ <li><p> Let <var> copyAttribute</var> be the result of <a>cloning a single node</a> given
4633
+ <var> attribute</var> and <var> document</var> .
4583
4634
4584
4635
<li><p> <a lt="append an attribute">Append</a> <var> copyAttribute</var> to <var> copy</var> .
4585
4636
</ol>
4586
- </li>
4587
4637
</ol>
4588
- </li>
4589
4638
4590
4639
<li>
4591
- <p> Otherwise, let <var> copy</var> be a <a for=/>node</a> that <a>implements</a> the same
4640
+ <p> Otherwise, set <var> copy</var> to a <a for=/>node</a> that <a>implements</a> the same
4592
4641
interfaces as <var> node</var> , and fulfills these additional requirements, switching on the
4593
4642
interface <var> node</var> <a>implements</a> :
4594
4643
@@ -4618,54 +4667,28 @@ dom-Range-extractContents, dom-Range-cloneContents -->
4618
4667
<dd><p> Do nothing.
4619
4668
</dl>
4620
4669
4670
+ <li><p> <a for=/>Assert</a> : <var> copy</var> is a <a for=/>node</a> .
4671
+
4621
4672
<li><p> If <var> node</var> is a <a for=/>document</a> , then set <var> document</var> to
4622
4673
<var> copy</var> .
4623
4674
4624
4675
<li><p> Set <var> copy</var> 's <a for=Node>node document</a> to <var> document</var> .
4625
4676
4626
- <li><p> Run any <a>cloning steps</a> defined for <var> node</var> in
4627
- <a>other applicable specifications</a> and pass <var> copy</var> , <var> node</var> ,
4628
- <var> document</var> , and the <i> clone children flag</i> if set, as parameters.
4629
-
4630
- <li><p> If the <i> clone children flag</i> is set, then for each <a for=tree>child</a>
4631
- <var> child</var> of <var> node</var> , in <a>tree order</a> : <a>append</a> the result of
4632
- <a lt="clone a node">cloning</a> <var> child</var> with <var> document</var> and the
4633
- <i> clone children flag</i> set, to <var> copy</var> .
4634
-
4635
- <li>
4636
- <p> If <var> node</var> is a <a for=Element>shadow host</a> whose <a for=/>shadow root</a> 's
4637
- <a for=ShadowRoot>clonable</a> is true:
4638
-
4639
- <ol>
4640
- <li><p> Assert: <var> copy</var> is not a <a for=Element>shadow host</a> .
4641
-
4642
- <li><p> Run <a>attach a shadow root</a> with <var> copy</var> , <var> node</var> 's
4643
- <a for=Element>shadow root</a> 's <a for=ShadowRoot>mode</a>, true, <var>node</var>' s
4644
- <a for=Element>shadow root</a> 's <a for=ShadowRoot>serializable</a>, <var>node</var>' s
4645
- <a for=Element>shadow root</a> 's <a for=ShadowRoot>delegates focus</a>, and <var>node</var>' s
4646
- <a for=Element>shadow root</a> 's <a for=ShadowRoot>slot assignment</a> .
4647
-
4648
- <li><p> Set <var> copy</var> 's <a for=Element>shadow root</a>' s <a for=ShadowRoot>declarative</a>
4649
- to <var> node</var> 's <a for=Element>shadow root</a>' s <a for=ShadowRoot>declarative</a> .
4650
-
4651
- <li><p> For each <a for=tree>child</a> <var> child</var> of <var> node</var> 's
4652
- <a for=Element>shadow root</a> , in <a>tree order</a> : <a>append</a> the result of
4653
- <a lt="clone a node">cloning</a> <var> child</var> with <var> document</var> and the
4654
- <i> clone children flag</i> set, to <var> copy</var> 's <a for=Element>shadow root</a> .
4655
- </ol>
4656
-
4657
4677
<li><p> Return <var> copy</var> .
4658
4678
</ol>
4679
+ </div>
4659
4680
4660
- <p> The <dfn method for=Node><code>cloneNode(<var>deep</var>)</code></dfn> method steps are:
4681
+ <div algorithm>
4682
+ <p> The <dfn method for=Node><code>cloneNode(<var>subtree</var>)</code></dfn> method steps are:
4661
4683
4662
4684
<ol>
4663
4685
<li><p> If <a>this</a> is a <a for=/>shadow root</a> , then <a>throw</a> a
4664
4686
"{{NotSupportedError!!exception}} " {{DOMException}} .
4665
4687
4666
- <li><p> Return a <a lt="clone a node">clone </a> of <a>this</a> , with the
4667
- <i> clone children flag < /i> set if <var> deep </var> is true .
4688
+ <li><p> Return the result of <a>cloning a node</a> given <a>this</a> with
4689
+ <a for=" clone a node"><i>subtree< /i></a> set to <var> subtree </var> .
4668
4690
</ol>
4691
+ </div>
4669
4692
4670
4693
<p> A <a for=/>node</a> <var> A</var> <dfn export for=Node id=concept-node-equals>equals</dfn> a
4671
4694
<a for=/>node</a> <var> B</var> if all of the following conditions are true:
@@ -5137,7 +5160,7 @@ interface Document : Node {
5137
5160
[NewObject] Comment createComment(DOMString data);
5138
5161
[NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
5139
5162
5140
- [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false);
5163
+ [CEReactions, NewObject] Node importNode(Node node, optional boolean subtree = false);
5141
5164
[CEReactions] Node adoptNode(Node node);
5142
5165
5143
5166
[NewObject] Attr createAttribute(DOMString localName);
@@ -5198,9 +5221,9 @@ is "<code>quirks</code>", and
5198
5221
<a for=Document>mode</a> is "<code> limited-quirks</code> ".
5199
5222
5200
5223
<div class=note>
5201
- <p> The <a for=Document>mode</a> is only ever changed from the default for <a>documents</a> created
5202
- by the <a>HTML parser</a> based on the presence, absence, or value of the DOCTYPE string, and by a
5203
- new <a for=/>browsing context</a> (initial "<code> about:blank</code> "). [[!HTML]]
5224
+ <p> The <a for=Document>mode</a> is only ever changed from the default for <a for=/ >documents</a>
5225
+ created by the <a>HTML parser</a> based on the presence, absence, or value of the DOCTYPE string,
5226
+ and by a new <a for=/>browsing context</a> (initial "<code> about:blank</code> "). [[!HTML]]
5204
5227
5205
5228
<p> <a>No-quirks mode</a> was originally known as "standards mode" and <a>limited-quirks mode</a>
5206
5229
was once known as "almost standards mode". They have been renamed because their details are now
@@ -5564,9 +5587,9 @@ method steps are:
5564
5587
<hr>
5565
5588
5566
5589
<dl class=domintro>
5567
- <dt><var> clone</var> = <var> document</var> . <a method for=Document lt=importNode()>importNode(<var>node</var> [, <var>deep </var> = false])</a>
5590
+ <dt><var> clone</var> = <var> document</var> . <a method for=Document lt=importNode()>importNode(<var>node</var> [, <var>subtree </var> = false])</a>
5568
5591
<dd>
5569
- <p> Returns a copy of <var> node</var> . If <var> deep </var> is true, the copy also includes the
5592
+ <p> Returns a copy of <var> node</var> . If <var> subtree </var> is true, the copy also includes the
5570
5593
<var> node</var> 's <a for=tree>descendants</a> .
5571
5594
5572
5595
<p> If <var> node</var> is a <a for=/>document</a> or a <a for=/>shadow root</a> , throws a
@@ -5583,16 +5606,19 @@ method steps are:
5583
5606
"{{HierarchyRequestError!!exception}} " {{DOMException}} .
5584
5607
</dl>
5585
5608
5586
- <p> The <dfn method for=Document><code>importNode(<var>node</var>, <var>deep</var>)</code></dfn>
5609
+ <div algorithm>
5610
+ <p> The <dfn method for=Document><code>importNode(<var>node</var>, <var>subtree</var>)</code></dfn>
5587
5611
method steps are:
5588
5612
5589
5613
<ol>
5590
5614
<li><p> If <var> node</var> is a <a for=/>document</a> or <a for=/>shadow root</a> , then <a>throw</a>
5591
5615
a "{{NotSupportedError!!exception}} " {{DOMException}} .
5592
5616
5593
- <li><p> Return a <a lt="clone a node">clone</a> of <var> node</var> , with <a>this</a> and the
5594
- <i> clone children flag</i> set if <var> deep</var> is true.
5617
+ <li><p> Return the result of <a>cloning a node</a> given <var> node</var> with
5618
+ <a for="clone a node"><i>document</i></a> set to <a>this</a> and
5619
+ <a for="clone a node"><i>subtree</i></a> set to <var> subtree</var> .
5595
5620
</ol>
5621
+ </div>
5596
5622
5597
5623
<p> <a lt="Other applicable specifications">Specifications</a> may define
5598
5624
<dfn export id=concept-node-adopt-ext>adopting steps</dfn> for all or some <a for=/>nodes</a> . The
@@ -10432,6 +10458,7 @@ Daniel Clark,
10432
10458
Daniel Glazman,
10433
10459
Darien Maillet Valentine<!-- bhathos; GitHub -->,
10434
10460
Darin Fisher,
10461
+ David Baron,
10435
10462
David Bruant,
10436
10463
David Flanagan,
10437
10464
David Håsäther,
0 commit comments