-
Notifications
You must be signed in to change notification settings - Fork 79
SC1-1-1-placeholder-text-is-valid-accessible-name #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
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 51fdd13
Rename SC1-1-1-valid-duplicate-accessible-name to SC1-1-1-valid-dupli…
Brynanders d8db4c2
Update and rename SC1-1-1-valid-duplicate-accessible-name.md to SC1-1…
Brynanders 6a8cfb2
Update SC1-1-1-valid-duplicate-accessible-name-for-image.md
Brynanders 90ce3c5
Update SC1-1-1-valid-duplicate-accessible-name-for-image.md
Brynanders 009db85
Update and rename SC1-1-1-valid-duplicate-accessible-name-for-image.m…
Brynanders eb73680
Update and rename SC1-1-1-image-accessible-name-has-placeholder-text.…
Brynanders 7c13e87
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders a351f07
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders 7325412
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders 820bb66
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders 88b13a2
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders 3e40c6f
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders c948364
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders f0b7f23
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders f9680bc
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders 5966e51
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders 52302bc
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders 4beb178
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders 8387af4
Update SC1-1-1-image-has-name.md
Brynanders 7ae90d3
Update decorative.md
Brynanders 4b49b2a
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders f75294a
Update SC1-1-1-image-accessible-name-is-placeholder-text.md
Brynanders File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
_rules/SC1-1-1-image-accessible-name-is-placeholder-text.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
Sorry, something went wrong. |
||
| ```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"`. | ||
|
|
||
Brynanders marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ```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"> | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.