Skip to content

Commit

Permalink
Editorial: clarify document argument of "clone a node"
Browse files Browse the repository at this point in the history
This argument is only passed recursively or from importNode(). And importNode() does not work for documents, so whenever the node argument is a document, the document argument has to be the node argument.
  • Loading branch information
annevk authored Dec 12, 2024
1 parent 7801c9d commit 5aeccfd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4550,9 +4550,12 @@ steps:
dom-Range-extractContents, dom-Range-cloneContents -->

<ol>
<li><p>If <var>document</var> is not given, let <var>document</var> be <var>node</var>'s
<li><p>If <var>document</var> is not given, then set <var>document</var> to <var>node</var>'s
<a for=Node>node document</a>.

<li><a for=/>Assert</a>: <var>node</var> is not a <a for=/>document</a> or <var>node</var> is
<var>document</var>.

<li>
<p>If <var>node</var> is an <a for=/>element</a>, then:

Expand Down Expand Up @@ -4606,9 +4609,10 @@ dom-Range-extractContents, dom-Range-cloneContents -->
<dd><p>Do nothing.
</dl>

<li><p>Set <var>copy</var>'s <a for=Node>node document</a> and <var>document</var> to
<var>copy</var>, if <var>copy</var> is a <a>document</a>, and set <var>copy</var>'s
<a for=Node>node document</a> to <var>document</var> otherwise.
<li><p>If <var>node</var> is a <a for=/>document</a>, then set <var>document</var> to
<var>copy</var>.

<li><p>Set <var>copy</var>'s <a for=Node>node document</a> to <var>document</var>.

<li><p>Run any <a>cloning steps</a> defined for <var>node</var> in
<a>other applicable specifications</a> and pass <var>copy</var>, <var>node</var>,
Expand Down

0 comments on commit 5aeccfd

Please sign in to comment.