dom: implement document.importNode

This commit is contained in:
Pierre Tachoire
2023-12-07 17:26:08 +01:00
parent 9b9d927f38
commit 3ec5cee98c
2 changed files with 18 additions and 0 deletions

View File

@@ -1176,6 +1176,14 @@ pub inline fn documentCreateProcessingInstruction(doc: *Document, target: []cons
return pi.?;
}
pub inline fn documentImportNode(doc: *Document, node: *Node, deep: bool) !*Node {
var res: NodeExternal = undefined;
const nodeext = toNodeExternal(Node, node);
const err = documentVtable(doc).dom_document_import_node.?(doc, nodeext, deep, &res);
try DOMErr(err);
return @as(*Node, @ptrCast(res));
}
// DocumentHTML
pub const DocumentHTML = c.dom_html_document;