Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a44519d
Create SC1-1-1-valid-duplicate-accessible-name
Brynanders Sep 11, 2018
51fdd13
Rename SC1-1-1-valid-duplicate-accessible-name to SC1-1-1-valid-dupli…
Brynanders Sep 11, 2018
d8db4c2
Update and rename SC1-1-1-valid-duplicate-accessible-name.md to SC1-1…
Brynanders Sep 11, 2018
6a8cfb2
Update SC1-1-1-valid-duplicate-accessible-name-for-image.md
Brynanders Sep 11, 2018
90ce3c5
Update SC1-1-1-valid-duplicate-accessible-name-for-image.md
Brynanders Sep 17, 2018
009db85
Update and rename SC1-1-1-valid-duplicate-accessible-name-for-image.m…
Brynanders Sep 17, 2018
eb73680
Update and rename SC1-1-1-image-accessible-name-has-placeholder-text.…
Brynanders Sep 18, 2018
7c13e87
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Sep 18, 2018
a351f07
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Sep 26, 2018
7325412
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Sep 26, 2018
820bb66
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Sep 27, 2018
88b13a2
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Oct 1, 2018
3e40c6f
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Oct 1, 2018
c948364
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Oct 4, 2018
f0b7f23
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Oct 4, 2018
f9680bc
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Oct 4, 2018
5966e51
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Oct 8, 2018
52302bc
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Oct 11, 2018
4beb178
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Oct 15, 2018
8387af4
Update SC1-1-1-image-has-name.md
Brynanders Nov 12, 2018
7ae90d3
Update decorative.md
Brynanders Nov 12, 2018
4b49b2a
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Feb 4, 2019
f75294a
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders Feb 4, 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
92 changes: 92 additions & 0 deletions _rules/SC1-1-1-image-accessible-name-is-placeholder-text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
name: Placeholder text is valid accessible name
description: |
This rule checks that image elements that use generic placeholder text 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
---

### Applicability

he 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 has an [accessible name](#accessible-name) that uses [generic placeholder text](#generic-placeholder-text).

### 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

- [https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html)
- [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/TR/WCAG20-TECHS/F30.html)

## Test Cases

### Passed

#### Passed example 1

The element's accessible name uses generic placeholder text which accurately describes the image.

This comment was marked as resolved.

```html
<img alt="spacer"> (need a source file)
```

### Failed

#### Failed example 1

The element's accessible name uses generic placeholder text which does not accurately describes the image.

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

#### Failed example 2

The `input` element with a `type` of `image` has an accessible name that uses generic placeholder text which does not accurately describes the image.

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

### Inapplicable

#### Inapplicable example 1

The image is marked decorative with `alt=""`.

```html
<img src="/background.png" alt="">
```

#### Inapplicable example 2

The image is marked decorative with `role="presentation"`.

```html
<img src="/background.png" role="presentation">
```

#### Inapplicable example 3

The image `alt` value uses generic placeholder but is overidden 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="image" aria-label="modanna lily">
```
4 changes: 1 addition & 3 deletions _rules/SC1-1-1-image-has-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ The rule applies to HTML `img` elements or any HTML element with the [semantic r

Each target element has an [accessible name](#accessible-name) that is [non-empty](#non-empty) or is marked as [decorative](#decorative).

**NOTE**: An `img` element can be marked as decorative, by using either `role="presentation"`, `role="none"` or an empty alt attribute `alt=""`.

## Accessibility Support

There is a known combination of a popular browser and assistive technology that does not by default support `title` as an [accessible name](#accessible-name).
Expand Down Expand Up @@ -127,4 +125,4 @@ Non-image element.
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
</svg>
```
```
2 changes: 1 addition & 1 deletion pages/algorithms/decorative.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ 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. An `img` element can be marked as decorative, by using either `role="presentation"`, `role="none"` or an empty alt attribute `alt=""`.