Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
25116ec
Create SC1-1-1-accessible-name-is-image-file-name.md
Brynanders Sep 18, 2018
3538512
Update SC1-1-1-accessible-name-is-image-file-name.md
Brynanders Sep 26, 2018
88c201f
Update SC1-1-1-accessible-name-is-image-file-name.md
Brynanders Sep 26, 2018
fc9a500
Update SC1-1-1-accessible-name-is-image-file-name.md
Brynanders Sep 26, 2018
17ae1b5
Update SC1-1-1-accessible-name-is-image-file-name.md
Brynanders Sep 26, 2018
8de0bbb
Update SC1-1-1-accessible-name-is-image-file-name.md
Brynanders Oct 1, 2018
64f132b
Update SC1-1-1-accessible-name-is-image-file-name.md
Brynanders Oct 1, 2018
5572ad8
Update SC1-1-1-accessible-name-is-image-file-name.md
Brynanders Oct 4, 2018
8e12152
Update and rename SC1-1-1-accessible-name-is-image-file-name.md to SC…
Brynanders Oct 4, 2018
bbd3060
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 4, 2018
7aa2c6d
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 4, 2018
8e2abf7
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 8, 2018
50c8d71
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 8, 2018
c01470c
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 8, 2018
cfe3299
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 8, 2018
77cb7c4
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 8, 2018
934326a
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 8, 2018
71a10e2
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 8, 2018
e605dd1
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 11, 2018
d5edb78
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 15, 2018
1f8b12e
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 29, 2018
d3fe69b
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 29, 2018
f865550
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 30, 2018
7e2b5fb
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 30, 2018
00eb1e9
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Oct 30, 2018
fc0e99f
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Nov 7, 2018
5c5ba17
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Nov 7, 2018
5da2252
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Nov 12, 2018
7450d01
Update decorative.md
Brynanders Nov 12, 2018
c3cc169
Update SC1-1-1-image-has-name.md
Brynanders Nov 12, 2018
c82bdae
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Nov 20, 2018
8207556
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Nov 20, 2018
5527a16
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Nov 20, 2018
94fe44b
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Dec 3, 2018
4665845
Fixed typo
Dec 11, 2018
ad61d73
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Dec 13, 2018
00b4e1c
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Dec 21, 2018
865ee36
merge from master
WilcoFiers Jan 9, 2019
92454d7
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Jan 18, 2019
da97527
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Jan 22, 2019
5c11da3
Update decorative.md
Brynanders Jan 22, 2019
452db0f
Update decorative.md
Brynanders Jan 28, 2019
865c0b6
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 1, 2019
8f99add
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 1, 2019
e713912
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 1, 2019
ab08215
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 1, 2019
c3a60dc
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 4, 2019
e522382
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 4, 2019
5addee3
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 4, 2019
9a54d3e
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 4, 2019
ebb8c07
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 5, 2019
8868f17
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 5, 2019
e675926
fixed spelling/typing errors
ShadowBB Feb 6, 2019
d706ff7
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 27, 2019
c4fdd97
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Feb 27, 2019
9c2d682
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Mar 5, 2019
4c0faf8
Update SC1-1-1-accessible-name-is-image-filename.md
Brynanders Mar 5, 2019
64c5739
Merge branch 'master' into Brynanders-patch-2
jeeyyy Mar 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions _rules/SC1-1-1-accessible-name-is-image-filename.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
name: Filename is valid accessible name
description: |
This rule checks that image elements that use their source filename as their accessible name do so without loss of information to the user.

success_criterion:
- 1.1.1 # Non-Text Content

test_aspects:
- DOM Tree
- CSS Styling

authors:
- Bryn Anderson
---

## Test procedure

### Applicability

The rule applies to any HTML `input` element with a [`type`](https://www.w3.org/TR/html/sec-forms.html#dom-htmlinputelement-type) of `image`, or any HTML element with the [semantic role](#semantic-role) of `img`, that is [included in the accessibility tree](#included-in-the-accessibility-tree), and has an [accessible name](#accessible-name) that is equivalent to the [filename](#filename) specified in the `src` attribute. Difference in letter casing, and forward and trailing whitespace should be ignored.

### Expectation

Each test target has an accessible name that serves an equivalent purpose to the [non-text content](https://www.w3.org/TR/WCAG21/#dfn-non-text-content).

## Assumptions

*There are currently no assumptions*

## Accessibility support

*There are no major accessibility support issues known for this rule.*

## Background

- [Understanding Success Criterion 1.1.1: Non-text Content](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html)
- [F30: Failure of Success Criterion 1.1.1 and 1.2.1 due to using text alternatives that are not alternatives (e.g., filenames or placeholder text)](https://www.w3.org/WAI/WCAG21/Techniques/failures/F30)

## Test Cases

### Passed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem like any of the passed / failed examples would be applicable. The applicability doesn't say to ignore file extensions or its file path.

Copy link
Collaborator Author

@Brynanders Brynanders Mar 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilcoFiers the applicability refers to a definition of "filename" https://github.com/auto-wcag/auto-wcag/blob/master/pages/glossary/filename.md which excludes the file path and appended query strings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WilcoFiers @kasperisager and I have reworked some of the test cases to fit the applicability. Please can you give this another look.


#### Passed example 1

The `img` element's accessible name uses the filename which accurately describes the image.

```html
<img src="https://www.w3.org/WAI/demos/bad/img/w3c" alt="w3c">
```

#### Passed example 2

The `img` element's accessible name uses the filename, which in combination with the `a` element accurately describes the image.

```html
<a href="https://www.w3.org/WAI/demos/bad/img/w3c.png" download>Download <img src="w3c.png" alt="w3c.png"></a>
```

### Failed

#### Failed example 1

The `img` element's accessible name matches the image filename. However the presence of the file extension in the accessible name is redundant and results in the accessible name not accurately describing the image.

```html
<img src="https://www.w3.org/WAI/demos/bad/img/w3c.png" alt="w3c.png">
```

#### Failed example 2

The `input` element with a `type` of `image` has an accessible name that matches the filename. However the presence of the file extension in the accessible name is redundant and results in the accessible name not accurately describing the image.

```html
<input type="image" src="https://www.w3.org/WAI/demos/bad/before/img/top_weather.gif" alt="top_weather.gif">
```

### Inapplicable

#### Inapplicable example 1

The `img` element doesn't have the semantic role of image.

```html
<img role="presentation">
```

#### Inapplicable example 2

The `img` element is not included in the accessibility tree.

```html
<img style="display:none;">
```

#### Inapplicable example 3

The `img` element's accessible name is not equivalent to the file name specified in the `src` attribute.

```html
<img src="https://www.w3.org/WAI/demos/bad/after/img/teaser_right2.jpg" alt="modanna lily">
```

#### Inapplicable example 4

The `img` element's `alt` attribute matches the filename but is overridden by the `aria-label` value which takes precedence in the accessible name calculation.

```html
<img src="https://www.w3.org/WAI/demos/bad/after/img/teaser_right2.jpg" alt="teaser_right2.jpg" aria-label="modanna lily">
```
10 changes: 10 additions & 0 deletions _rules/SC1-1-1-image-has-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,13 @@ HTML `img` element is not [included in the accessibility tree](#included-in-the-
```html
<img alt="W3C logo" aria-hidden="true" />
```

#### Inapplicable example 4

Non-image element.

```html
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
```
4 changes: 3 additions & 1 deletion pages/glossary/decorative.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ title: Decorative
key: decorative
---

Serving only an aesthetic purpose, providing no information, and having no functionality.
Serving only an aesthetic purpose, providing no information, and having no functionality.

**Note:** Authors can mark an `img` element as decorative to indicate that it should be ignored by assistive technology by using either `role="presentation"`, `role="none"`, or `alt=""`. An element should only be marked as decorative if removing the element does not cause a loss of information to the user.
Copy link
Collaborator

@EmmaJP EmmaJP Feb 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any elements other than 'img' that could be marked as decorative, such as 'svg'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The context of this rule is img so the note addresses that specifically and not other elements.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could change this to say "Authors can mark elements as decorative..." if you think that would make more sense?