WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Changing semantics via ARIA Role

for

From: Birkir R. Gunnarsson
Date: Sep 15, 2015 11:20AM


The short answer:
If you make it look like a duck, it also has to quack like a duck,
feel like a duck and taste like a duck.
If you start with an anchor tag and slap role="button" on it, make
sure it looks like a button and can be activated with enter or space
bar (because that is how the button element works).
If you start with a div, you have to make it focusable, assign the
button role, assign an accessible name, make it look like a button,
make sure its click event is fired when user presses spacebar or
enter key etc.

If you do all of those things, you can use ARIA to create widgets.
If you tell the user you have a button, the user should never be able
to find out (without inspecting your code) that, in fact, it isn't.
-B



On 9/15/15, Joseph Sherman < <EMAIL REMOVED> > wrote:
> This Working Draft specification<http://www.w3.org/TR/html-aria/>; defines
> the web developer rules (author conformance requirements) for the use of
> [wai-aria-1.1] attributes on [HTML51] elements. It also defines requirements
> for Conformance Checking tools.
>
> Web developers MAY use the ARIA role and aria-* attributes on HTML
> elements<http://www.w3.org/TR/html/index.html#elements-1>;, in accordance
> with the requirements described in
> [wai-aria-1.1<http://www.w3.org/TR/html-aria/#bib-wai-aria-1.1>;], except
> where these conflict with the strong native
> semantics<http://www.w3.org/TR/html/infrastructure.html#strong-native-semantics>;
> or are equal to the default implicit ARIA
> semantics<http://www.w3.org/TR/html/infrastructure.html#default-implicit-aria-semantics>;
> of a given HTML element. These constraints, are intended to prevent
> developers from making assistive technology products report nonsensical user
> interface information (UI) that does not represent the actual UI of the
> document.
>
> Web developers MUST NOT use the ARIA role and aria-* attributes in a manner
> that conflicts with the semantics described in the Document conformance
> requirements for use of ARIA attributes in
> HTML<http://www.w3.org/TR/html-aria/#docconformance>; table. Web developers
> SHOULD NOT set the ARIA role and aria-* attributes to values that match the
> default implicit ARIA semantics defined in the table.
>
>
>
>
>
> http://www.w3.org/TR/html-aria/
>
>
>
>
>
> Joseph Sherman
> Accessibility Specialist
> CUNY Computing & Information Services
> 395 Hudson St 6FL, 6-236
> 646-664-2167| <EMAIL REMOVED> <mailto: <EMAIL REMOVED> >
>
>
> -----Original Message-----
> From: WebAIM-Forum [mailto: <EMAIL REMOVED> ] On Behalf
> Of Dennis Deacon
> Sent: Tuesday, September 15, 2015 11:31 AM
> To: <EMAIL REMOVED>
> Subject: [WebAIM] Changing semantics via ARIA Role
>
>
>
> I understand that changing an element's role is generally frowned upon. An
> example would be placing role="link" on a div (just use a link). Are there
> acceptable exceptions to this (say role="button" on a link)?
>
>
>
> I ask because general guidance seems to bend on this inferred hard & fast
> rule.
>
>
>
> Thanks in advance.
>
>
>
> --
>
> Dennis Deacon
>
> Email: <EMAIL REMOVED> <mailto: <EMAIL REMOVED> >
>
> Website/Portfolio: dennisdeacon.com
>
> Blog: dennisdeacon.com/blog
>
> LinkedIn Profile: linkedin.com/in/dennisdeacon
>
> >
> > http://webaim.org/discussion/archives
>
> > <EMAIL REMOVED> <mailto: <EMAIL REMOVED> >
> > > > >


--
Work hard. Have fun. Make history.