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

Possible incorrect results for Values assigned to role="" are not valid ARIA roles. ARIA check in Lighthouse audit #4480

Open
1 task done
hamirmahal opened this issue May 27, 2024 · 8 comments
Labels
docs Documentation changes

Comments

@hamirmahal
Copy link
Contributor

Product

axe-core

Product Version

"^4.9.0"

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

Reported ARIA role violations should actually be violations.

Actual

The ARIA check seems to report failures on a valid ARIA role, at least according to https://dequeuniversity.com/rules/axe/4.8/aria-allowed-role.

How to Reproduce

body.chakra-ui-light > div.chakra-portal > ul#chakra-toast-manager-top
<ul role="region" aria-live="polite" id="chakra-toast-manager-top" style="position: fixed; z-index: var(--toast-z-index, 5500);">
body.chakra-ui-light > div.chakra-portal > ul#chakra-toast-manager-top-left
<ul role="region" aria-live="polite" id="chakra-toast-manager-top-left" style="position: fixed; z-index: var(--toast-z-index, 5500);">
body.chakra-ui-light > div.chakra-portal > ul#chakra-toast-manager-top-right
<ul role="region" aria-live="polite" id="chakra-toast-manager-top-right" style="position: fixed; z-index: var(--toast-z-index, 5500);">
body.chakra-ui-light > div.chakra-portal > ul#chakra-toast-manager-bottom-left
<ul role="region" aria-live="polite" id="chakra-toast-manager-bottom-left" style="position: fixed; z-index: var(--toast-z-index, 5500);">
body.chakra-ui-light > div.chakra-portal > ul#chakra-toast-manager-bottom
<ul role="region" aria-live="polite" id="chakra-toast-manager-bottom" style="position: fixed; z-index: var(--toast-z-index, 5500);">
body.chakra-ui-light > div.chakra-portal > ul#chakra-toast-manager-bottom-right
<ul role="region" aria-live="polite" id="chakra-toast-manager-bottom-right" style="position: fixed; z-index: var(--toast-z-index, 5500);">
@hamirmahal hamirmahal added the ungroomed Ticket needs a maintainer to prioritize and label label May 27, 2024
@hamirmahal
Copy link
Contributor Author

@straker
Copy link
Contributor

straker commented May 28, 2024

Thanks for the issue. It looks like the docs for aria-allowed-role is wrong and is a copy paste of aria-roles. The docs should say that the ul element is not allowed to have a role of region in accordance with ARIA in HTML.

Also it looks like the Lighthouse summary of the rule is incorrect as well as that description looks like it fits aria-roles instead of aria-allowed-role. You might want to open an issue with Lighthouse and bring that up.

@straker straker added docs Documentation changes and removed ungroomed Ticket needs a maintainer to prioritize and label labels May 28, 2024
@hamirmahal
Copy link
Contributor Author

You're welcome. I opened GoogleChrome/lighthouse#16023 in Lighthouse. Thanks for the details.

@adamraine
Copy link

The docs should say that the ul element is not allowed to have a role of region in accordance with ARIA in HTML.

@straker Is this a complete description of the rule (i.e. it applies only to ul elements)? I'm wondering how we should be phrasing the Lighthouse audit description if we can't base it on https://dequeuniversity.com/rules/axe/4.9/aria-allowed-role (until the docs are updated)

@christophe-g
Copy link

I am landing here from lighthouse where I am getting a Values assigned to role="" are not valid ARIA roles. error for role="toolbar", which is a valid aria role, but not listed on the axe doc allowed-role.

Not creating a new issue as I think it is related to this one.

@straker
Copy link
Contributor

straker commented Jun 4, 2024

@adamraine We're working on updating the docs. In the meantime this is the description and why important sections of the rule we're going with

Rule Description

Not all WAI-ARIA role values are allowed to be used on every HTML element.
Many HTML elements can only be assigned certain WAI-ARIA roles.

Why Important

Using WAI-ARIA roles where they are not allowed can interfere with the
accessibility of the web page. Using an invalid HTML element and ARIA role
combination will, at best, result in no effect on the accessibility of the
application and, at worst, may trigger behavior that disables accessibility
for entire portions of an application.

When ARIA roles are used on HTML elements that are not in accordance with the
HTML in ARIA specification, they conflict with the semantics of the elements
which can cause assistive technology products report nonsensical user
interface (UI) information that does not represent the actual UI of the
document.

@adamraine
Copy link

adamraine commented Jun 4, 2024

Not all WAI-ARIA role values are allowed to be used on every HTML element.
Many HTML elements can only be assigned certain WAI-ARIA roles.

Sorry still a bit confused, are these two statements saying the same thing? Trying to write the title of the Lighthouse audit and I'm not sure if I need to somehow combine these two statements in order to summarize the rule, or if the title could just be "Uses ARIA roles on incompatible elements" (or something).

@straker
Copy link
Contributor

straker commented Jun 6, 2024

The updated docs for the rule are now available on Deque university https://dequeuniversity.com/rules/axe/4.9/aria-allowed-role

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation changes
Projects
None yet
Development

No branches or pull requests

4 participants