Testing Labeling Icons
This exercise seeks to find the best method to give a text alternative to an SVG icon, whether it is used alone or inside of an anchor or button.
Text alternatives described the shape of the icons: "circle", "square", "triangle".
Three different methods were tried:
- Accessibly hiding a text alternative in a span
- Using the SVG title element
- Using aria-label
The conclusion seems to be that:
- accessibly hidden text is the most reliable
- SVG's title element is only supported in IE
- aria-label isn't supported at all in non-actionable elements
- in VO for iOS anchors without text inside are undiscoverable (therefore using aria-label is pointless)
- By the way, using aria-label on an actionable that has text will read the aria-label INSTEAD of the text.
Three tables of results can be found at the botom of the page.
Experiments
Experiment 1: SVG icons for non-actionable DOM elements
circle
The previous icon uses hidden screen-reader-text.
The previous icon uses the SVG title element.
The previous icon uses aria-label on the SVG element.
Experiment 2: SVG icons for links
circle
The previous link with icon uses hidden screen-reader-text.
Experiment 3: SVG icons for buttons
The previous button with icon uses hidden screen-reader-text.
The previous button with icon uses the SVG title element.
The previous button with icon uses aria-label on the button element.
Browser Combo | hidden text | svg title | aria-label | notes |
---|---|---|---|---|
VO Safari Mac | reads | doesn't read | doesn't read | |
VO Chrome Mac | reads | doesn't read | doesn't read | |
VO Firefox Mac | reads | doesn't read | doesn't read | |
NVDA Firefox PC | reads | doesn't read | doesn't read | |
JAWS IE PC | reads | reads | doesn't read | |
VO Safari iOS | reads | doesn't read | doesn't read |
Browser Combo | hidden text | svg title | aria-label | notes |
---|---|---|---|---|
VO Safari Mac | reads | doesn't read | reads | |
VO Chrome Mac | reads | doesn't read | reads | |
VO Firefox Mac | reads | doesn't read | reads | |
NVDA Firefox PC | reads | doesn't read | reads | |
JAWS IE PC | reads | reads | reads | |
VO Safari iOS | reads | doesn't recognize link* | doesn't recognize link* | *in iOS VO can't discover a link without text |
Browser Combo | hidden text | svg title | aria-label | notes |
---|---|---|---|---|
VO Safari Mac | reads | doesn't read | reads | |
VO Chrome Mac | reads | doesn't read | reads | |
VO Firefox Mac | reads | doesn't read | reads | |
NVDA Firefox PC | reads | doesn't read | reads | |
JAWS IE PC | reads | reads | reads | |
VO Safari iOS | reads | doesn't read | reads |