Skip to content

Commit

Permalink
fix(a11y): query only unignored nodes (#12224)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Apr 5, 2024
1 parent a63b830 commit e20cd64
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/puppeteer-core/src/cdp/AriaQueryHandler.ts
Expand Up @@ -27,7 +27,16 @@ const queryAXTree = async (
role,
});
return nodes.filter((node: Protocol.Accessibility.AXNode) => {
return !node.role || !NON_ELEMENT_NODE_ROLES.has(node.role.value);
if (node.ignored) {
return false;
}
if (!node.role) {
return false;
}
if (NON_ELEMENT_NODE_ROLES.has(node.role.value)) {
return false;
}
return true;
});
};

Expand Down

0 comments on commit e20cd64

Please sign in to comment.