Skip to content

ownerDocument not updated when appendChild moves nodes between documents #932

Description

@shunkica

Describe the bug
The ownerDocument property is not updated when appendChild() moves an element from one document to another.

To Reproduce
https://stackblitz.com/edit/js-xmldom-template-ma7jzuzj?file=index.js

Expected behavior
The ownerDocument must be updated to the new document (including the ownerDocument of all the children)

Runtime & Version:
xmldom version: 0.8.x 0.9.x
runtime version: node v20
other related software and version:

Additional context
This also applies to insertBefore, replaceChild, and the functions on DocumentFragment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions