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

On Tue, Dec 22, 2015 at 12:45 PM Birkir Gunnarsson <
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>


This is a great question.

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".

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.

I think the problem is that authors think they're providing an alternate
label for the inner text content by adding aria-label, but they're not -
they're adding a label for the wrapper element, which isn't the same thing.

Received on Tuesday, 22 December 2015 22:15:29 UTC