Skip to content

Lightpanda: the headless browser designed for AI and automation

cdp: cover a[href] focusability in the ARIA states test

Adrià Arrufateee7e46a5999
diff --git a/src/browser/tests/cdp/ax_aria_states.html b/src/browser/tests/cdp/ax_aria_states.html
index 8d00fd397..7029da67a 100644
--- a/src/browser/tests/cdp/ax_aria_states.html
+++ b/src/browser/tests/cdp/ax_aria_states.html
@@ -25,4 +25,5 @@
<div role="switch" aria-label="Switch mixed" aria-checked="mixed" tabindex="0">Switch mixed</div>
<div role="menuitemcheckbox" aria-label="Menu checkbox mixed" aria-checked="mixed" tabindex="0">Menu checkbox mixed</div>
<div role="switch" aria-label="Expanded switch" aria-expanded="true" tabindex="0">Expanded switch</div>
+<a href="/target" aria-label="Plain link">Plain link</a>
</body></html>
diff --git a/src/server/cdp/AXNode.zig b/src/server/cdp/AXNode.zig
index 48959146e..d7ed7818a 100644
--- a/src/server/cdp/AXNode.zig
+++ b/src/server/cdp/AXNode.zig
@@ -2372,6 +2372,7 @@ test "AXNode: custom ARIA states and tabindex focusability" {
.{ .role = "checkbox", .name = "Unfocusable terms", .property = "focusable", .value = null },
.{ .role = "checkbox", .name = "Invalid state", .property = "focusable", .value = null },
.{ .role = "button", .name = "Custom anchor", .property = "focusable", .value = .{ .bool = true } },
+ .{ .role = "link", .name = "Plain link", .property = "focusable", .value = .{ .bool = true } },
};
for (cases) |case| {
const ax_node = findNode(nodes, case.role, case.name) orelse return error.NodeNotFound;