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

Should regions be flagged as requiring accessible names? #3585

Closed
sivakusayan opened this issue Aug 6, 2022 · 4 comments
Closed

Should regions be flagged as requiring accessible names? #3585

sivakusayan opened this issue Aug 6, 2022 · 4 comments

Comments

@sivakusayan
Copy link

sivakusayan commented Aug 6, 2022

Product: axe Extension

Expectation: When scanning a codepen with a nameless region, the extension would flag the nameless region as needing a name.

Actual: Nameless region is not flagged.

Motivation: Nameless regions aren't exposed as regions at all, at least according to the CORE-AAM. This behavior is implemented in both Chromium and Firefox (not sure with Safari). I feel like this could be potentially confusing to authors who aren't familiar with these rules - that's what I often see with coworkers in my company, at least.

I see that this was previously discussed in #2421, and it was determined those names weren't necessary. I'm not sure how different the AAM and implementation statuses were back then, but would it make sense to revisit this issue for regions? Maybe this should be flagged as a best practice.

@WilcoFiers
Copy link
Contributor

Hey @sivakusayan. Thanks for the suggestion. There's nothing inherently wrong with a region element without an accessible name though. Not all regions have, or need a name. You could say that regions that need a name, require a name, but there is no way to know whether regions need a name or not. Nothing accurate I can think of anyway.

This is sort of the problem with some elements. On something like img you can say if there is no alt, title, aria-label, that's an automatic failure. But if a canvas element doesn't have an accessible name, there's no way to know if that is because it should be ignored, or if there's a problem.

@sivakusayan
Copy link
Author

Thanks for the reply! I'll admit I don't completely understand (I'm still relatively new to accessibility), so I'm going to list out two interpretations of your answer - feel free to ignore whichever one doesn't apply.

  • Is the concern that we can't reliably detect whether the author intended to make something a landmark or not, and so implementing this would be unnecessarily noisy? I can see that, judging from this comment talking about why nameless regions were changed to not be landmarks. Just to throw an idea out there, could we check if an element has an explicit role="region"? It feels like if an author gave the region role to an element, they definitely did intend for that element to be a landmark, and they would want to know if their landmark isn't being respected due to not having an accessible name.

  • Is the concern that regions should conceptually not be required to have a name? I guess I can't speak to the usability considerations here. However, if this is the case, maybe a new issue should be opened in the ARIA specifications, because with current implementations nameless regions aren't landmarks. If I'm understanding the purpose of axe-core correctly, I think that part of it is to help avoid "gotchas" where ARIA attributes are ignored, and so this should be called out.

@WilcoFiers
Copy link
Contributor

From the sound of it you understand the issue well enough! You're right on both counts. the region element might not be intended as having the region role from ARIA.

WAI-ARIA actually requires that all elements with a region role have an accessible name. It's one of the things we choose not to replicate into axe-core. I think it's unnecessarily strict. It's certainly a good idea to add names to regions, but to say it's always an accessibility problem when you don't I think is overstating the impact of not doing it. When you require names on things that don't have an obvious name, whatever name content authors then add is likely not going to be helpful.

@sivakusayan
Copy link
Author

When you require names on things that don't have an obvious name, whatever name content authors then add is likely not going to be helpful.

I can see that. My initial thought was that some kind of name is better than none, since how would users distinguish different regions when pulling up a list of all landmarks? Although I guess that also applies to other types of landmarks, even though other landmarks don't require names. But if a user was merely cycling through all the regions on the page using virtual cursor hotkeys, I think the user can distinguish different landmarks from each other just by their content. I'm struggling to see a straightforward answer here 😕

I think I'm okay with closing for now, mostly because:

  • This seems hard to automate in a useful way at first glance
  • I suspect that the only reason WAI-ARIA required a region to have an accessible name is to match the behavior in CORE-AAM. Which in turn seemed to have only been changed to reduce issues with non-ideal markup, and not for any real usability concerns.
  • The use of regions should hopefully be rare compared to other landmarks, making this a low impact rule even if we did care about this.

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

No branches or pull requests

2 participants