RE: [WebAIM] How the W3C Text Alternative Computation Works

On Tue, Dec 22, 2015 at 12:45 PM Birkir Gunnarsson <birkir.gunnarsson@deque.com <mailto:birkir.gunnarsson@deque.com> > wrote:

>4. Question for everybody on the list (and I might break this into a separate email)
>How should user agents/assistive technologies treat aria-label or aria-labelledby on divs and spans without a role?

 <div aria-label="My favorite Mexican Food">Chipotle chicken with no e-coli</div>

 

Matt Kingwrites …

We really need consensus on this for ARIA 1.1. The current situation where some screen readers do one thing and others do another is creating both coding night mares and usability disasters.

 

Dominic Mazzoni wrote on Tuesday, December 22, 2015 at 2:15 PM:

>What's happening now is that browsers are exposing ""My favorite Mexican Food" as the accessible name of that element, 

>but screen readers ignore the accessible name of an element with a generic role like "div".

 

Matt King writes …

Not always. For example, OS 10 VoiceOver puts the link and contained text in a labeled group. To read the link and contained text, a VoiceOver user needs to stop and interact with the group.

This also happens if you change the aria-label on the div into a title. 

In other words, for VO users, a div or span with a title or aria-label has an implied role of group.

 

Dominic Mazzoni continues …

>Here's the problem: what do you want to happen in this case?

<div aria-label="My favorite Mexican Food">

  <a href="http://chipotle.com">Chipotle</a>

  chicken with no e-coli

</div>

>Is the screen reader supposed to treat the div and the link as two separate elements now? 

>Does "My favorite Mexican Food" override the link text, the static text that follows it, or both? 

>There's just no way to interpret this, it has to be author error.

 

Matt King writes …

If the accessible name calculation were to ignore aria-label, aria-labelledby, and title on elements that do not have an explicit or implicit ARIA role, we would have a starting point for interpretation since all ARIA roles specify whether the name should be from content or author.

 

In addition, if the implied role of div and span were both “none”, authors would not be unwittingly giving semantic significance to inherently unsemantic elements simply by adding a title or a misplaced aria-label. If the aria-label is intentional, then the ARIA role should also be intentional. Since neither div nor span have required owned elements or a required context, the role of none would not create an inheritance issue.

 

Matt King

Received on Tuesday, 29 December 2015 11:32:42 UTC