These are some notes on steps we took that improved the accessibility of composed-tree.svg up to its current state (at time of writing), and why each one was worth doing. Note that the order doesn't reflect what we actually did over time, so much as the order we probably should have done things.
Some steps didn't have any practical impact on accessibility as far as we know, and could have been done differently. Reasons for doing them include:
The following steps are all things that directly enhanced the accessibility of the diagram in some way we could test:
longdesc
attribute or as fallback content for an object
element. We should also work out how to use it as an alternate description inside the SVG, but have not done that yet.title
element.title
element found in the document is generally used by browsers as the title of the page, in the same way as the HTML title
element.tabindex="0"
to each node in the diagram.a
element, and place them immediately after the node they link from.tabindex
attributes and reordering the source code to provide more efficient keyboard navigation of the tree. Unfortunately the links don't work properly in some browsers. In addition it is only worth doing if the tree is more than about 6 elements, since there are about three times as many focusable items to move through.g
element with the tabindex
attribute (instead of having it on the use
element that draws the node itself.title
element for each item in the defs
element, and each navigable element (the nodes, links, and the images in the defs
element.title
element according to the specification have been described for more than a decade so there may be more uses we don't know.role="list"
and role="listitem" as appropriate to match the structure of the tree.Some of the things we did were to work around bugs, or deficient implementations. They should not be necessary, but in practice they are worth doing:
aria-labelledby
attributes to things that have title
stitle
is used for the document as a whole, but others seem to be unavailable. This is a bug. Redundant aria-labelledby
is an effective workaround for many browser/screenreader combinations.defs
elements to the screenreader.Please note: This section still needs missing content added
There were bugs and problems on more or less every platform we tested.
No browser/screenreader combination presents the <title>
of an SVG element, other than the first <title>
in the document source, as an "accessible name". Similarly, no browser appears to enable access to the <desc>
element, unless it is referred to by aria-describedby
This is a pretty straightforward failure on something that has been in SVG since last century - perhaps the accessibility equivalent of not actually implementing the <rect>
element.
It seems the SVG is not tab-navigable unless the screen reader is running.
Without <defs aria-hidden="true">
Yandex passes the content of the <defs>
element to VoiceOver
It is apparently not possible to follow a link that points to a target within an SVG document using the keyboard, even with the screen reader running. (Usual approaches like "return", "VO+space" do not work".
Without <defs aria-hidden="true">
Yandex passes the content of the <defs>
element to VoiceOver
Even with <defs aria-hidden="true">
Firefox passes the content of the defs element to VoiceOver
Firefox doesn't appear to support tabindex="0"
in SVG. It is possible for focus to get to nodes by following a link.
Firefox doesn't provide any focus indicator when navigating by keyboard.
Reportedly, IE doesn't actually show anything until the SVG is embedded as inline code in an HTML page. (Can anyone confirm or deny with more detail?)
Thanks are due to Léonie Watson for extensive help with testing, and constructive suggestions on how to resolve problems. Contributions, as pull requests or email to the SVG accessibility task force, are welcome to this document.
This document is on github - feel free to propose changes, offer information about browser support, etc.