W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > April to June 2014

RE: Adding ARIA properties to form elements with class names

From: John Foliot <john@foliot.ca>
Date: Fri, 25 Apr 2014 08:39:29 -0700
To: "'Joshue O Connor'" <joshue.oconnor@cfit.ie>, <public-pfwg-comments@w3.org>
Cc: <w3c-wai-ig@w3.org>, <samuel@sirois.info>
Message-ID: <015201cf609c$8cc37c60$a64a7520$@ca>
Joshue O Connor wrote:
> Joshue O Connor wrote:
> > I have a question about adding ARIA properties to input controls that
> > similar class names, rather than using IDs?
> Apologies about poor phrasing.
> Take 2:
> Can ARIA properties be added to input controls using class names,
> rather than using IDs?

Hi Josh,

I don't think you can add ARIA via a class name in any way, shape or fashion
today, since both classes and aria-* attributes are just that: attributes.
(And sadly, attributes cannot take on further attributes, which is why
@poster is a problem...)

There was some blue-sky thinking around doing such a thing about a year and
a half ago, which Tab Atkins wrote up as CAS - Cascading Attribute Sheets

The lowly class attribute has actually turned out to be quite
powerful/useful, and today it is used to not only apply a styling hook to an
element, but thanks to jQuery, functionality as well. The idea then was why
not use something that authors are already using (classes), and leverage
that for ARIA goodness?

At the end of the 2013 CSUN Conference, a bunch of us got together for an
impromptu hackathon, where we tried to tease that idea out a bit further by
working on a proof of concept. (see:
http://samuel.sirois.info/lab/cas/demo/) Sadly, it never went beyond
Samuel's PoC.

The upshot of Tab's suggestion back in 2012 (BTW) was that at least one
browser (Safari/WebKit - via Maciej) suggested that it would be overly
complex, and that the CSS parser would not be able to do what was being
envisioned (I believe I have that correct - check the thread if you are
truly interested).

Do I still think this is a good idea? You betcha!  Will it ever see the
light of day?  That's the tougher question to contemplate.

Received on Friday, 25 April 2014 15:40:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 October 2015 16:21:51 UTC