> From: Chris Knowles
> I wouldn't be waiting for ARIA to get out of draft before using it :) It
> has pretty good support in browsers already so get stuck in. And because
> essentially all you are doing with ARIA is adding attributes to tags,
> the worst that can happen is your pages no longer validate - but who
> cares if you are making them more accessible?

I think validation is still important to ensure a consistent and future-proof 
experience across browsers, but ARIA is definitely needed. So seeing as ARIA 
attributes are there to offer a solution to problems introduced by JavaScript, 
why don't we use JavaScript to add the ARIA attributes. Using a similar idea to 
my Performer script [1] we could add these using CSS:

<p id="updates" class="aria-live-polite">This content will be updated by an 
AJAX-type script</p>

A simple script could parse all elements in the DOM tree, and anything with the 
class "aria-live-polite" add the attribute "aria-live" with a value of 
"polite". If this was done before any other JavaScript was run it would prepare 
the page with ARIA attributes before it is needed, whilst keeping the code 
validating. The resulting code in this example would be:

<p id="updates" class="aria-live-polite" aria-live="polite">This content will 
be updated by an AJAX-type script</p>

Of course, elements with ARIA classes could be styled differently if required:

.aria-live-polite { border: 1px dotted #CCC; }

If JavaScript is not present or disabled, the ARIA attributes will not get 
applied. But that won't be a problem, as no other JavaScript will be run anyway.

There are actually a lot of ARIA attribute variations so this idea may not 
scale very well, but for simple use it may be a suitable answer to the ARIA / 
validation problem.

Chris

[1] http://performerjs.org - add JavaScript features using just CSS classes and 
standard attributes. New website and lots more features coming very soon. Get 
in touch if you'd be interested in helping / testing.


This message has been scanned for malware by SurfControl plc. 
www.surfcontrol.com

*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*******************************************************************

Reply via email to