Accessibility: recommended alt-text convention for SVG and MathML?

After some digging, I found some somewhat official recommendations. Unfortunately, most are not functional at this point in time. Both the browsers and the screen readers have a lot of to implement before Math and SVG can be considered accessible, but things are starting to look up.

Disclaimer: the below recommendations are what I have gleaned over the past few months of coding. If something is dead wrong, please let me know. I will try to keep this up to date as browsers and AT software progresses.

MathML

Recommendation

Use role="math" along with an aria-label on a surrounding div tag (see docs). The addition of tabindex="0" allows screen readers to focus specifically on this element; this element’s aria-label can be spoken using a special key shortcut (such as NVDA+Tab).

<div role="math" tabindex="0" aria-label="[spoken equivalent]">
  <math xmlns="http://www.w3.org/1998/Math/MathML">
    ...
  </math>
</div>

Limitations/Considerations

  • Sketchy screen reader support on aria-label (and less importantly role="math").
    Update: Relevant NVDA tickets regarding aria-label here and here.
  • Wrapping in div or span tag seems unnecessary since math is a first-class element in HTML5.
  • I found very little referencing the MathML alttext tag.
    Update: this appears to be a DAISY-specific addition, described here.

References

SVG

Recommendation

Use top-level <title> and <desc> tags together with role="img" and aria-label on the root SVG tag.

<svg role="img" aria-label="[title + description]">
  <title>Accessibility: recommended alt-text convention for SVG and MathML?</title>
  <desc>[long description]</desc>
  ...
</svg>

Limitations/Considerations

  • As of February 2011, IE 9 beta reads all <title> and <desc> tags, which is probably undesirable. However, NVDA, JAWS, and WindowEyes will read the aria-label when the element also contains role="img".
  • If loading an SVG file (that is, not inline in HTML), the root-level <title> tag will become the browser page’s title, which will be read by the screen reader.

References

Leave a Comment