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

Heading name does not consider content #280

Open
Jym77 opened this issue Feb 7, 2020 · 5 comments
Open

Heading name does not consider content #280

Jym77 opened this issue Feb 7, 2020 · 5 comments
Labels
accName & Desc Related to accessible name or description

Comments

@Jym77
Copy link

Jym77 commented Feb 7, 2020

As far as I can follow, the Accessible Name computation of heading elements (<h1>, …) follows Section and Grouping Element Accessible Name Computation which is:

  1. aria-label or aria-labelledby
  2. title
  3. empty name

Thus, an element like <h1>Accessible names are cool</h1> has neither aria-label, aria-labelledby nor title attribute and will have no accessible name. It seems that it should get an accessible name from content (and that is what UA and AT are doing as far as I can tell).

It make sense that other Section elements (e.g. <body>) don't get their name from content as it would get somewhat crazy… But for <h1>-<h6> element, it looks like a specific case should be added, allowing name from content.

@JAWS-test
Copy link

This also applies to Grouping Content like <p>, <li>, <dt>, <dd>...

@Jym77
Copy link
Author

Jym77 commented Feb 7, 2020

True. But I'm rather happy that a <p> element does not get its full content as an accessible name…

Actually, a <p> element has no default role, so does not have a role that allow name from content (I guess) and thus step 2F of the accessible name computation should be skipped…

<h*> elements have a default role of heading which does allow name from content.

@JAWS-test
Copy link

JAWS-test commented Feb 7, 2020

<li>, <dt>, <dd> have a default role and <p> will get the role paragraph.

A distinction may be made between content in the element and labeling of the element. For example, in Chrome labeling these elements with aria-label, JAWS only outputs the text content when reading with a virtual cursor (and not the aria-label), only the aria-label for tab navigation (and not the text content). Contrary to the specification, the title attribute is never output as a label, but only as a description while tab navigation and not at all when reading. See https://codepen.io/jaws-test/pen/gOpbOdw

I am not sure whether the specification is inadequate here, or whether Chrome and JAWS are not implementing the specification correctly or whether the different output of name and content is so desired depending on the navigation mode. At least I think it's very confusing ...

@scottaohara
Copy link
Member

@Jym77 appreciate the issue. we need to update this section to add some clarity as some elements that are considered grouping or sectioning elements should allow name from contents (e.g. headings), while others (body and div for example) should not allow naming at all.

@JAWS-test
Copy link

JAWS-test commented Feb 7, 2020

Related: w3c/aria#1054, #160

@scottaohara scottaohara added the accName & Desc Related to accessible name or description label Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accName & Desc Related to accessible name or description
Projects
None yet
Development

No branches or pull requests

3 participants