Skip to content
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

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

annevk
Copy link
Member

@annevk annevk commented Dec 12, 2024

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.)

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.
@annevk annevk requested review from dbaron and domfarolino December 12, 2024 13:58
Copy link
Member

@dbaron dbaron left a 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
Copy link
Member

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)?

Copy link
Member Author

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).

Copy link
Member

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.

@annevk annevk merged commit 5aeccfd into main Dec 12, 2024
2 checks passed
@annevk annevk deleted the annevk/clone-a-node-document branch December 12, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants