Notes on making the W3C process diagrams accessible
The rectrack.svg and revisedrec2.svg diagrams are taken from the 2014 version of the W3C Process Document, where they are embedded within the HTML source. rectrack-note.svg is a new extended version of rectrack.svg, intended to be added to a revision of the Process Document.
At the time of writing, revisedrec2 is the most advanced version, with changes that are yet to be ported to the others if they turn out to be good. It also has several different approaches to connecting major nodes - after some testing, I'll probably work out which one is better and use that everywhere.
Note that some browsers have different behaviour when dealing with SVG as standalone files and when it is embedded in HTML. For example, Internet Explorer reportedly can't do anything at all with standalone SVG.
To test them as code embedded in HTML, instead of standalone SVG, see below:
The graphic is a relatively simple flowchart (mathematically an example of a "directed graph"). There are 5 real states, and an implicit state, and documents can move between these states by meeting requirements that vary according to the particular transition.
Cleaning the source
The original diagram was hand-coded, and so nothing was needed beyond adding accessibility features.
The states which are represented by the nodes of the graph are links, which in the original context point to various parts of the document in which the SVG was embedded. This means they are already tabbable, and because they all contain text, have a readily generated and short accessible name.
Adding accessibility
Use title for important objects
The diagram was given title elements throughout the structure. It still needs an overall desc to be added
Use aria-labelledby for titles
To cope with poor browser support for native accessibility, aria-labelledby attributes were added to all navigable objects. They refer to both the title, and the text content
Use role="none" to hide text nodes which are explicitly referred to by aria-labelledby.
text elements were generally given role="none" unless they were part of a link, in order to stop the text appearing again in the reading order for a screenreader
fill="#fff" instead of fill="none"
Graphic objects were given a white fill instead of none, to make it easier to hover them and get tooltips generated from their title elements.
ARIA list markup
The whole diagram is treated as a list, and then each node, along with the edges leading away from it is also treated as a list. There are two "loose" g elements - the links from the implicit "no state" to become a Note or First Draft. Otherwise the nodes, which are lists are just floating within the main g which has role="list". On Safari and Yandex.browser for Mac with VoiceOver this seems to work as well as wrapping each list in an element with role="listitem".
Note: Windows browsers with JAWS do not seem to recognise items in a list unless they are explicitly marked with role="listitem" while browsers with VoiceOver seem to do so at least in some cases
Matching labelling text to the relevant path
There is a minimal use of colour to make association easier - but it is not necessary, and being low-contrast is only useful to some people anyway. Text labels are also associated by being contained within the same element in the source, and by being very close to the relevant path in the layout.
Highlight currently focused object(s)
I added a stylesheet that provides a highlight effect for currently focused or hovered items
This should probably be restricted to apply to e.g. g[role=listitem] so it can be used more generally, but I'll have to play with that a bit more
Use links to make connections navigable
Where there are one-way connections, wrap the in a link. This makes them navigable by the keyboard, and should make it possible to explore the flowchart. Unfortunately links don't seem to work in some browsers.
Use tabindex="0" to make objects navigable.
This allows a user to explore the diagram's important components using keyboard navigation. It is helpful in conjunction with the highlighting mentioned above, but it doesn't work in at least Firefox/Mac.
There is no way of navigating a listitem - although that is also true for HTML <li> elements unless thay have tabindex="0"…
Following links is broken
When focused on a link to a valid internal fragment, pressing return takes the focus away, but it is unclear where it goes. The address in the URL bar does reflect the target of the link. Pressing tab again moves the focus to the first item in the taborder. If the link destination is a fragment identifier that doesn't exist, focus stays where it was.
Safari Mac OS X 10.10.5
<g role="listitem" is useless
There is no way of navigating a listitem - although that is also true for HTML <li> elements unless thay have tabindex="0"…
Semi-random tab bug
There is a bug which I cannot reproduce reliably. The result is that the image loses the tab focus, and there appears to be no reliable way to get back to the image using only the keyboard. However, a workaround I successfully applied on a single attempt was to load the same image in a new tab.
Following links is broken
There seems to be no way to follow valid internal links from the keyboard, and clicking them with the mouse seems to do nothing. Links that point to a fragment id which doesn't actually exist change the URL in the address bar, but not those that point to valid fragments.
Firefox 42.0 Mac OS X 10.10.5
<g role="listitem" is useless
There is no way of navigating a listitem - although that is also true for HTML <li> elements unless thay have tabindex="0"…
tabindex="0" doesn't work
When using the tab key to navigate Firefox only seems to focus links.
visual focus disappears if linking to an inactive element
When following a link to something that isn't itself a link, the visual focus indicator disappears. The link was clearly followed, because pressing tab brings the focus indicator back again, on the first recognised active element after the target of the link.
In order to keep keyboard navigation simple, only the nodes are tabbable. It would be nice to make it possible to move from nodes to follow any of the links that are visually represented, but Safari seems not to follow links in SVG, Firefox doesn't show that they are links, and it might make navigation more complex, so I haven't tried doing it for now.
If aria-flowtoworked it would be useful, but as far as I know it works in one screenreader on two browsers on one OS - i.e. is useful only to a tiny proportion of the people who need to navigate the structure. I expect to do some more experiments using tabindex and links.