Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add role matches methods #1349

Closed
WilcoFiers opened this issue Feb 5, 2019 · 1 comment
Closed

Add role matches methods #1349

WilcoFiers opened this issue Feb 5, 2019 · 1 comment
Assignees
Labels
commons Issues in the common code (lib/commons) configuration rules / checks customisation feat New feature or enhancement
Milestone

Comments

@WilcoFiers
Copy link
Contributor

In axe-core we do a lot of role matching. Instead of writing that code over and over, we should add this role matching capability to axe.commons.matches().

I think there are three variations:

  • matches(node, { semanticRole: 'listitem' })
  • matches(node, { explicitRole: ['presentation', 'none'] })
  • matches(node, { implicitRole: 'img' })

The semantic role is the default of aria.getRole(node), the explicitRole is aria.getRole(node, { noImplicit: true }), and implicitRole is aria.implicitRole(node).

The reason for calling it semanticRole rather than role is to avoid confusion with the role attribute.

@WilcoFiers WilcoFiers added feat New feature or enhancement commons Issues in the common code (lib/commons) labels Feb 5, 2019
@straker straker added this to the Axe-core 4.0 milestone Nov 25, 2019
@WilcoFiers WilcoFiers added the configuration rules / checks customisation label Apr 28, 2020
@straker straker self-assigned this Jun 11, 2020
@padmavemulapati
Copy link

devTask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commons Issues in the common code (lib/commons) configuration rules / checks customisation feat New feature or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants