mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 08:48:58 +00:00
css: matcher draft
This commit is contained in:
@@ -165,6 +165,13 @@ pub const Selector = union(enum) {
|
||||
},
|
||||
pseudo_element: PseudoClass,
|
||||
|
||||
pub fn match(s: Selector, n: anytype) !bool {
|
||||
return switch (s) {
|
||||
.tag => |v| std.ascii.eqlIgnoreCase(v, try n.tag()),
|
||||
else => false,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn deinit(sel: Selector, alloc: std.mem.Allocator) void {
|
||||
switch (sel) {
|
||||
.group => |v| {
|
||||
|
||||
Reference in New Issue
Block a user