Skip to content

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

<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
AtkinsSJ added a commit to AtkinsSJ/ladybird that referenced this pull request Jan 3, 2025
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.
tcl3 pushed a commit to LadybirdBrowser/ladybird that referenced this pull request Jan 4, 2025
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.
pbrw pushed a commit to pbrw/ladybird that referenced this pull request Jan 14, 2025
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.
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.

3 participants