mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 00:38:59 +00:00
node: add hasChildnodes method
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
@@ -150,6 +150,10 @@ pub const Node = struct {
|
||||
_ = self;
|
||||
@panic("Not implemented node.getRootNode()");
|
||||
}
|
||||
|
||||
pub fn _hasChildNodes(self: *parser.Node) bool {
|
||||
return parser.nodeHasChildNodes(self);
|
||||
}
|
||||
};
|
||||
|
||||
pub const Types = generate.Tuple(.{
|
||||
@@ -290,4 +294,10 @@ pub fn testExecFn(
|
||||
.{ .src = "text.contains(link)", .ex = "false" },
|
||||
};
|
||||
try checkCases(js_env, &node_contains);
|
||||
|
||||
var node_has_child_nodes = [_]Case{
|
||||
.{ .src = "link.hasChildNodes()", .ex = "true" },
|
||||
.{ .src = "text.hasChildNodes()", .ex = "false" },
|
||||
};
|
||||
try checkCases(js_env, &node_has_child_nodes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user