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

What should computed role return for elements not in the a11y tree? #39637

Closed
jcsteh opened this issue Apr 20, 2023 · 4 comments
Closed

What should computed role return for elements not in the a11y tree? #39637

jcsteh opened this issue Apr 20, 2023 · 4 comments

Comments

@jcsteh
Copy link
Contributor

jcsteh commented Apr 20, 2023

Spun off #38941 (review).

<div role="none" id="none" data-expectedrole="none" data-testname="none role == computedrole none" class="ex">x</div><!-- preferred -->
<div role="presentation" id="presentation" data-expectedrole="none" data-testname="synonym presentation role == computedrole none" class="ex">x</div><!-- synonym -->

These tests (and perhaps others) set role=none/presentation and expect that the computed role will be "none". role="none" excludes the element from the a11y tree, so we can't get the computed role from the a11y engine. This raises the question: what are the expectations for computed role for nodes which aren't in the a11y tree?

Gecko currently returns null, but I can change that to anything: "", "none", whatever. However, it seems to me that there is a subtle difference between role="none" (one very specific way of removing an element from the a11y tree) vs the non-existence of an element in the a11y tree for one of several reasons (role="none", hidden, aria-hidden, ...). Could "none" lead people to think that this is specifically about role="none", when in reality, aria-hidden will return "none" as well?

That said, I don't want to bikeshed too much here. If WebKit and Chromium are happy with "none" for all cases of a11y non-existence, I can just change Gecko's WebDriver implementation to return "none" and move on. Nevertheless, I thought it'd be good to make a clear, documented decision here.

@cookiecrook
Copy link
Contributor

cookiecrook commented Apr 21, 2023

API discussion doesn't typically happen in WPT. This should move over to WICG AOM (already there), BTT, or some other W3C or WHATWG group with an IP Policy... Alternatively I'm tracking it in this related AOM issue under a comment: WICG/aom#197 (comment) Once we have a plan in the WICG AOM incubator, we plan to take the requests to BTT for WebDriver.

@cookiecrook
Copy link
Contributor

cookiecrook commented Apr 21, 2023

@jcsteh I suggest closing this WPT issue.

@jcsteh
Copy link
Contributor Author

jcsteh commented Apr 21, 2023

My apologies. I'm very new to WPT work.

@jcsteh jcsteh closed this as completed Apr 21, 2023
@cookiecrook
Copy link
Contributor

No apologies necessary.

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