Question regarding role=directory, the usage and purpose is unclear

Hi,
I've been experimenting with TOC formats, and built out a somewhat complex one at
http://whatsock.com/training

Actually I wrote a script to do this, it would be nuts to do it by hand. It uses a simulated button, named Table of Contents, which includes aria-expanded to convey the correct state. The script iterates through all heading tags in a linear order from top to bottom, maps the levels, then builds out standard UL elements with the correct nesting order for all subgroupings.

I also have it set aria-label on each nested UL so that it conveys the parent association in the naming calculation, which I like the sound of, because as you arrow down the list using a screen reader with a virtual offscreen model like JAWS, it is clear in context which nesting level you are entering into or out of.

So I was looking at the ARIA spec, remembering that there was a directory role that should be applicable here too, documented at
http://www.w3.org/TR/wai-aria-1.1/#directory
But it's not clear to me how this should fit into my table of contents markup.

For example, it implies that this should be used on the list element, where it states:

"Superclass Role: list"

If I do this though, it destroys my list within the accessibility tree.

If instead I put it on the surrounding container, it doesn't appear to do anything.

So, does anybody know what role=directory is supposed to do and how it is supposed to be used?

Thanks,
Bryan

Received on Monday, 13 April 2015 01:06:52 UTC