In the spirit of progressive enhancement, I'd like to do some ARIA capabilities testing to implement additional enhancements if they're supported by the browser. I'm not looking to detect screen readers—I'm looking to ensure that screen reader users will get the optimal experience given the tools that they're using.
For example, if the aria-live
attribute is not supported, then it may not be a good idea to implement endless scrolling.
I'm aware that there's an additional concern that browsers may support these attributes but the screen reader may not. Since screen readers run transparently over browsers, I'm okay with that edge case being ignored.
I've never heard of anyone doing anything like this. Is it as easy as testing for additional DOM properties endowed by browsers? Do one of Mark Pilgrim's other capability testing techniques work here?
Thanks!
aria-*
attributes have any effect on the current browser? So if supporting browsers (conflating browsers and any accessibility plugins) consistently made sure thataria-selected
had a value oftrue
,false
, orundefined
as required by w3.org/WAI/PF/aria/states_and_properties#aria-selected then the JavaScriptvar div = document.createElement('DIV'); div.setProperty('aria-selected', 'bogus'); if (div.getProperty('aria-selected') != 'bogus') { alert('aria supported'); }
would work? – Dolan