--- title: 5 things I learned about WAI-ARIA (while implementing it myself) date: 2018-10-28 tags: [code, html, a11y] description: I had heard of ARIA. I had skimmed through the specs. Some day I wanted to implement some assistive technology myself. This is when I found some unexpected quirks. --- *I initially submitted this as a talk. Since it was not accepted I turned it into this blog post instead.* Like most web developers I had heard of ARIA. I had skimmed through the specs. But honestly, the [boostrap documentation][1] is still my go-to resource for actual usage. Some day I wanted to implement some assistive technology myself. This is when I found some unexpected quirks. In my opinion, most of these quirks should be fixed. But maybe there are legitimate reasons why things have been defined this way. If you have an opinion on any of these, I would love to hear from you! [1]: http://getbootstrap.com/docs/4.1/components/ ## Building my own assistive technology Most screen readers let you navigate along the headings, links, or landmarks in a page. Since visual scanning is impossible for most visually impaired users, this feature is hugely important in a screen reader. My feeling was that this feature, especially landmark navigation, could also be useful for other users who might not want to install a full-fledged screen reader. There is this whole world of navigation semantics that is not exposed on regular browsers. At the very least, this could be a useful debugging tool for web developers like myself. So I created [a11y-outline][2] as a web extension. In order to do this I had to go down the rabbit hole and look into specs that are normally only relevant for browser vendors. The extension even got some positive feedback. If you try it yourself and find any bugs, please make sure to [report them][3]. [2]: https://addons.mozilla.org/de/firefox/addon/a11y-outline/ [3]: https://github.com/xi/a11y-outline/issues ## ARIA primer So, what is this ARIA thing? First, ARIA is an ontology that describes interactive user interfaces. Second, It also defines a mapping of common HTML semantics to this ontology. For example, an `

` element has the *role* "heading" and the *level* 1. Third, it adds a way to explicitly overwrite the default semantics. For example, `

` is the same as `
`. It is important to note that ARIA does only define semantics, not behavior. `
` will not automatically behave like a button. You have to implement the behavior in JavaScript, or better, use a `