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

review unlabeled section vs explicit region role #28

Closed
cookiecrook opened this issue Apr 20, 2023 · 5 comments
Closed

review unlabeled section vs explicit region role #28

cookiecrook opened this issue Apr 20, 2023 · 5 comments
Assignees

Comments

@cookiecrook
Copy link
Collaborator

cookiecrook commented Apr 20, 2023

@jcsteh wrote:

<nav role="region" data-testname="region without label" data-expectedrole="navigation" class="ex">x</nav>

This is an interesting case. In Gecko, computedRole currently returns "region" here. While it's clear from the HTML AAM spec that <section> without a label shouldn't return "region", I'm not sure where it's specified that role="region" without a label shouldn't map to "region". Core AAM says that region without a label shouldn't be exposed as a landmark to individual platforms, but it says nothing about the fact that it shouldn't be exposed as a "region" as far as ARIA (not the platform APIs) are concerned. You can intuit the latter from the former, but unless I'm missing something, there's no spec concept which allows a role to be completely ignored/invalidated based on a missing name. There's "Name required true", but that's specified for button as well, and I'm not sure we'd want to completely ignore the role for an unlabelled button.

Originally posted by @jcsteh in web-platform-tests/wpt#38925 (comment)

@cookiecrook
Copy link
Collaborator Author

cookiecrook commented Apr 20, 2023

Source: wai-aria/role/region-roles.html

Current results: https://wpt.fyi/results/wai-aria/role/region-roles.html?label=experimental&label=master&aligned

WebKit and Chromium pass both tests as written.

@cookiecrook
Copy link
Collaborator Author

@scottaohara Can you help us determine if either:

  • there's a relevant portion of a spec indicating Gecko has a bug, or
  • the test is incorrect and both WebKit and Chromium have the same bug.

@cookiecrook
Copy link
Collaborator Author

The ARIA spec says about regions:

User agents SHOULD treat elements with role region and have an accessible name as navigational landmarks. (Typo addressed in ARIA #1919)

But to @jcsteh's point, that's not the same as "User Agents MUST NOT expose the region role on elements without a label." So where is the disconnect?

@cookiecrook
Copy link
Collaborator Author

Ah, here it is, @jcsteh:

Certain landmark roles require names from authors. In situations where an author has not specified names for these landmarks, it is considered an authoring error. The user agent MUST treat such elements as if no role had been provided. If a valid fallback role had been specified, or if the element had an implicit ARIA role, then user agents would continue to expose that role, instead. Instances of such roles are as follows:

Citation: https://w3c.github.io/aria/#document-handling_author-errors_roles

I'd like to close this issue, but I will wait til you confirm and file the related Gecko bug.

@cookiecrook cookiecrook self-assigned this Apr 20, 2023
@jcsteh
Copy link

jcsteh commented Apr 20, 2023

Aha. Thank you.

I already assumed this was something we wanted in the spec, even if it wasn't clear yet, so I already have patches up for review to fix this in Gecko. Those patches are in https://bugzilla.mozilla.org/show_bug.cgi?id=1822112 and friends.

Please feel free to close 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