What does accessifyhtml5.js do?


I’m not sure what https://github.com/yatil/accessifyhtml5.js/blob/master/README.textile does.

Does it automatically add roles to elements? Or does it let you use CSS declarations such as [role=“banner”] {…} ?



It automatically adds roles to the elements. It is meant as a polyfill until browsers adds those landmark roles by themselves.

It doesn’t enable CSS3 selectors in browsers who don’t support them.

Since they’re landmark roles (rather than regular roles), how do you make sure there aren’t too many added? (for example, if someone has <header>s in articles and there are several on the page, you’d only want “banner” on the main page <header>, etc)

(yeah I dunno if I dare try to read the jquery lawlz, not my strength)

I see it says “only once per page”… is it using HTML5 document outline to see where those header and footers are?

You can set the ids of the header and footer which are the main ones. This is the only chance to do it and a bit of a hack. I’d recommend to add banner and contentinfo roles directly to the HTML in any case.

thanks :slight_smile: