dom: implement document.adoptNode

This commit is contained in:
Pierre Tachoire
2023-12-07 17:31:04 +01:00
parent 3ec5cee98c
commit 82148da5f6
2 changed files with 18 additions and 0 deletions

View File

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