WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: SVG graphics best practise of hiding content.

for

From: Jonathan Avila
Date: Feb 21, 2020 10:28AM


Hi Birkir, regarding SVG elements -- the SVG API Mappings document indicates they must be part of the accessiblity tree when certain situations are included https://w3c.github.io/svg-aam/#include_elements and also excluded when certain situations occur -- but it's not clear that user agents mut mark them decorative. So I find this actually to be a very complex topic I've dropped some standard SVG elements into Chrome and Chrome seems to show an svg with circle inside as SVG root for the SVG and ignored for the circle. So Chrome seems to include SVGs which have a graphics-document implied role as being in the tree and correctly ignore the circle element. So I'd say it's safer to mark the SVG explicitly as role presentation or aria-hidden if decorative.

Jonathan