DocumentHTML: cast directly document to node

This commit is contained in:
Pierre Tachoire
2024-01-09 14:11:45 +01:00
parent a25169c9e8
commit be1e55272a
2 changed files with 14 additions and 16 deletions

View File

@@ -1357,6 +1357,11 @@ pub inline fn documentCreateAttributeNS(doc: *Document, ns: []const u8, qname: [
// DocumentHTML
pub const DocumentHTML = c.dom_html_document;
// documentHTMLToNode is an helper to convert a documentHTML to an node.
pub inline fn documentHTMLToNode(doc: *DocumentHTML) *Node {
return @as(*Node, @ptrCast(doc));
}
fn documentHTMLVtable(doc_html: *DocumentHTML) c.dom_html_document_vtable {
return getVtable(c.dom_html_document_vtable, DocumentHTML, doc_html);
}