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

Consider allowing header[role=banner] #3108

Closed
WilcoFiers opened this issue Aug 3, 2021 · 2 comments
Closed

Consider allowing header[role=banner] #3108

WilcoFiers opened this issue Aug 3, 2021 · 2 comments
Assignees
Labels
best practice good first issue For first-time contributors pr A pr has been created for the issue rules Issue or false result from an axe-core rule

Comments

@WilcoFiers
Copy link
Contributor

WilcoFiers commented Aug 3, 2021

  <main>
    <header role="banner">
      Hello world
    </header>
  </main>

This fails aria-allowed-role, in addition to failing landmark-banner-is-top-level. It's probably better for axe-core to only fail it under the top-level rule. It's a little odd to allow role=banner on a header if it's at the top, but to fail it if it's inside another landmark.

The same problem exists for other landmarks. I think the fix is to add banner to the header element in standards/html-elms.js.

@WilcoFiers WilcoFiers added best practice good first issue For first-time contributors rules Issue or false result from an axe-core rule labels Aug 3, 2021
@WilcoFiers
Copy link
Contributor Author

Actually it'd be pretty cool if axe-core explicitly reported on the top-level rule to remove the role attribute.

@padmavemulapati
Copy link

Validated with the latest develop branch code base, now its showing only one rule failing for the code snippet

<main>
    <header role="banner">
      Hello world
    </header>
  </main>

when header is having role=banner
image

Previouly both aria-allowed-role and landmark rules failing.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
best practice good first issue For first-time contributors 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