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

Clarification on the accessible description computation when aria-describedby refers to an element with nameFrom=author #49

Open
mfairchild365 opened this issue Apr 29, 2019 · 0 comments

Comments

@mfairchild365
Copy link

Given this code example

<label for="phone-number">
    Enter your phone number
    <input type="text" id="phone-number" aria-describedby="phone-error" />
</label>
<div id="phone-error" role="alert">
    Sorry, that area code is not valid
</div>

Most screen reader + browser combinations return nothing as the accessible description for #phone-number. However, many developers (reasonably) expect the description to be the contents of the #phone-error. I'm seeing this pattern more frequently in the wild.

This is because aria-describedby references an element with role="alert". The ARIA 1.1 spec states that the name of role="alert" is from the author. The accname spec states that name from author is derived from aria-label or aria-labelledby attributes, while "name from content" is derived from the content of the element.

However, Step 2F of accname-1.1 states "Otherwise, if the current node's role allows name from content, or if the current node is referenced by aria-labelledby, aria-describedby, or is a native host language text alternative element (e.g. label in HTML), or is a descendant of a native host language text alternative element... [compute as name from content]"

The key is "Or if the current node is referenced by aria-labelledby, aria-describedby..."

Therefore I read that to mean that the content should be returned as the description because it is referenced by aria-describedby. Yes, role="alert" will get its accessible name from the author, but when it doesn't have a name from the author and is referenced via aria-describedby, its contents must be returned.

Is my understanding correct? Since most screen reader and browser combinations seem to disagree with my interpretation, I'd like to get this clarified so that the issue can be addressed appropriately.

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

1 participant