dom: add element.HasAttributes

This commit is contained in:
Pierre Tachoire
2023-12-01 16:51:58 +01:00
parent acf737152c
commit dcb095d9df
2 changed files with 12 additions and 0 deletions

View File

@@ -630,6 +630,13 @@ pub fn nodeReplaceChild(node: *Node, new_child: *Node, old_child: *Node) !*Node
return res.?;
}
pub fn nodeHasAttributes(node: *Node) !bool {
var res: bool = undefined;
const err = nodeVtable(node).dom_node_has_attributes.?(node, &res);
try DOMErr(err);
return res;
}
// nodeToElement is an helper to convert a node to an element.
pub inline fn nodeToElement(node: *Node) *Element {
return @as(*Element, @ptrCast(node));