Skip to main content

remove_child

Function remove_child 

Source
pub fn remove_child(
    doc: &mut BaseDocument,
    parent: NodeId,
    child: NodeId,
) -> Result<NodeId>
Expand description

parent.removeChild(child), returning the child.

Copied behaviour worth knowing: parent is not checked. Upstream removes the child from wherever it actually is rather than raising the DOM’s NotFoundError, and the node is detached rather than dropped so that wrappers stay valid.