w3c / svgwg

SVG Working Group specifications
Other
705 stars 132 forks source link

Multilingual titles and ARIA fallbacks don't work well together #116

Open chaals opened 8 years ago

chaals commented 8 years ago

if you use e.g.

<rect width="100" height="100" aria-labeledby="fr-title-1 en-title-1 es-title-1">
  <title lang="fr" id="fr-title-1">Assez carré</title>
  <title lang="en" id="en-title-1">Sort of square</title>
  <title lang="es" id="es-title-1">Es quadrilateral por lo menos</title>
</rect>

The multilingual selection model won't work with the ARIA name calculation, as written today.

chaals commented 8 years ago

(Note that this is according to the SVG2 spec, but doesn't actually work in any known browser anyway)

AmeliaBR commented 8 years ago

The SVG-AAM specifically defers to the SVG 2 mutlilingual language rules. So there is not a conflict there. If a user agent supports SVG-AAM, they do not need an aria-labelledby attribute at all.

The only reason aria-labelledby is commonly added is because of user agents that do not support proper SVG accessibility mappings. However, since (in a conforming browser), aria-labelledby takes precedence over <title>, that creates the problem: if you provide fallback explicit labelling for old browsers, you would override the language-sensitive automatic labelling.

I don't think there is any way to fix this in the spec (SVG 2 or SVG-AAM). We can't make special language-selection rules for aria-labelledby in conforming browsers, because the ARIA specs already define the meaning of multiple labels: concatenate the text together.

Frankly, given the relative rates of adoption of proper <title> accessibility support (pretty good) verus multilingual <title> support (slow so far), I don't think this is worth changing spec.

The best solution would be to make available a JavaScript polyfill for <title> accessibility fallbacks (i.e., one that adds in the id and aria-labelledby attributes) that is also language sensitive (so it links to the correct option). If anyone wants to create such a thing, we could officially endorse it in the Authoring Practices Guide.