WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Double encoding of elements

for

From: Birkir R. Gunnarsson
Date: Oct 26, 2015 6:53AM


Mark

In theory this coding practice should be discouraged, and some
accessibility checkers such as AXe correctly call it out.
However, there are still times where the only way to get an ARIA
property announced to assistive technologies is to ad the explicit
ARIA role.

e.g:
Assistive technologies such as screen readers will not remap a heading
to a different level unless the heading role is present.

Does not work (with NVDA and Jaws, latest testing a few months ago):
<h3 aria-level="2">This is an h3 heading, that we want to map to an h2
in the accessibility tree</h3>

whereas this works:

<h3 role="heading" aria-level="2">This is an h3 heading, that we want
to map to an h2 in the accessibility tree</h3>

similarly, if you want the accessible name for a form, provided via
aria-label or aria-labelledby, to be announced on forms you need to
specify the form role.
<form role="form" aria-label="Login">
..
</form>

Ultimately these are bugs and we need to help eliminate them rather
than do the hakcs, but until then, sometimes you just need the
information communicated to the user.

Only consider the hack if your assistive technology testing indicates
that doing things correctly does not get to the end user.
Also consider these best practice issues, since ultimately it is the
user agent, either browser or assistive technology, that is not doing
its part in the process.
-B





On 10/26/15, Mark Guisinger via WebAIM-Forum
< <EMAIL REMOVED> > wrote:
> What do people think about double encoding of elements with aria roles
> (i.e.<header role="banner">). Is there an advantage with older screen
> readers or browsers?
> Thanks,Mark Guisinger
> > > > >


--
Work hard. Have fun. Make history.