Skip to content

Commit 4a3a75d

Browse files
[23a2a8] Image has non-empty accessible name - Removes Inapplicable Example 1 and adds accessibility support note to cover SVG role exposed differently by browsers (#2290)
* Add accessibility support note to cover SVG elements role inconsistently exposed * Update _rules/image-non-empty-accessible-name-23a2a8.md Co-authored-by: Kevin White <[email protected]> * added SvgRoot term * Apply suggestions from code review * Update _rules/image-non-empty-accessible-name-23a2a8.md --------- Co-authored-by: Kevin White <[email protected]>
1 parent d1cdb8b commit 4a3a75d

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

__tests__/spelling-ignore.yml

+3
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,6 @@
295295
- A-lum-min
296296
- B-lum-max
297297
- B-lum-min
298+
299+
#Browsers Internal Roles
300+
- SvgRoot

_rules/image-non-empty-accessible-name-23a2a8.md

+4-13
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ There are no assumptions.
5858
- There are several popular browsers that do not treat images with an empty `alt` attribute (`alt=""`) as having a role of `presentation` but instead add the `img` element to the accessibility tree with a [semantic role][] of either `img` or `graphic`.
5959
- Implementation of [Presentational Roles Conflict Resolution][] varies from one browser or assistive technology to another. Depending on this, some [semantic][semantic role] `img` elements can fail this rule with some technology but users of other technologies would not experience any accessibility issue.
6060
- Images can have their role set to `presentation` through an empty `alt` attribute. [Presentational Roles Conflict Resolution][] does not specify what to do if such an image is [focusable][] (it only specifies what to do in case of explicit `role="none"` or `role="presentation"`). Some browsers expose these images and some don't. Thus, this rule may fail for technologies that expose these without creating an accessibility issue for users of other technologies.
61+
- `svg` elements have an [implicit role][] of `graphics-document` in [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66). There are popular browsers that do not follow [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66) and instead expose SVG elements with a different [semantic role][], such as `image`, `generic` or `SvgRoot`.
6162

6263
### Bibliography
6364

@@ -196,16 +197,6 @@ This `img` element has an [explicit role][] of `none`. However, it is [focusable
196197

197198
#### Inapplicable Example 1
198199

199-
This `svg` element has an [implicit role][] of `graphics-document`.
200-
201-
```html
202-
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
203-
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
204-
</svg>
205-
```
206-
207-
#### Inapplicable Example 2
208-
209200
This [semantic][semantic role] `img` element is hidden with `aria-hidden` set to "true".
210201

211202
```html
@@ -216,15 +207,15 @@ This [semantic][semantic role] `img` element is hidden with `aria-hidden` set to
216207
></div>
217208
```
218209

219-
#### Inapplicable Example 3
210+
#### Inapplicable Example 2
220211

221212
This `img` element is hidden with `aria-hidden` set to "true".
222213

223214
```html
224215
<img src="/test-assets/shared/w3c-logo.png" aria-hidden="true" />
225216
```
226217

227-
#### Inapplicable Example 4
218+
#### Inapplicable Example 3
228219

229220
This `img` element is hidden because its parent has `display: none`.
230221

@@ -234,7 +225,7 @@ This `img` element is hidden because its parent has `display: none`.
234225
</div>
235226
```
236227

237-
#### Inapplicable Example 5
228+
#### Inapplicable Example 4
238229

239230
This `img` element is hidden with `visibility: hidden`.
240231

0 commit comments

Comments
 (0)