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
Create new rule for image button name descriptive #1673
base: develop
Are you sure you want to change the base?
Conversation
Instead of PR #1184
The rule applies to any HTML `input` element with a `type` attribute in the [`Image Button` state](<https://html.spec.whatwg.org/#image-button-state-(type=image)>), that is [included in the accessibility tree][]. | ||
|
||
**Note:** `input` elements have a `type` attribute in the `Image button` state if it is set to any case-insensitive match of `image` (most of the time, using `<input type="image">`). | ||
|
||
**Note:** The specification of the [`type`](https://html.spec.whatwg.org/#states-of-the-type-attribute) attribute describes in detail how to map the value of the attribute to its corresponding state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are now having a def of attribute value.
The rule applies to any HTML `input` element with a `type` attribute in the [`Image Button` state](<https://html.spec.whatwg.org/#image-button-state-(type=image)>), that is [included in the accessibility tree][]. | |
**Note:** `input` elements have a `type` attribute in the `Image button` state if it is set to any case-insensitive match of `image` (most of the time, using `<input type="image">`). | |
**Note:** The specification of the [`type`](https://html.spec.whatwg.org/#states-of-the-type-attribute) attribute describes in detail how to map the value of the attribute to its corresponding state. | |
The rule applies to any HTML `input` element whose `type` [attribute value][] is `image`, and which is [included in the accessibility tree][]. |
(+ should also be used in the examples descriptions)
|
||
## Assumptions | ||
|
||
- This rule assumes that all image buttons are [user interface components as defined by WCAG 2](https://www.w3.org/TR/WCAG21/#dfn-user-interface-components). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need the assumption here. It is needed to map to 4.1.2 which is concerned about UI components but not to map to 1.1.1 only.
The image button has an [accessible name][] through the `aria-label` attribute that describes its purpose. | ||
|
||
```html | ||
<input type="image" src="/test-assets/shared/local-search-icon.svg" aria-label="Search this page" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep the same image (and accessible name) for all examples unless a different one is needed. Repetition keeps focus on the important bit: the one that changed.
New PR to replace #1184. This only adds the new rule to check that the accessible name of an image button is descriptive, and does not change any existing rules. As decided in discussions about issue #1049.
Closes issue(s):
Need for Final Call:
This will require a 2 weeks Final Call, as it is a new rule.
Pull Request Etiquette
When creating PR:
develop
branch (left side).After creating PR:
Rule
,Definition
orChore
.When merging a PR:
How to Review And Approve