RE: Adding ARIA properties to form elements with class names

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
(http://lists.w3.org/Archives/Public/public-webapps/2012JulSep/0508.html).

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.

JF

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