Overview
HTML5 now allows <svg>
and <math>
markup with an HTML document without depending on external namespaces (decent overview here). Both have their own alt
-attribute analogs (see below) which are effectively ignored by today's screen-reader software. Thus, these elements are inaccessible to blind users.
Are there plans to implement a standard alt-text convention for these new elements? I've scoured the docs and have come up dry!
Futher Details
Regarding SVG: an SVG's alternate text could be considered the contents of the root title
or desc
tag.
<svg>
<title>An image title</title>
<desc>This is the longer image description</desc>
...
</svg>
I've found one screen-reader which reads it as such, but is this standard? Previous methods of inserting SVG also had accessibility issues since <object>
tags are treatedly inconsistently by screen-readers.
Regarding MathML: MathML's alternate text should be stored in the alttext
attribute.
<math alttext="A squared plus B squared equals C squared">
...
</math>
Since screen readers do not seem to acknowledge this, the math-rendering library MathJax inserts text into an aria-label
attribute at run-time.
<span aria-label="[alttext contents]">...</span>
Unfortunately NVDA, JAWS, and others do not reliably read these labels yet either. (More on WAI-ARIA)
Regarding both: lacking success with the largely-unsupported ARIA attributes, I tried using title
attributes. These also seem to be ignored on these "foreign" HTML elements.
Wrap-Up
More than a quick hack, I'm looking for the recommended way to place alternate-text on these new HTML elements. Perhaps there is a W3C spec I'm overlooking? Or is it still just too early in the game?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…