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

Step F "if the current node's role allows name from content" should only apply to the root node #120

Open
JAWS-test opened this issue Mar 29, 2021 · 1 comment

Comments

@JAWS-test
Copy link

JAWS-test commented Mar 29, 2021

If the rule always applies, the result is that nested elements that can only be labeled by the author, but do not require a label, will not pass a label to the ancestor element if they are not explicitly labeled, and thus are empty.

This applies to the following ARIA roles, among others:

  • application
  • article
  • banner
  • blockquote
  • definition
  • document
  • feed
  • figure
  • group
  • list
  • ...

<a href=...><blockquote>quote</blockquote></a>

would thus lead to an unlabeled link. This is not only a theoretical problem, but actually leads in Chrome and Firefox always to an unlabeled link, which is accordingly also output by the screen reader without a label (in JAWS for some ARIA roles always, for others only if the link has e.g. a title attribute)

Even if these elements are explicitly labeled, it is worth checking whether the label or rather the text content should be transmitted:

<a href=...><ul aria-label=list><li>item 1<li>item 2</ul></a>
<a href=...><article aria-label=article>content</article></a>

According to the current rule, the aria-label is output as a link label. The question is whether it doesn't make more sense to output the text content. The problem is that screen readers no longer output the text content even when reading linearly. However, browsers and screen readers interpret the rule differently. For example, the text content is not output at all for an article, but it is output for a list.

It should also be noted that screen readers often automatically use the text content as a label if no explicit label is available, e.g. for lists and tables (but only in the element overview).

And how can I identify if HTML elements support name from content? For ARIA roles it's in the specification, but not for HTML elements...

Related: #113, #118 and https://github.com/w3c/aria/issues/899

@JAWS-test
Copy link
Author

JAWS-test commented Apr 4, 2021

There are also ARIA roles that cannot be labeled at all. If these are e.g. in a link, then the link has no label according to specification, e.g.

<a href=...><span role=presentation>text content</span></a>

However, the problem occurs only in the specification, the browsers ignore the error in the specification and use the text content as a label (unlike with the ARIA roles that have Name from Author, see above)

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