dom: implement document.createTextNode

This commit is contained in:
Pierre Tachoire
2023-12-07 16:16:39 +01:00
parent 372429ba3d
commit 894b6182cf
2 changed files with 16 additions and 0 deletions

View File

@@ -1137,6 +1137,13 @@ pub inline fn documentCreateDocumentFragment(doc: *Document) !*DocumentFragment
return df.?;
}
pub inline fn documentCreateTextNode(doc: *Document, s: []const u8) !*Text {
var txt: ?*Text = undefined;
const err = documentVtable(doc).dom_document_create_text_node.?(doc, try strFromData(s), &txt);
try DOMErr(err);
return txt.?;
}
// DocumentHTML
pub const DocumentHTML = c.dom_html_document;