diff --git a/src/cdp/AXNode.zig b/src/cdp/AXNode.zig index dd781b99..1621085d 100644 --- a/src/cdp/AXNode.zig +++ b/src/cdp/AXNode.zig @@ -45,11 +45,31 @@ pub const Writer = struct { visibility_cache: *DOMNode.Element.VisibilityCache, label_index: *Label.LabelByForIndex, temp_arena: std.mem.Allocator, + // When null, emit the full AX tree (getFullAXTree). When set, walk the + // subtree visiting all nodes (including AX-ignored ones, per the + // queryAXTree spec) and emit only nodes whose role + accessible name + // match the filter, in a flat shape. + filter: ?Filter = null, - pub const Opts = struct {}; + pub const Filter = struct { + role: ?[]const u8 = null, + accessible_name: ?[]const u8 = null, + }; + + pub const Opts = struct { + filter: ?Filter = null, + }; + + const ResolvedRole = struct { + role: []const u8, + // Non-null when the current node is a