node: add replaceChild method

Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
Francis Bouvier
2023-09-27 11:13:53 +02:00
parent 08ded87e02
commit 2e3d1220f6
2 changed files with 17 additions and 0 deletions

View File

@@ -383,6 +383,12 @@ pub fn nodeRemoveChild(node: *Node, child: *Node) *Node {
return res.?;
}
pub fn nodeReplaceChild(node: *Node, new_child: *Node, old_child: *Node) *Node {
var res: ?*Node = undefined;
_ = nodeVtable(node).dom_node_replace_child.?(node, new_child, old_child, &res);
return res.?;
}
// CharacterData
pub const CharacterData = c.dom_characterdata;