-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editorial: clarify document argument of "clone a node" #1332
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine except for one thing (below).
@@ -4608,9 +4611,7 @@ 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't this text needed to make a cloned document have the right node document (itself, not the document it was cloned from)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's indeed what it was for. Should be good now (and hopefully clearer too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, agree the new version is clearer.
Main difference is that a chunk of the "clone a node" steps are pulled out into a "clone a single node" algorithm. Reflects these spec PRs: whatwg/dom#1332 whatwg/dom#1334 Though this code is quite old so there may also be older spec changes included here.
Main difference is that a chunk of the "clone a node" steps are pulled out into a "clone a single node" algorithm. Reflects these spec PRs: whatwg/dom#1332 whatwg/dom#1334 Though this code is quite old so there may also be older spec changes included here.
Main difference is that a chunk of the "clone a node" steps are pulled out into a "clone a single node" algorithm. Reflects these spec PRs: whatwg/dom#1332 whatwg/dom#1334 Though this code is quite old so there may also be older spec changes included here.
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.
(I want to fix the other aspects of this algorithm too. But I thought I'd make this in isolation while I spotted it.)