From dbd3afa9aee549574646861b9e3d141317eb9799 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 17 Jun 2021 12:49:02 +0200 Subject: [PATCH 1/7] Reject image buttons whose name is Submit Query --- _rules/image-button-non-empty-accessible-name-59796f.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 _rules/image-button-non-empty-accessible-name-59796f.md diff --git a/_rules/image-button-non-empty-accessible-name-59796f.md b/_rules/image-button-non-empty-accessible-name-59796f.md old mode 100644 new mode 100755 index 2fd90d50068..c100013be8f --- a/_rules/image-button-non-empty-accessible-name-59796f.md +++ b/_rules/image-button-non-empty-accessible-name-59796f.md @@ -43,11 +43,12 @@ This rule applies to any `input` element with a `type` [attribute value][] of `i ## Expectation -Each target element has an [accessible name][] that is not empty (`""`). +Each target element has an [accessible name][] that is neither empty (`""`), nor the default name for this element (localized version of "Submit Query"). ## 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). +- This rule assumes that the default name for image buttons ("Submit Query") is not descriptive. ## Accessibility Support @@ -59,6 +60,7 @@ There is a known combination of a popular browser and assistive technology that - [Understanding Success Criterion 1.1.1: Non-text Content](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html) - [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html) - [WCAG Technique H36: Using alt attributes on images used as submit buttons](https://www.w3.org/WAI/WCAG21/Techniques/html/H36) +- [HTML Accessibility API Mappings for computing the accessible name of image buttons](https://www.w3.org/TR/html-aam-1.0/#input-type-image) ## Test Cases From e0fb4c054ccd9aae4398502c48c83ffbcc734ffe Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 23 Sep 2021 14:46:17 +0200 Subject: [PATCH 2/7] Explicitely reject default names --- _rules/image-button-non-empty-accessible-name-59796f.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/_rules/image-button-non-empty-accessible-name-59796f.md b/_rules/image-button-non-empty-accessible-name-59796f.md index f5e62b88f81..3e4339b78a1 100755 --- a/_rules/image-button-non-empty-accessible-name-59796f.md +++ b/_rules/image-button-non-empty-accessible-name-59796f.md @@ -50,7 +50,7 @@ Each target element has an [accessible name][] that is neither empty (`""`), nor ## 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). -- This rule assumes that the default name for image buttons ("Submit Query") is not descriptive. +- This rule assumes that the default name for image buttons ("Submit Query"), as defined by the [HTML Accessibility API Mapping][html aam image button] is never descriptive. ## Accessibility Support @@ -107,7 +107,7 @@ The image button has an [accessible name][] through the `aria-labelledby` attrib #### Failed Example 1 -The image button element has an empty [accessible name][]. The `name` attribute can not be used to provide an [accessible name][]. +The image button element has an [accessible name][] equal to the default "Submit Query". The `name` attribute can not be used to provide an [accessible name][]. ```html @@ -115,7 +115,7 @@ The image button element has an empty [accessible name][]. The `name` attribute #### Failed Example 2 -The image button has an empty `alt` attribute, and no other attributes that can give it an [accessible name][]. +The image button has an empty `alt` attribute, and no other attributes that can give it an [accessible name][], hence its name is the default "Submit Query". ```html @@ -123,7 +123,7 @@ The image button has an empty `alt` attribute, and no other attributes that can #### Failed Example 3 -The image button has an `aria-labelledby` attribute, but the referenced element does not exist. This gives the button an empty [accessible name][]. +The image button has an `aria-labelledby` attribute, but the referenced element does not exist. This gives the button the default [accessible name][] of "Submit Query". ```html @@ -173,4 +173,5 @@ The image button is ignored by assistive technologies because it is not [include [accessible name]: #accessible-name 'Definition of Accessible Name' [attribute value]: #attribute-value 'Definition of Attribute Value' +[html aam image button]: https://www.w3.org/TR/html-aam-1.0/#input-type-image 'HTML Accessibility API Mapping, image button' [included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of Included in the Accessibility Tree' From dbb96bc5b7b2976c2bee5364b7ea06e18437026a Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 23 Sep 2021 14:46:37 +0200 Subject: [PATCH 3/7] Add note that default name for reset and submit button can by good --- _rules/image-non-empty-accessible-name-23a2a8.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_rules/image-non-empty-accessible-name-23a2a8.md b/_rules/image-non-empty-accessible-name-23a2a8.md index edecad71228..7732b216b04 100755 --- a/_rules/image-non-empty-accessible-name-23a2a8.md +++ b/_rules/image-non-empty-accessible-name-23a2a8.md @@ -59,6 +59,8 @@ _There are currently no assumptions._ ## Background +Some elements have a role of `button` and a default accessible name defined by the [HTML Accessibility API Mapping][html aam input button], for example `input` elements whose `type` [attribute value][] is either `submit` or `reset`. This rule consider that these default names can be descriptive and therefore does not fail them. + - [Understanding Success Criterion 1.1.1: Non-text Content](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html) - [G94: Providing short text alternative for non-text content that serves the same purpose and presents the same information as the non-text content](https://www.w3.org/WAI/WCAG21/Techniques/general/G94) - [G95: Providing short text alternatives that provide a brief description of the non-text content](https://www.w3.org/WAI/WCAG21/Techniques/general/G95) @@ -245,8 +247,10 @@ This `img` element is hidden with `visibility: hidden`. ``` [accessible name]: #accessible-name 'Definition of accessible name' +[attribute value]: #attribute-value 'Definition of Attribute Value' [explicit role]: #explicit-role 'Definition of explicit role' [focusable]: #focusable 'Definition of focusable' +[html aam input button]: https://www.w3.org/TR/html-aam-1.0/#input-type-button-input-type-submit-and-input-type-reset 'HTML Accessibility API Mapping, reset and submit buttons' [implicit role]: #implicit-role 'Definition of implicit role' [presentational roles conflict resolution]: https://www.w3.org/TR/wai-aria-1.1/#conflict_resolution_presentation_none 'Presentational Roles Conflict Resolution' [programmatically hidden]: #programmatically-hidden 'Definition of Programmatically Hidden' From 51b49a519b5395cff14ec8b10b7aef5771919d95 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 23 Sep 2021 15:56:13 +0200 Subject: [PATCH 4/7] Move background note to correct rule --- _rules/button-non-empty-accessible-name-97a4e1.md | 5 +++-- _rules/image-non-empty-accessible-name-23a2a8.md | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/_rules/button-non-empty-accessible-name-97a4e1.md b/_rules/button-non-empty-accessible-name-97a4e1.md index f893c6a765d..34db22faa1d 100755 --- a/_rules/button-non-empty-accessible-name-97a4e1.md +++ b/_rules/button-non-empty-accessible-name-97a4e1.md @@ -30,8 +30,6 @@ This rule applies to elements that are [included in the accessibility tree][] an Each target element has an [accessible name][] that is not empty (`""`). -**Note:** `input` elements with a type [attribute value][] of either `submit` or `reset` can get their [accessible name][] from a [default text](https://www.w3.org/TR/html-aam/#input-type-button-input-type-submit-and-input-type-reset), as well as from a `value` or other attribute. - ## Assumptions - The rule assumes that all buttons are [user interface components as defined by WCAG 2](https://www.w3.org/TR/WCAG21/#dfn-user-interface-components). @@ -42,6 +40,8 @@ Each target element has an [accessible name][] that is not empty (`""`). ## Background +Some elements have a role of `button` and a default accessible name defined by the [HTML Accessibility API Mapping][html aam input button], for example `input` elements whose `type` [attribute value][] is either `submit` or `reset`. This rule consider that these default names can be descriptive and therefore does not fail them. + - [Image button has non-empty accessible name](https://act-rules.github.io/rules/59796f) - [HTML Accessibility API Mappings 1.0 (working draft), 5.2 `input type="button"`, `input type="submit"` and `input type="reset"`](https://www.w3.org/TR/html-aam/#input-type-button-input-type-submit-and-input-type-reset) - [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value) @@ -218,6 +218,7 @@ This `button` element has an [explicit role][] of `none`; it is not [focusable][ [attribute value]: #attribute-value 'Definition of Attribute Value' [explicit role]: #explicit-role 'Definition of explicit role' [focusable]: #focusable 'Definition of focusable' +[html aam input button]: https://www.w3.org/TR/html-aam-1.0/#input-type-button-input-type-submit-and-input-type-reset 'HTML Accessibility API Mapping, reset and submit buttons' [included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of included in the accessibility tree' [presentational roles conflict resolution]: https://www.w3.org/TR/wai-aria-1.1/#conflict_resolution_presentation_none 'Presentational Roles Conflict Resolution' [semantic role]: #semantic-role 'Definition of Semantic Role' diff --git a/_rules/image-non-empty-accessible-name-23a2a8.md b/_rules/image-non-empty-accessible-name-23a2a8.md index 7732b216b04..edecad71228 100755 --- a/_rules/image-non-empty-accessible-name-23a2a8.md +++ b/_rules/image-non-empty-accessible-name-23a2a8.md @@ -59,8 +59,6 @@ _There are currently no assumptions._ ## Background -Some elements have a role of `button` and a default accessible name defined by the [HTML Accessibility API Mapping][html aam input button], for example `input` elements whose `type` [attribute value][] is either `submit` or `reset`. This rule consider that these default names can be descriptive and therefore does not fail them. - - [Understanding Success Criterion 1.1.1: Non-text Content](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html) - [G94: Providing short text alternative for non-text content that serves the same purpose and presents the same information as the non-text content](https://www.w3.org/WAI/WCAG21/Techniques/general/G94) - [G95: Providing short text alternatives that provide a brief description of the non-text content](https://www.w3.org/WAI/WCAG21/Techniques/general/G95) @@ -247,10 +245,8 @@ This `img` element is hidden with `visibility: hidden`. ``` [accessible name]: #accessible-name 'Definition of accessible name' -[attribute value]: #attribute-value 'Definition of Attribute Value' [explicit role]: #explicit-role 'Definition of explicit role' [focusable]: #focusable 'Definition of focusable' -[html aam input button]: https://www.w3.org/TR/html-aam-1.0/#input-type-button-input-type-submit-and-input-type-reset 'HTML Accessibility API Mapping, reset and submit buttons' [implicit role]: #implicit-role 'Definition of implicit role' [presentational roles conflict resolution]: https://www.w3.org/TR/wai-aria-1.1/#conflict_resolution_presentation_none 'Presentational Roles Conflict Resolution' [programmatically hidden]: #programmatically-hidden 'Definition of Programmatically Hidden' From a7ee827ba971670e79f4af7be61baba4d776f426 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 23 Sep 2021 16:33:09 +0200 Subject: [PATCH 5/7] Typo --- _rules/button-non-empty-accessible-name-97a4e1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_rules/button-non-empty-accessible-name-97a4e1.md b/_rules/button-non-empty-accessible-name-97a4e1.md index 34db22faa1d..3ebf4c91d67 100755 --- a/_rules/button-non-empty-accessible-name-97a4e1.md +++ b/_rules/button-non-empty-accessible-name-97a4e1.md @@ -40,7 +40,7 @@ Each target element has an [accessible name][] that is not empty (`""`). ## Background -Some elements have a role of `button` and a default accessible name defined by the [HTML Accessibility API Mapping][html aam input button], for example `input` elements whose `type` [attribute value][] is either `submit` or `reset`. This rule consider that these default names can be descriptive and therefore does not fail them. +Some elements have a role of `button` and a default accessible name defined by the [HTML Accessibility API Mapping][html aam input button], for example `input` elements whose `type` [attribute value][] is either `submit` or `reset`. This rule considers that these default names can be descriptive and therefore does not fail them. - [Image button has non-empty accessible name](https://act-rules.github.io/rules/59796f) - [HTML Accessibility API Mappings 1.0 (working draft), 5.2 `input type="button"`, `input type="submit"` and `input type="reset"`](https://www.w3.org/TR/html-aam/#input-type-button-input-type-submit-and-input-type-reset) From 3738bb1c09fb79cf76863e7200ea51f3f8cb7bc2 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 7 Oct 2021 14:07:42 +0200 Subject: [PATCH 6/7] Move note to assumption --- _rules/button-non-empty-accessible-name-97a4e1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_rules/button-non-empty-accessible-name-97a4e1.md b/_rules/button-non-empty-accessible-name-97a4e1.md index 3ebf4c91d67..ab652d58bf6 100755 --- a/_rules/button-non-empty-accessible-name-97a4e1.md +++ b/_rules/button-non-empty-accessible-name-97a4e1.md @@ -38,9 +38,9 @@ Each target element has an [accessible name][] that is not empty (`""`). - Implementation of [Presentational Roles Conflict Resolution][] varies from one browser or assistive technology to another. Depending on this, some elements can have a [semantic role][] of `button` and fail this rule with some technology but users of other technologies would not experience any accessibility issue. -## Background +- Some elements have a role of `button` and a default accessible name defined by the [HTML Accessibility API Mapping][html aam input button], for example `input` elements whose `type` [attribute value][] is either `submit` or `reset`. This rule considers that these default names can be descriptive and therefore does not fail them. -Some elements have a role of `button` and a default accessible name defined by the [HTML Accessibility API Mapping][html aam input button], for example `input` elements whose `type` [attribute value][] is either `submit` or `reset`. This rule considers that these default names can be descriptive and therefore does not fail them. +## Background - [Image button has non-empty accessible name](https://act-rules.github.io/rules/59796f) - [HTML Accessibility API Mappings 1.0 (working draft), 5.2 `input type="button"`, `input type="submit"` and `input type="reset"`](https://www.w3.org/TR/html-aam/#input-type-button-input-type-submit-and-input-type-reset) From 16dd4ebdb3adb0afd297d37e274a0104513a6c20 Mon Sep 17 00:00:00 2001 From: Jean-Yves Moyen Date: Thu, 7 Oct 2021 14:34:10 +0200 Subject: [PATCH 7/7] Typo Co-authored-by: Trevor R. Bostic <32486143+tbostic32@users.noreply.github.com> --- _rules/image-button-non-empty-accessible-name-59796f.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_rules/image-button-non-empty-accessible-name-59796f.md b/_rules/image-button-non-empty-accessible-name-59796f.md index 3e4339b78a1..15fa6803caf 100755 --- a/_rules/image-button-non-empty-accessible-name-59796f.md +++ b/_rules/image-button-non-empty-accessible-name-59796f.md @@ -50,7 +50,7 @@ Each target element has an [accessible name][] that is neither empty (`""`), nor ## 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). -- This rule assumes that the default name for image buttons ("Submit Query"), as defined by the [HTML Accessibility API Mapping][html aam image button] is never descriptive. +- This rule assumes that the default name for image buttons ("Submit Query"), as defined by the [HTML Accessibility API Mapping][html aam image button], is never descriptive. ## Accessibility Support