SemanticTree: unify interactivity detection logic

This commit is contained in:
Adrià Arrufat
2026-03-10 19:02:55 +09:00
parent 56f47ee574
commit 064e7b404b
3 changed files with 17 additions and 58 deletions

View File

@@ -567,28 +567,6 @@ pub const AXRole = enum(u8) {
StaticText,
// zig fmt: on
pub fn isInteractive(self: AXRole) bool {
return switch (self) {
.button,
.link,
.checkbox,
.radio,
.textbox,
.combobox,
.searchbox,
.slider,
.spinbutton,
.@"switch",
.menuitem,
.color,
.date,
.file,
.month,
=> true,
else => false,
};
}
fn fromNode(node: *DOMNode) !AXRole {
return switch (node._type) {
.document => return .RootWebArea, // Chrome specific.