From 852327589662b20a4b7c2c6284548f13bad8341a Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Wed, 18 Jan 2023 14:43:17 +0100 Subject: [PATCH 01/12] ARIA state or property: various editorial improvements --- ...ia-state-or-property-valid-value-6a7281.md | 117 ++++++++---------- 1 file changed, 54 insertions(+), 63 deletions(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index 5c59d39818..ef47e95fc1 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -28,19 +28,17 @@ acknowledgments: ## Applicability -This rule applies to any [WAI-ARIA 1.2 state or property](https://www.w3.org/TR/wai-aria-1.2/#state_prop_def) that is not empty (""), and that is specified on an [HTML or SVG element][]. +This rule applies to any [WAI-ARIA state or property][] that has a non-empty ("") [attribute value][], and that is specified on an [HTML or SVG element][]. ## Expectation -Each test target has a valid value according to its [WAI-ARIA 1.2 value type](https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value). +Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type]. -For value types `ID Reference` and `ID Reference List` for [WAI-ARIA required properties](https://www.w3.org/TR/wai-aria-1.2/#requiredState) at least one of the elements with the given ids exists in the same [document tree](https://dom.spec.whatwg.org/#document-trees) or in the same [shadow tree](https://dom.spec.whatwg.org/#shadow-trees) as the element that specifies the target attribute. - -For value type `URI` the value matches the [generic URI syntax](https://www.ietf.org/rfc/rfc3986.txt). +**Exception**: For `ID Reference` and `ID Reference List` value types, if the test target is not a [WAI-ARIA required states and properties][] for the [semantic role][] of its element, no ID referenced elements are required. Otherwise at least one of the elements with the given IDs exists in the same [document tree][] or in the same [shadow tree][] as the test target's element. ## Assumptions -This rule catches values that are undefined in [WAI-ARIA Specifications][], and where the resulting behavior in user agents are also undefined in WAI-ARIA. This might lead to accessibility issues, if the intention was to use behavior defined in [WAI-ARIA Specifications][]. When values are used that do not have a defined behavior in [WAI-ARIA Specifications][], the HTML/SVG specification decides what default values should be used, since it is defined here what should happen when an invalid value is used for an attribute. If the default value for invalid attribute values happens to match the author's intention for the value, there will not be an accessibility issue. +There are no assumptions. ## Accessibility Support @@ -48,11 +46,9 @@ Some user agents treat the value of `aria-*` attribute as case-sensitive (even w ## Background -Using invalid ARIA attribute values is often the result of a typo or other developer error. These attributes are then either ignored, or a default value is assumed by browsers and assistive technologies. This often means that a state or property which should exist is missing or has an unexpected value. This can cause issues under [success criterion 1.3.1 Info and Relationships][sc131] or [4.1.2 Name, Rule Value][sc412]. - -Only for [WAI-ARIA required properties](https://www.w3.org/TR/wai-aria-1.2/#requiredState) with value types `ID Reference` and `ID Reference List` is there a requirement that the elements with the given ids actually exists. For non-required properties, this is not a requirement. For example, the value of the `aria-errormessage` attribute on an `input` does not need to reference an `id` that exists within the same document, because an [HTML element](https://html.spec.whatwg.org/#htmlelement) with such and `id` may be created in response to an [event](https://dom.spec.whatwg.org/#event) that may or may not happen. +Using invalid ARIA attribute values is often the result of a typo or other developer error. These attributes are then either ignored, or a default value is assumed by browsers and assistive technologies. This often means that a state or property which should exist is missing or has an unexpected value. This can cause issues under [success criterion 1.3.1 Info and Relationships][sc131] or [4.1.2 Name, Rule Value][sc412]. If the default value for invalid attribute values happens to match the author's intention for the value, there will not be an accessibility issue. -For value type `URI`, this rule does not require that the destination URI exists. +Only for [WAI-ARIA required properties](https://www.w3.org/TR/wai-aria-1.2/#requiredState) with value types `ID Reference` and `ID Reference List` is there a requirement that the elements with the given ids actually exists. For non-required properties, this is not a requirement. For example, `aria-errormessage` attribute on an `input` element may have a fixed value, but the element with the error message is only added to the page when an error actually occurred. ### Related rules @@ -72,39 +68,47 @@ For value type `URI`, this rule does not require that the destination URI exists #### Passed Example 1 -`aria-required` property with valid true/false value +The `aria-label` [attribute value][] of `Family name` is allowed for the `string` [value type][]. ```html -
+
``` #### Passed Example 2 -`aria-expanded` state with valid true/false/undefined value +The `aria-required` [attribute value][] of `true` is allowed for the `true/false` [value type][]. ```html -
A button
+
``` #### Passed Example 3 -`aria-pressed` state with valid tristate value +The `aria-expanded` [attribute value][] of `undefined` is allowed for the `true/false/undefined` [value type][]. ```html -
An other button
+
A button
``` #### Passed Example 4 -`aria-errormessage` property with valid ID reference value +The `aria-pressed` [attribute value][] of `mixed` is allowed for the `tristate` [value type][]. ```html -
+
Partially checked checkbox
``` #### Passed Example 5 -`aria-owns` property with valid ID reference list value +The `aria-errormessage` [attribute value][] is an `ID Reference` [value type][]. Because `aria-errormessage` is not a required property for `textbox`, an element with a matching ID is not required. + +```html +
+``` + +#### Passed Example 6 + +The `aria-owns` [attribute value][] is a valid `ID Reference List` [value type][]. Both tokens reference elements that exist in the same [DOM tree][]. ```html

Shopping list

@@ -113,43 +117,41 @@ For value type `URI`, this rule does not require that the destination URI exists
Bananas
``` -#### Passed Example 6 +#### Passed Example 7 -`aria-rowindex` property with valid integer value +The `aria-rowindex` [attribute value][] is a valid `integer` [value type][]. ```html
Fred
``` -#### Passed Example 7 +#### Passed Example 8 -`aria-valuemin`, `aria-valuemax` and `aria-valuenow` properties with valid number values +The `aria-valuemin`, `aria-valuemax` and `aria-valuenow` [attribute values][attribute value] are a valid for a `number` [value type][]. ```html
``` -#### Passed Example 8 +#### Passed Example 9 -`aria-placeholder` property with valid string value +The `aria-current` [attribute value][] of `page` is a valid `token` [value type][]. ```html -
- MM-DD-YYYY -
+Home ``` -#### Passed Example 9 +#### Passed Example 10 -`aria-relevant` property with valid token list values +The `aria-relevant` [attribute value][] has a `text` and `removals`. Both are valid tokens for a `aria-relevant` `token list` [value type][]. ```html
``` -#### Passed Example 10 +#### Passed Example 11 -`aria-controls`, which is a required property for the role `scrollbar`, has `ID Reference list` that references at least one element existing in the same document tree. +The `aria-controls` [attribute value][], which is a required property for the role `scrollbar`, has `ID Reference list` that references at least one element existing in the same document tree. ```html
Lorem ipsum...
@@ -167,7 +169,7 @@ For value type `URI`, this rule does not require that the destination URI exists #### Failed Example 1 -`aria-required` property with invalid true/false value +The `aria-required` [attribute value][] of `undefined` is not valid for a `true/false` [value type][]. ```html
@@ -175,15 +177,15 @@ For value type `URI`, this rule does not require that the destination URI exists #### Failed Example 2 -`aria-expanded` state with invalid true/false/undefined value +The `aria-expanded` [attribute value][] of `collapsed` is not valid for a `true/false/undefined` [value type][]. ```html -
A button
+
A button
``` #### Failed Example 3 -`aria-pressed` state with invalid tristate value +The `aria-expanded` [attribute value][] of `horizontal` is not valid for a `tristate` [value type][]. ```html
An other button
@@ -191,54 +193,38 @@ For value type `URI`, this rule does not require that the destination URI exists #### Failed Example 4 -`aria-errormessage` property with invalid ID reference value, since space is not allowed in a single ID +The `aria-rowindex` [attribute value][] of `2.5` is not valid for an `integer` [value type][] because it is a decimal number. ```html -
+
Fred
``` #### Failed Example 5 -`aria-rowindex` property with invalid integer value +The `aria-valuemin`, `aria-valuemax` and `aria-valuenow` [attribute values][attribute value] are `strings`. These should all be of the `number` [value type][] instead. ```html -
Fred
+
``` #### Failed Example 6 -`aria-valuemin`, `aria-valuemax` and `aria-valuenow` property with invalid number values +The `aria-live` [attribute value][] of `page` is not a valid `token`, because `page` is a token for `aria-live`. ```html -
+
``` #### Failed Example 7 -`aria-live` property with invalid token value +The `aria-relevant` [attribute value][] has the `text` and `always` tokens. The `always` token is not valid for the `aria-relevant` `token list`. ```html -
+
``` #### Failed Example 8 -Element with invalid token list value - -```html -
-``` - -#### Failed Example 9 - -`aria-expanded` state with invalid true/false/undefined value for custom element - -```html -My button -``` - -#### Failed Example 10 - `aria-controls`, which is a required property for the role `scrollbar`, references an element that does not exist in the same document tree. ```html @@ -272,7 +258,7 @@ Element has ARIA role, but no ARIA states or properties #### Inapplicable Example 3 -`aria-checked` state with empty value +The `aria-checked` attribute does not have a value. **Note**: The HTML validator flags an `aria-checked` attribute with an empty value as an issue. However, since WAI-ARIA 1.1, `aria-checked` has a default value of `undefined`. @@ -282,13 +268,18 @@ Element has ARIA role, but no ARIA states or properties #### Inapplicable Example 4 -`aria-hidden` state on an element that is not an [HTML or SVG element][]. +the `aria-hidden` attribute is not on an [HTML or SVG element][]. ```xml - + ``` [wai-aria specifications]: #wai-aria-specifications 'List of WAI-ARIA Specifications' [html or svg element]: #namespaced-element [sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships [sc412]: https://www.w3.org/TR/WCAG21/#name-role-value +[wai-aria required properties]: https://www.w3.org/TR/wai-aria-1.2/#requiredState) +[document tree]: https://dom.spec.whatwg.org/#document-trees +[shadow tree]: https://dom.spec.whatwg.org/#shadow-trees +[value type]: https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value +[wai-aria state or property]: https://www.w3.org/TR/wai-aria-1.2/#state_prop_def From 914a18feb5e2da443a7a645edc98a15249b011b1 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Wed, 18 Jan 2023 14:53:03 +0100 Subject: [PATCH 02/12] Update aria-state-or-property-valid-value-6a7281.md --- _rules/aria-state-or-property-valid-value-6a7281.md | 1 - 1 file changed, 1 deletion(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index ef47e95fc1..e2d7a61180 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -274,7 +274,6 @@ the `aria-hidden` attribute is not on an [HTML or SVG element][]. ``` -[wai-aria specifications]: #wai-aria-specifications 'List of WAI-ARIA Specifications' [html or svg element]: #namespaced-element [sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships [sc412]: https://www.w3.org/TR/WCAG21/#name-role-value From 26a53390a785497f3cbc8ed8bede9268d5ae9ee6 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 19 Jan 2023 14:57:48 +0100 Subject: [PATCH 03/12] Apply suggestions from code review Co-authored-by: Jean-Yves Moyen --- _rules/aria-state-or-property-valid-value-6a7281.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index e2d7a61180..9f3b29de91 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -119,7 +119,7 @@ The `aria-owns` [attribute value][] is a valid `ID Reference List` [value type][ #### Passed Example 7 -The `aria-rowindex` [attribute value][] is a valid `integer` [value type][]. +The `aria-rowindex` [attribute value][] of 2 is a valid `integer` [value type][]. ```html
Fred
@@ -209,7 +209,7 @@ The `aria-valuemin`, `aria-valuemax` and `aria-valuenow` [attribute values][attr #### Failed Example 6 -The `aria-live` [attribute value][] of `page` is not a valid `token`, because `page` is a token for `aria-live`. +The `aria-live` [attribute value][] of `page` is not a valid `token`, because `page` is not a token for `aria-live`. ```html
@@ -217,7 +217,7 @@ The `aria-live` [attribute value][] of `page` is not a valid `token`, because `p #### Failed Example 7 -The `aria-relevant` [attribute value][] has the `text` and `always` tokens. The `always` token is not valid for the `aria-relevant` `token list`. +The `aria-relevant` [attribute value][] has the two tokens `text` and `always`. The `always` token is not valid for the `aria-relevant` `token list`. In order to be a valid value, all tokens must be valid. ```html
From b2987df180d3d06b051cd9051d4c02badbf0c990 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Tue, 24 Jan 2023 12:29:11 +0100 Subject: [PATCH 04/12] Add collapsed combobox exception --- ...ia-state-or-property-valid-value-6a7281.md | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index 9f3b29de91..e61aa8db32 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -32,9 +32,11 @@ This rule applies to any [WAI-ARIA state or property][] that has a non-empty ("" ## Expectation -Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type]. +Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type], except if one of the following is true: -**Exception**: For `ID Reference` and `ID Reference List` value types, if the test target is not a [WAI-ARIA required states and properties][] for the [semantic role][] of its element, no ID referenced elements are required. Otherwise at least one of the elements with the given IDs exists in the same [document tree][] or in the same [shadow tree][] as the test target's element. +- ID Reference: For `ID Reference` value types an ID referenced elements is only required with [semantic][semantic role] `scrollbar` elements, and with [semantic][semantic role] `combobox` elements that have an `aria-expanded` [attribute value][] of `true`. The ID referenced element must exist in the same [document tree][] or [shadow tree][] as the test target's element. + +- ID Reference List: For `ID Reference List` value types, no ID referenced elements are required. ## Assumptions @@ -48,7 +50,7 @@ Some user agents treat the value of `aria-*` attribute as case-sensitive (even w Using invalid ARIA attribute values is often the result of a typo or other developer error. These attributes are then either ignored, or a default value is assumed by browsers and assistive technologies. This often means that a state or property which should exist is missing or has an unexpected value. This can cause issues under [success criterion 1.3.1 Info and Relationships][sc131] or [4.1.2 Name, Rule Value][sc412]. If the default value for invalid attribute values happens to match the author's intention for the value, there will not be an accessibility issue. -Only for [WAI-ARIA required properties](https://www.w3.org/TR/wai-aria-1.2/#requiredState) with value types `ID Reference` and `ID Reference List` is there a requirement that the elements with the given ids actually exists. For non-required properties, this is not a requirement. For example, `aria-errormessage` attribute on an `input` element may have a fixed value, but the element with the error message is only added to the page when an error actually occurred. +Only for [WAI-ARIA required properties](required) with value types `ID Reference` and `ID Reference List` is there a requirement that the elements with the given IDs actually exists. For non-required properties, having the referenced element is optional. For example, `aria-errormessage` attribute on an `input` element may have a fixed value, but the element with the error message is only added to the page when an error actually occurred. ### Related rules @@ -165,6 +167,17 @@ The `aria-controls` [attribute value][], which is a required property for the ro > ``` +#### Passed Example 12 + +The `aria-controls` [attribute value][] on a collapsed `combobox` does not require the ID referenced element to exist. + +```html + +``` + ### Failed #### Failed Example 1 @@ -238,6 +251,17 @@ The `aria-relevant` [attribute value][] has the two tokens `text` and `always`. > ``` +#### Failed Example 9 + +The `aria-controls` [attribute value][] on an expanded `combobox` requires the ID referenced element to exist. + +```html + +``` + ### Inapplicable #### Inapplicable Example 1 @@ -277,7 +301,7 @@ the `aria-hidden` attribute is not on an [HTML or SVG element][]. [html or svg element]: #namespaced-element [sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships [sc412]: https://www.w3.org/TR/WCAG21/#name-role-value -[wai-aria required properties]: https://www.w3.org/TR/wai-aria-1.2/#requiredState) +[required]: https://www.w3.org/TR/wai-aria-1.2/#requiredState [document tree]: https://dom.spec.whatwg.org/#document-trees [shadow tree]: https://dom.spec.whatwg.org/#shadow-trees [value type]: https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value From bc8d654405eec6dd17e6a69349fa23e7f74fd610 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Tue, 24 Jan 2023 12:35:21 +0100 Subject: [PATCH 05/12] Test issue --- _rules/aria-state-or-property-valid-value-6a7281.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index e61aa8db32..d52dc75a0d 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -50,7 +50,7 @@ Some user agents treat the value of `aria-*` attribute as case-sensitive (even w Using invalid ARIA attribute values is often the result of a typo or other developer error. These attributes are then either ignored, or a default value is assumed by browsers and assistive technologies. This often means that a state or property which should exist is missing or has an unexpected value. This can cause issues under [success criterion 1.3.1 Info and Relationships][sc131] or [4.1.2 Name, Rule Value][sc412]. If the default value for invalid attribute values happens to match the author's intention for the value, there will not be an accessibility issue. -Only for [WAI-ARIA required properties](required) with value types `ID Reference` and `ID Reference List` is there a requirement that the elements with the given IDs actually exists. For non-required properties, having the referenced element is optional. For example, `aria-errormessage` attribute on an `input` element may have a fixed value, but the element with the error message is only added to the page when an error actually occurred. +Only for [WAI-ARIA required properties][] with value types `ID Reference` and `ID Reference List` is there a requirement that the elements with the given IDs actually exists. For non-required properties, having the referenced element is optional. For example, `aria-errormessage` attribute on an `input` element may have a fixed value, but the element with the error message is only added to the page when an error actually occurred. ### Related rules @@ -301,7 +301,7 @@ the `aria-hidden` attribute is not on an [HTML or SVG element][]. [html or svg element]: #namespaced-element [sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships [sc412]: https://www.w3.org/TR/WCAG21/#name-role-value -[required]: https://www.w3.org/TR/wai-aria-1.2/#requiredState +[wai-aria required properties]: https://www.w3.org/TR/wai-aria-1.2/#requiredState [document tree]: https://dom.spec.whatwg.org/#document-trees [shadow tree]: https://dom.spec.whatwg.org/#shadow-trees [value type]: https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value From 0c53ecc6998d9f6c4445d5ce8c15c9cb803b8919 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Tue, 24 Jan 2023 12:42:49 +0100 Subject: [PATCH 06/12] Editorial --- _rules/aria-state-or-property-valid-value-6a7281.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index d52dc75a0d..c72f9be7a4 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -34,7 +34,7 @@ This rule applies to any [WAI-ARIA state or property][] that has a non-empty ("" Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type], except if one of the following is true: -- ID Reference: For `ID Reference` value types an ID referenced elements is only required with [semantic][semantic role] `scrollbar` elements, and with [semantic][semantic role] `combobox` elements that have an `aria-expanded` [attribute value][] of `true`. The ID referenced element must exist in the same [document tree][] or [shadow tree][] as the test target's element. +- ID Reference: For `ID Reference` value types an ID referenced elements is only required for `aria-controls` with [semantic][semantic role] `scrollbar` elements, and with [semantic][semantic role] `combobox` elements that have an `aria-expanded` [attribute value][] of `true`. The ID referenced element must exist in the same [document tree][] or [shadow tree][] as the test target's element. - ID Reference List: For `ID Reference List` value types, no ID referenced elements are required. @@ -292,7 +292,7 @@ The `aria-checked` attribute does not have a value. #### Inapplicable Example 4 -the `aria-hidden` attribute is not on an [HTML or SVG element][]. +The `aria-hidden` attribute is not on an [HTML or SVG element][]. ```xml From 4a65e354be5b342cbc71479c131f5108914e172c Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Tue, 24 Jan 2023 16:11:30 +0100 Subject: [PATCH 07/12] Update _rules/aria-state-or-property-valid-value-6a7281.md --- _rules/aria-state-or-property-valid-value-6a7281.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index c72f9be7a4..66aa1cfc5d 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -97,7 +97,7 @@ The `aria-expanded` [attribute value][] of `undefined` is allowed for the `true/ The `aria-pressed` [attribute value][] of `mixed` is allowed for the `tristate` [value type][]. ```html -
Partially checked checkbox
+
Partially pressed button
``` #### Passed Example 5 From ee831ecb401a18567d1b50da12d02bc2130ec724 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 9 Feb 2023 12:52:16 +0100 Subject: [PATCH 08/12] Apply suggestions from code review Co-authored-by: Carlos Duarte --- _rules/aria-state-or-property-valid-value-6a7281.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index 66aa1cfc5d..3d27af52f6 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -32,7 +32,7 @@ This rule applies to any [WAI-ARIA state or property][] that has a non-empty ("" ## Expectation -Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type], except if one of the following is true: +Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type], except in the following instances: - ID Reference: For `ID Reference` value types an ID referenced elements is only required for `aria-controls` with [semantic][semantic role] `scrollbar` elements, and with [semantic][semantic role] `combobox` elements that have an `aria-expanded` [attribute value][] of `true`. The ID referenced element must exist in the same [document tree][] or [shadow tree][] as the test target's element. @@ -129,7 +129,7 @@ The `aria-rowindex` [attribute value][] of 2 is a valid `integer` [value type][] #### Passed Example 8 -The `aria-valuemin`, `aria-valuemax` and `aria-valuenow` [attribute values][attribute value] are a valid for a `number` [value type][]. +The `aria-valuemin`, `aria-valuemax` and `aria-valuenow` [attribute values][attribute value] are valid for a `number` [value type][]. ```html
@@ -145,7 +145,7 @@ The `aria-current` [attribute value][] of `page` is a valid `token` [value type] #### Passed Example 10 -The `aria-relevant` [attribute value][] has a `text` and `removals`. Both are valid tokens for a `aria-relevant` `token list` [value type][]. +The `aria-relevant` [attribute value][] has a `text` and `removals` tokens. Both are valid tokens for a `aria-relevant` `token list` [value type][]. ```html
From ac744e8bc87cf748c55f66fa551d8aa3284d5983 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 2 Mar 2023 13:42:24 +0100 Subject: [PATCH 09/12] Remove ID Reference requirements --- ...ia-state-or-property-valid-value-6a7281.md | 61 +------------------ 1 file changed, 3 insertions(+), 58 deletions(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index 3d27af52f6..61e10a2910 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -32,11 +32,9 @@ This rule applies to any [WAI-ARIA state or property][] that has a non-empty ("" ## Expectation -Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type], except in the following instances: +Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type]. -- ID Reference: For `ID Reference` value types an ID referenced elements is only required for `aria-controls` with [semantic][semantic role] `scrollbar` elements, and with [semantic][semantic role] `combobox` elements that have an `aria-expanded` [attribute value][] of `true`. The ID referenced element must exist in the same [document tree][] or [shadow tree][] as the test target's element. - -- ID Reference List: For `ID Reference List` value types, no ID referenced elements are required. +**Exception**: For value types `ID Reference` and `ID Reference List` no ID referenced elements are required. ## Assumptions @@ -50,7 +48,7 @@ Some user agents treat the value of `aria-*` attribute as case-sensitive (even w Using invalid ARIA attribute values is often the result of a typo or other developer error. These attributes are then either ignored, or a default value is assumed by browsers and assistive technologies. This often means that a state or property which should exist is missing or has an unexpected value. This can cause issues under [success criterion 1.3.1 Info and Relationships][sc131] or [4.1.2 Name, Rule Value][sc412]. If the default value for invalid attribute values happens to match the author's intention for the value, there will not be an accessibility issue. -Only for [WAI-ARIA required properties][] with value types `ID Reference` and `ID Reference List` is there a requirement that the elements with the given IDs actually exists. For non-required properties, having the referenced element is optional. For example, `aria-errormessage` attribute on an `input` element may have a fixed value, but the element with the error message is only added to the page when an error actually occurred. +This rule does not require the target of an `ID Reference` to exist. This is because referencing an element that does not exist, and not having the reference at all has the same end result. A common use case for using `ID Reference` for a non-existing ID is to use a static `aria-errormessage` on an `input` element, and to only insert the element with the error message if there is an actual error. There are some cases in which ID references are required. These are tested in a separate rule. ### Related rules @@ -151,33 +149,6 @@ The `aria-relevant` [attribute value][] has a `text` and `removals` tokens. Both
``` -#### Passed Example 11 - -The `aria-controls` [attribute value][], which is a required property for the role `scrollbar`, has `ID Reference list` that references at least one element existing in the same document tree. - -```html -
Lorem ipsum...
-
-``` - -#### Passed Example 12 - -The `aria-controls` [attribute value][] on a collapsed `combobox` does not require the ID referenced element to exist. - -```html - -``` - ### Failed #### Failed Example 1 @@ -236,32 +207,6 @@ The `aria-relevant` [attribute value][] has the two tokens `text` and `always`.
``` -#### Failed Example 8 - -`aria-controls`, which is a required property for the role `scrollbar`, references an element that does not exist in the same document tree. - -```html -
-``` - -#### Failed Example 9 - -The `aria-controls` [attribute value][] on an expanded `combobox` requires the ID referenced element to exist. - -```html - -``` - ### Inapplicable #### Inapplicable Example 1 From 194f3ca6a75d2418885c5f1b49b9244933e1e450 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 2 Mar 2023 14:58:05 +0100 Subject: [PATCH 10/12] Address comments --- _rules/aria-state-or-property-valid-value-6a7281.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index 61e10a2910..1be78f7d11 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -169,7 +169,7 @@ The `aria-expanded` [attribute value][] of `collapsed` is not valid for a `true/ #### Failed Example 3 -The `aria-expanded` [attribute value][] of `horizontal` is not valid for a `tristate` [value type][]. +The `aria-pressed` [attribute value][] of `horizontal` is not valid for a `tristate` [value type][]. ```html
An other button
@@ -227,12 +227,10 @@ Element has ARIA role, but no ARIA states or properties #### Inapplicable Example 3 -The `aria-checked` attribute does not have a value. - -**Note**: The HTML validator flags an `aria-checked` attribute with an empty value as an issue. However, since WAI-ARIA 1.1, `aria-checked` has a default value of `undefined`. +The `aria-live` attribute does not have a value. ```html -
Accept terms and conditions
+
Remember to be awesome!
``` #### Inapplicable Example 4 From 083aecc30f9a3191b3f291449f8d924c7e91fcba Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 30 Mar 2023 12:35:59 +0200 Subject: [PATCH 11/12] Apply suggestions from code review Co-authored-by: Jean-Yves Moyen --- _rules/aria-state-or-property-valid-value-6a7281.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index 1be78f7d11..37df9a94a8 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -100,7 +100,7 @@ The `aria-pressed` [attribute value][] of `mixed` is allowed for the `tristate` #### Passed Example 5 -The `aria-errormessage` [attribute value][] is an `ID Reference` [value type][]. Because `aria-errormessage` is not a required property for `textbox`, an element with a matching ID is not required. +The `aria-errormessage` [attribute value][] is an `ID Reference` [value type][]. The presence of an element with a matching ID is not required by this rule. ```html
From d7ea0354a11584734fb35c6ac31f94673c383929 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Thu, 30 Mar 2023 13:22:05 +0200 Subject: [PATCH 12/12] fix failing test --- _rules/aria-state-or-property-valid-value-6a7281.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/_rules/aria-state-or-property-valid-value-6a7281.md b/_rules/aria-state-or-property-valid-value-6a7281.md index 37df9a94a8..aaab1b0ed1 100755 --- a/_rules/aria-state-or-property-valid-value-6a7281.md +++ b/_rules/aria-state-or-property-valid-value-6a7281.md @@ -244,8 +244,5 @@ The `aria-hidden` attribute is not on an [HTML or SVG element][]. [html or svg element]: #namespaced-element [sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships [sc412]: https://www.w3.org/TR/WCAG21/#name-role-value -[wai-aria required properties]: https://www.w3.org/TR/wai-aria-1.2/#requiredState -[document tree]: https://dom.spec.whatwg.org/#document-trees -[shadow tree]: https://dom.spec.whatwg.org/#shadow-trees [value type]: https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value [wai-aria state or property]: https://www.w3.org/TR/wai-aria-1.2/#state_prop_def