Skip to content

Commit 37d8475

Browse files
authored
Editorial: remove parent argument to remove
Helps with #801.
1 parent 1401218 commit 37d8475

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

dom.bs

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,8 +2563,7 @@ within a <var>parent</var>, run these steps:
25632563
<ol>
25642564
<li><p>Set <var>removedNodes</var> to « <var>child</var> ».
25652565

2566-
<li><p><a for=/>Remove</a> <var>child</var> from its <var>parent</var> with the
2567-
<i>suppress observers flag</i> set.
2566+
<li><p><a for=/>Remove</a> <var>child</var> with the <i>suppress observers flag</i> set.
25682567
</ol>
25692568

25702569
<p class="note no-backref">The above can only be false if <var>child</var> is <var>node</var>.
@@ -2621,7 +2620,7 @@ within a <var>parent</var>, run these steps:
26212620
<li><p>If <var>child</var>'s <a for=tree>parent</a> is not <var>parent</var>, then <a>throw</a> a
26222621
"{{NotFoundError!!exception}}" {{DOMException}}.
26232622

2624-
<li><p><a for=/>Remove</a> <var>child</var> from <var>parent</var>.
2623+
<li><p><a for=/>Remove</a> <var>child</var>.
26252624

26262625
<li><p>Return <var>child</var>.
26272626
<!-- Technically this is post-remove. -->
@@ -2633,10 +2632,14 @@ within a <var>parent</var>, run these steps:
26332632
algorithm is passed <var ignore>removedNode</var>, and optionally <var ignore>oldParent</var>, as
26342633
indicated in the <a for=/>remove</a> algorithm below.
26352634

2636-
<p>To <dfn export id=concept-node-remove>remove</dfn> a <var>node</var> from a <var>parent</var>,
2637-
with an optional <i>suppress observers flag</i>, run these steps:
2635+
<p>To <dfn export id=concept-node-remove>remove</dfn> a <var>node</var>, with an optional
2636+
<i>suppress observers flag</i>, run these steps:
26382637

26392638
<ol>
2639+
<li><p>Let <var>parent</var> be <var>node</var>'s <a for=tree>parent</a>
2640+
2641+
<li><p>Assert: <var>parent</var> is non-null.
2642+
26402643
<li><p>Let <var>index</var> be <var>node</var>'s <a for=tree>index</a>.
26412644

26422645
<li><p>For each <a>live range</a> whose <a for=range>start node</a> is an
@@ -3040,8 +3043,7 @@ steps:
30403043
<ol>
30413044
<li><p>If <a>context object</a>'s <a for=tree>parent</a> is null, then return.
30423045

3043-
<li><p><a for=/>Remove</a> the <a>context object</a> from <a>context object</a>'s
3044-
<a for=tree>parent</a>.
3046+
<li><p><a for=/>Remove</a> the <a>context object</a>.
30453047
</ol>
30463048

30473049

@@ -5256,20 +5258,19 @@ when invoked, must run these steps:
52565258
the <i>clone children flag</i> set if <var>deep</var> is true.
52575259
</ol>
52585260

5259-
<a lt="Other applicable specifications">Specifications</a> may define
5260-
<dfn export id=concept-node-adopt-ext>adopting steps</dfn> for all or some
5261-
<a for=/>nodes</a>. The algorithm is passed <var>node</var> and
5262-
<var>oldDocument</var>, as indicated in the
5263-
<a>adopt</a> algorithm.
5261+
<p><a lt="Other applicable specifications">Specifications</a> may define
5262+
<dfn export id=concept-node-adopt-ext>adopting steps</dfn> for all or some <a for=/>nodes</a>. The
5263+
algorithm is passed <var>node</var> and <var>oldDocument</var>, as indicated in the <a>adopt</a>
5264+
algorithm.
52645265

5265-
To <dfn export id=concept-node-adopt>adopt</dfn> a <var>node</var> into a <var>document</var>, run
5266+
<p>To <dfn export id=concept-node-adopt>adopt</dfn> a <var>node</var> into a <var>document</var>, run
52665267
these steps:
52675268

52685269
<ol>
52695270
<li><p>Let <var>oldDocument</var> be <var>node</var>'s <a for=Node>node document</a>.
52705271

5271-
<li><p>If <var>node</var>'s <a for=tree>parent</a> is not null, <a for=/>remove</a> <var>node</var>
5272-
from its <a for=tree>parent</a>.
5272+
<li><p>If <var>node</var>'s <a for=tree>parent</a> is non-null, then <a for=/>remove</a>
5273+
<var>node</var>.
52735274

52745275
<li>
52755276
<p>If <var>document</var> is not <var>oldDocument</var>, then:
@@ -7510,7 +7511,7 @@ Necessarily, a <a>live range</a> might itself be modified as part of the mutatio
75107511

75117512
<p class="note no-backref">See the <a for=/>insert</a> and <a for=/>remove</a> algorithms, the
75127513
{{Node/normalize()}} method, and the <a>replace data</a> and <a lt="split a Text node">split</a>
7513-
algorithms for the hairy details.
7514+
algorithms for details.
75147515

75157516
<p>Updating <a>live ranges</a> in response to <a>node tree</a> mutations can be expensive. For every
75167517
<a>node tree</a> change, all affected {{Range}} objects need to be updated. Even if the application
@@ -8167,10 +8168,8 @@ run these steps:
81678168
<a>length</a> minus
81688169
<var>original start offset</var>, data the empty string.
81698170

8170-
<li>For each <var>node</var> in <var>nodes to remove</var>,
8171-
in <a>tree order</a>,
8172-
<a for=/>remove</a> <var>node</var> from
8173-
its <a for=tree>parent</a>.
8171+
<li><p>For each <var>node</var> in <var>nodes to remove</var>, in <a>tree order</a>,
8172+
<a for=/>remove</a> <var>node</var>.
81748173

81758174
<li>If <var>original end node</var> is a {{Text}},
81768175
{{ProcessingInstruction}}, or {{Comment}}
@@ -8730,9 +8729,8 @@ the result of <a for="live range">cloning the contents</a> of the <a>context obj
87308729
<a for=tree>next sibling</a>.
87318730
<!-- Because we're about to remove node from its parent. -->
87328731

8733-
<li>If <var>node</var>'s <a for=tree>parent</a> is not
8734-
null, <a for=/>remove</a> <var>node</var> from its
8735-
<a for=tree>parent</a>.
8732+
<li><p>If <var>node</var>'s <a for=tree>parent</a> is non-null, then <a for=/>remove</a>
8733+
<var>node</var>.
87368734

87378735
<!-- Browsers disagree on how to handle the case where the range is
87388736
collapsed: do you increment the end offset so the node is now included, or

0 commit comments

Comments
 (0)