dom: add element.replaceChildren

This commit is contained in:
Pierre Tachoire
2023-12-13 15:51:48 +01:00
parent 3af716d934
commit 84aad08806
2 changed files with 34 additions and 0 deletions

View File

@@ -620,6 +620,13 @@ pub fn nodeSetTextContent(node: *Node, value: []const u8) !void {
try DOMErr(err);
}
pub fn nodeGetChildNodes(node: *Node) !*NodeList {
var nlist: ?*NodeList = undefined;
const err = nodeVtable(node).dom_node_get_child_nodes.?(node, &nlist);
try DOMErr(err);
return nlist.?;
}
pub fn nodeAppendChild(node: *Node, child: *Node) !*Node {
var res: ?*Node = undefined;
const err = nodeVtable(node).dom_node_append_child.?(node, child, &res);