css: implement group, compound and start combined match

This commit is contained in:
Pierre Tachoire
2024-03-18 21:21:28 +01:00
parent d0dbbacd69
commit 75e80a47e6
4 changed files with 136 additions and 11 deletions

View File

@@ -20,6 +20,13 @@ pub const Node = struct {
return null;
}
pub fn parent(n: Node) !?Node {
const c = try parser.nodeParentNode(n.node);
if (c) |cc| return .{ .node = cc };
return null;
}
pub fn isElement(n: Node) bool {
const t = parser.nodeType(n.node) catch return false;
return t == .element;