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

Compute accessible names based on possibly partial accessibility tree #307

Open
kasperisager opened this issue Aug 25, 2020 · 5 comments
Open
Labels
Research Task that need some investigation and experiment

Comments

@kasperisager
Copy link
Contributor

As outlined in w3c/accname#25 (comment), the accessible name computation expects to operate on the accessibility tree, not the DOM tree. Among other things, this ensures that relations created using aria-owns are correctly accounted for.

@kasperisager
Copy link
Contributor Author

Also taking #298 into account, this does become a little more involved than I had hoped. In essence, there seems to be a need to interleave the various steps of the tree construction, name computation, and role resolution as they're all interdependent.

Another interesting thing is a case like this:

<button aria-labelledby="foo"></button>
<div id="foo" hidden>
  Hello world
</div>

While the <button> element is included in the accessibility tree, the <div> element isn't. Yet, we need to determine the name of <div> element as it's being referenced by the <button> element. It therefore doesn't really seem to be the case that the name computation should operate on the accessibility tree after all 🤔

@kasperisager
Copy link
Contributor Author

This needs more refinement.

@Jym77
Copy link
Contributor

Jym77 commented Nov 5, 2020

Another case I've found today, somewhat related to the button example:

<h1><span aria-hidden="true">Foo</span></h1>

Name#fromDescendants does not filter out aria-hidden descendants (or hidden descendants). Of course, we need to already know the accessibility tree to know that the span is not exposed 😕
That node has no accessible name in Chrome of Firefox but has some in Alfa 😖

This creates false negative in https://act-rules.github.io/rules/ffd0e9#failed-example-2 and a couple other test cases for this rule…

@Jym77
Copy link
Contributor

Jym77 commented Nov 5, 2020

Which, I'm afraid, makes this a bug 🙈

@kasperisager
Copy link
Contributor Author

That seems more related to w3c/accname#30 than the current issue and is something we can solve by adjusting step 2A:

// Step 2A: Is the element hidden and not referenced?
// https://w3c.github.io/accname/#step2A
if (!state.isReferencing && !isRendered(element, device)) {
return empty;
}

@Jym77 Jym77 added the Research Task that need some investigation and experiment label Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Research Task that need some investigation and experiment
Projects
None yet
Development

No branches or pull requests

2 participants