Skip to content

fix(access-name): get name from header elements#4097

Merged
WilcoFiers merged 7 commits intodevelopfrom
aria-dialog-name-issue
Aug 8, 2023
Merged

fix(access-name): get name from header elements#4097
WilcoFiers merged 7 commits intodevelopfrom
aria-dialog-name-issue

Conversation

@WilcoFiers
Copy link
Copy Markdown
Contributor

The content of landmarks and other elements that have "name from author" should not be ignored when referenced by aria-labelledby or another label.

This is a bug, where axe was inconsistent with the accessible name spec. Specifically, step F:

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

Previously axe-core was only considering the first part of this sentence, and skipping name from author elements while following aria-labelledby and <label> IDREFs. This was a problem on dialogs (as the issue reported), but had broader implications too. Notably, column and rowheaders in a table could not be referenced with aria-labelledby.

That created a second problem; Elements with a value (like select and progressbar) should never use name from content. I had to add a condition in for that. I ended up testing the use of element values in names again. This improved a good bit, and so now only the value of progressbar still can't be relied on to give an accessible name.

Closes: #3752

@WilcoFiers WilcoFiers requested a review from a team as a code owner July 20, 2023 11:57
></label>

<div>
<label>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label does nothing, and fail24 is not tested by this rule; this is not the select-name rule.

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

Successfully merging this pull request may close these issues.

header in section with role should not have role banner

2 participants