question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add check to fail fallback roles

See original GitHub issue

Reposting from GoogleChrome/lighthouse#4474

Given the following markup, aXe reports a few errors, I believe due to not being able to validate both roles in <span role="tab button"> at once

Codepen: https://codepen.io/anon/pen/mXRPJJ

From the HTML spec https://www.w3.org/TR/html52/dom.html#aria-role-attribute

The attribute, if specified, must have a value that is a set of space-separated tokens; each token must be a non-abstract role defined in the WAI-ARIA specification [wai-aria-1.1].

The Chrome accessibility tree also computes the role correctly as tab

image

<ul role="tablist">
    <li>
        <h2>
            <span role="tab button" tabindex="0" aria-selected="false">Header</span>
        </h2>
        <ul>
            <li role="presentation">
                <span role="tab button" tabindex="0" aria-selected="false">Subitem</span>
            </li>
        </ul>
    </li>
</ul>

Errors from the chrome extension:

Elements must only use allowed ARIA attributes ARIA attribute is not allowed: aria-selected=“false” <span role="tab button" tabindex="0" aria-selected="false">Header</span>

Certain ARIA roles must contain particular children Required ARIA child role not present: tab <ul role="tablist">

ARIA roles used must conform to valid values Role must be one of the valid ARIA roles <span role="tab button" tabindex="0" aria-selected="false">Header</span>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
jwhearecommented, Feb 16, 2018

@dylanb makes sense. I’m only suggesting that it would be more useful for developers if it says specifically what doesn’t work (multiple roles) rather than attributing the errors incorrectly as the original issue shows. It’s not necessary to list ATs to do that. Hope that’s clear 😃

0reactions
strakercommented, Mar 30, 2020

This was added as part of axe-core v3.5.0. The fallbackrole check (part of the aria-roles rule) will now fail if an element has a fallback role. You can disable this check using axe.configure.

axe.configure({
  checks: [
    {
      id: 'fallbackrole'
      enabled: false
    }
  ]
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Site system roles for clients - Configuration Manager
Install a fallback status point if all the following conditions apply: You want client communication errors from Windows computers to be sent ...
Read more >
Using ARIA
This document is a practical guide for developers on how to add accessibility information to HTML elements using the Accessible Rich ...
Read more >
Role attribute has valid value - ACT-Rules Community
This rule checks that each role attribute has a valid value. ... value of the role attribute is used for what is known...
Read more >
ByRole
If you need to query an element by any of its fallback roles instead, you can use queryFallbacks: true . For example, getByRole('switch')...
Read more >
15.00 - ALTER TABLE, FALLBACK, and Read From Fallback
When a read error occurs in this case, the file system reads the ... Rules for INSERT and UPDATE Row-Level Security Policy Functions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found