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

Heading-order may not correctly calculate level of heading element with aria-level #2971

Closed
straker opened this issue Jun 2, 2021 · 3 comments
Assignees
Labels
fix Bug fixes pr A pr has been created for the issue rules Issue or false result from an axe-core rule

Comments

@straker
Copy link
Contributor

straker commented Jun 2, 2021

ARIA allows <h1-6> elements to have the aria-level attributes. This causes a potential bug in our heading-order check as we only look at aria-level if the element has a role=heading attribute. Meaning that <h1 aria-level="6">Goodbye</h1> is calculated as a level 1 heading instead of a level 6 heading.

However, this doesn't work in all browsers. In modern browsers the aria-level is used to determine the heading level, but in IE 11 / JAWS the aria-level is ignored:

  • FireFox / NVDA - "Heading level 6, Goodbye"
  • Chrome / JAWS - "Heading level 6, Goodbye"
  • IE 11 / JAWS - "Heading level 1, Goodbye"
  • Safari / VO - "Heading level 6, Goodbye"
  • Android Chrome / Voice Assistant - "Goodbye, Heading 6"
@straker straker added fix Bug fixes rules Issue or false result from an axe-core rule labels Jun 2, 2021
@straker
Copy link
Contributor Author

straker commented Jun 21, 2021

Since everyone else is using the aria-level to calculate the level, we should update our code to do that.

@padmavemulapati
Copy link

Validated with the latest develop branch code base,
1.When we pass aria-level="6" even it tagged in h1, and norole` attribute is passing . It is announcing as heading 6.

image
2. we only look at aria-level if the element has a role=heading attribute. Meaning that <h2 aria-level="5" and role=heading>hello</h2> is calculated as a level 5 heading instead of a level 2 heading.
image

@straker
Copy link
Contributor Author

straker commented Sep 28, 2021

No docs

@straker straker closed this as completed Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes pr A pr has been created for the issue rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

3 participants