Skip to content

Commit 27ed9f8

Browse files
[e88epe] Image not in the accessibility tree is decorative - Updated decorative SVG examples + Accessibility support notes (#2321)
* Update image-not-in-acc-tree-is-decorative-e88epe.md * Update image-not-in-acc-tree-is-decorative-e88epe.md * Update image-not-in-acc-tree-is-decorative-e88epe.md
1 parent 8a5f97a commit 27ed9f8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

_rules/image-not-in-acc-tree-is-decorative-e88epe.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ Each test target is [purely decorative][].
6262

6363
### Accessibility Support
6464

65-
There are no accessibility support issues known.
65+
According to the [WAI-ARIA Graphics Module](https://www.w3.org/TR/graphics-aria-1.0/) specification, the `role="graphics-document"` requires an accessible name. Additionally, the [SVG Accessibility API Mappings](https://www.w3.org/TR/svg-aam-1.0/) set the default ARIA role for SVG elements to `graphics-document`, and [ARIA in HTML](https://www.w3.org/TR/html-aria/) maps the `<svg>` element to the same role.
66+
67+
However, browser implementations vary. Some browsers expose `<svg>` elements without accessible names as images without alternative text. To address this, in the passed and inapplicable examples where the `<svg>` element is intended to be purely decorative, the `role="none"` attribute has been added.
6668

6769
### Bibliography
6870

@@ -102,11 +104,11 @@ This `img` element that is ignored by assistive technologies because it has an [
102104

103105
#### Passed Example 4
104106

105-
This `svg` element that is ignored by assistive technologies because it has no attribute that would give it an [accessible name][] is [purely decorative][].
107+
This `svg` element that is ignored by assistive technologies because it has no attribute that would give it an [accessible name][] is [purely decorative][]. Because some browsers expose the `svg` element with the `image` role, the `role="none"` attribute has been added to guarantee its presentational role.
106108

107109
```html
108110
<p>Happy new year!</p>
109-
<svg height="200" xmlns="http://www.w3.org/2000/svg">
111+
<svg height="200" xmlns="http://www.w3.org/2000/svg" role="none">
110112
<polygon points="100,10 40,180 190,60 10,60 160,180" fill="yellow" />
111113
</svg>
112114
```
@@ -224,11 +226,11 @@ This `img` element is not [visible][] because it is positioned off screen.
224226

225227
#### Inapplicable Example 4
226228

227-
This `svg` element is ignored because it is a child of a link that provides its [accessible name][].
229+
This `svg` element is ignored because it is a child of a link that provides its [accessible name][]. Because some browsers expose the `svg` element with the `image` role, the `role="none"` attribute has been added to guarantee its presentational role.
228230

229231
```html
230232
<a href="https://example.org" aria-label="SVG star">
231-
<svg height="200" xmlns="http://www.w3.org/2000/svg">
233+
<svg height="200" xmlns="http://www.w3.org/2000/svg" role="none">
232234
<polygon points="100,10 40,180 190,60 10,60 160,180" fill="yellow" />
233235
</svg>
234236
</a>

0 commit comments

Comments
 (0)