You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _rules/aria-state-or-property-valid-value-6a7281.md
+47-93Lines changed: 47 additions & 93 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,31 +28,27 @@ acknowledgments:
28
28
29
29
## Applicability
30
30
31
-
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][].
31
+
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][].
32
32
33
33
## Expectation
34
34
35
-
Each test target has a valid valueaccording to its [WAI-ARIA 1.2 value type](https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value).
35
+
Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type].
36
36
37
-
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.
38
-
39
-
For value type `URI` the value matches the [generic URI syntax](https://www.ietf.org/rfc/rfc3986.txt).
37
+
**Exception**: For value types `ID Reference` and `ID Reference List` no ID referenced elements are required.
40
38
41
39
## Assumptions
42
40
43
-
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.
41
+
There are no assumptions.
44
42
45
43
## Accessibility Support
46
44
47
45
Some user agents treat the value of `aria-*` attribute as case-sensitive (even when these are not ID) while some treat them as case-insensitive.
48
46
49
47
## Background
50
48
51
-
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].
52
-
53
-
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.
49
+
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.
54
50
55
-
For value type `URI`, this rule does not require that the destination URI exists.
51
+
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.
56
52
57
53
### Related rules
58
54
@@ -72,184 +68,143 @@ For value type `URI`, this rule does not require that the destination URI exists
72
68
73
69
#### Passed Example 1
74
70
75
-
`aria-required` property with valid true/false value
71
+
The `aria-label`[attribute value][] of `Family name` is allowed for the `string`[value type][].
`aria-owns` property with valid ID reference list value
103
+
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.
`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.
146
+
The `aria-relevant`[attribute value][] has a `text` and `removals` tokens. Both are valid tokens for a `aria-relevant``token list`[value type][].
The `aria-pressed`[attribute value][] of `horizontal` is not valid for a `tristate`[value type][].
187
173
188
174
```html
189
175
<divrole="button"aria-pressed="horizontal">An other button</div>
190
176
```
191
177
192
178
#### Failed Example 4
193
179
194
-
`aria-errormessage` property with invalid ID reference value, since space is not allowed in a single ID
180
+
The `aria-rowindex`[attribute value][] of `2.5` is not valid for an `integer`[value type][] because it is a decimal number.
195
181
196
182
```html
197
-
<divrole="textbox"aria-errormessage="error1 error2"aria-label="A textbox with an error"></div>
183
+
<divrole="gridcell"aria-rowindex="2.5">Fred</div>
198
184
```
199
185
200
186
#### Failed Example 5
201
187
202
-
`aria-rowindex` property with invalid integer value
188
+
The `aria-valuemin`, `aria-valuemax` and `aria-valuenow`[attribute values][attribute value] are `strings`. These should all be of the `number`[value type][] instead.
203
189
204
190
```html
205
-
<divrole="gridcell"aria-rowindex="2.5">Fred</div>
191
+
<divrole="spinbutton"aria-valuemin="one"aria-valuemax="three"aria-valuenow="two"aria-label="Choose a value"></div>
206
192
```
207
193
208
194
#### Failed Example 6
209
195
210
-
`aria-valuemin`, `aria-valuemax` and `aria-valuenow` property with invalid number values
196
+
The `aria-live`[attribute value][] of `page` is not a valid `token`, because `page` is not a token for `aria-live`.
211
197
212
198
```html
213
-
<divrole="spinbutton"aria-valuemin="one"aria-valuemax="three"aria-valuenow="two"aria-label="Choose a value"></div>
199
+
<divrole="main"aria-live="page"></div>
214
200
```
215
201
216
202
#### Failed Example 7
217
203
218
-
`aria-live` property with invalid token value
219
-
220
-
```html
221
-
<divrole="main"aria-live="nope"></div>
222
-
```
223
-
224
-
#### Failed Example 8
225
-
226
-
Element with invalid token list value
227
-
228
-
```html
229
-
<divrole="alert"aria-relevant="always"></div>
230
-
```
231
-
232
-
#### Failed Example 9
233
-
234
-
`aria-expanded` state with invalid true/false/undefined value for custom element
`aria-controls`, which is a required property for the role `scrollbar`, references an element that does not exist in the same document tree.
204
+
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.
@@ -272,23 +227,22 @@ Element has ARIA role, but no ARIA states or properties
272
227
273
228
#### Inapplicable Example 3
274
229
275
-
`aria-checked` state with empty value
276
-
277
-
**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`.
230
+
The `aria-live` attribute does not have a value.
278
231
279
232
```html
280
-
<divrole="checkbox"aria-checked>Accept terms and conditions</div>
233
+
<divrole="alert"aria-live>Remember to be awesome!</div>
281
234
```
282
235
283
236
#### Inapplicable Example 4
284
237
285
-
`aria-hidden`state on an element that is not an [HTML or SVG element][].
238
+
The `aria-hidden`attribute is not on an [HTML or SVG element][].
286
239
287
240
```xml
288
-
<matharia-hidden="true"></math>
241
+
<matharia-hidden="false"></math>
289
242
```
290
243
291
-
[wai-aria specifications]: #wai-aria-specifications'List of WAI-ARIA Specifications'
Copy file name to clipboardExpand all lines: pages/about.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ The ACT Rules Community Group is an open forum set up to document and harmonize
9
9
10
10
The ACT Rules Community Group (ACT-R) achieves this by bringing together the people developing, implementing and using various accessibility testing tools and methodologies to document interpretations as test rules. Test rules are defined using the ACT Rules Format, and reviewed by the community. The process of researching, documenting, and sharing knowledge from different perspectives within the group, builds towards a common understanding. By publishing such test rules, ACT-R hopes to motivate organizations to share their own insights, and adopt commonly agreed test rules.
11
11
12
-
ACT-R is not set up to remove differences or impose changes on accessibility testing tools and methodologies. There is value in innovation and diverse approaches. Rather it aims to contribute to more consistent results, regardless of how the testing is done. Knowing when something meets a requirement, and when it does not, should be clear and consistent.
12
+
ACT-R is not set up to remove differences or impose changes on accessibility testing tools and methodologies. There is value in innovation and diverse approaches. Rather it aims to contribute to more consistent results, regardless of how the testing is done. Knowing when something meets a requirement, and when it does not, should be clear and consistent. The tests provide code examples that are intended to show a minimal pass/fail or not applicable test. They are not intended to showcase "good" HTML code.
0 commit comments