Skip to content

Commit 5a07973

Browse files
authored
Merge branch 'develop' into develop
2 parents aeafb90 + b9d0918 commit 5a07973

3 files changed

Lines changed: 52 additions & 94 deletions

File tree

_rules/aria-state-or-property-valid-value-6a7281.md

Lines changed: 47 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,27 @@ acknowledgments:
2828

2929
## Applicability
3030

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][].
3232

3333
## Expectation
3434

35-
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).
35+
Each test target has an [attribute value][] that is valid according to its [WAI-ARIA value type][value type].
3636

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.
4038

4139
## Assumptions
4240

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.
4442

4543
## Accessibility Support
4644

4745
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.
4846

4947
## Background
5048

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.
5450

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.
5652

5753
### Related rules
5854

@@ -72,184 +68,143 @@ For value type `URI`, this rule does not require that the destination URI exists
7268

7369
#### Passed Example 1
7470

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][].
7672

7773
```html
78-
<div role="textbox" aria-required="true" aria-label="A required textbox"></div>
74+
<div role="textbox" aria-label="Family name"></div>
7975
```
8076

8177
#### Passed Example 2
8278

83-
`aria-expanded` state with valid true/false/undefined value
79+
The `aria-required` [attribute value][] of `true` is allowed for the `true/false` [value type][].
8480

8581
```html
86-
<div role="button" aria-expanded="undefined">A button</div>
82+
<div role="textbox" aria-required="true" aria-label="Family name"></div>
8783
```
8884

8985
#### Passed Example 3
9086

91-
`aria-pressed` state with valid tristate value
87+
The `aria-expanded` [attribute value][] of `undefined` is allowed for the `true/false/undefined` [value type][].
9288

9389
```html
94-
<div role="button" aria-pressed="mixed">An other button</div>
90+
<div role="button" aria-expanded="undefined">A button</div>
9591
```
9692

9793
#### Passed Example 4
9894

99-
`aria-errormessage` property with valid ID reference value
95+
The `aria-pressed` [attribute value][] of `mixed` is allowed for the `tristate` [value type][].
10096

10197
```html
102-
<div role="textbox" aria-errormessage="my-error" aria-label="A textbox"></div>
98+
<div role="button" aria-pressed="mixed">Partially pressed button</div>
10399
```
104100

105101
#### Passed Example 5
106102

107-
`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.
108104

109105
```html
110-
<h1>Shopping list</h1>
111-
<div role="list" aria-owns="item1 item2"></div>
112-
<div id="item1">Apples</div>
113-
<div id="item2">Bananas</div>
106+
<div role="textbox" aria-errormessage="my-error" aria-label="A textbox"></div>
114107
```
115108

116109
#### Passed Example 6
117110

118-
`aria-rowindex` property with valid integer value
111+
The `aria-owns` [attribute value][] is a valid `ID Reference List` [value type][]. Both tokens reference elements that exist in the same [DOM tree][].
119112

120113
```html
121-
<div role="gridcell" aria-rowindex="2">Fred</div>
114+
<h1>Shopping list</h1>
115+
<div role="list" aria-owns="item1 item2"></div>
116+
<div id="item1">Apples</div>
117+
<div id="item2">Bananas</div>
122118
```
123119

124120
#### Passed Example 7
125121

126-
`aria-valuemin`, `aria-valuemax` and `aria-valuenow` properties with valid number values
122+
The `aria-rowindex` [attribute value][] of 2 is a valid `integer` [value type][].
127123

128124
```html
129-
<div role="spinbutton" aria-valuemin="1.0" aria-valuemax="2.0" aria-valuenow="1.5" aria-label="Select a value"></div>
125+
<div role="gridcell" aria-rowindex="2">Fred</div>
130126
```
131127

132128
#### Passed Example 8
133129

134-
`aria-placeholder` property with valid string value
130+
The `aria-valuemin`, `aria-valuemax` and `aria-valuenow` [attribute values][attribute value] are valid for a `number` [value type][].
135131

136132
```html
137-
<div role="textbox" aria-placeholder="MM-DD-YYYY" aria-label="Your birthdate">
138-
MM-DD-YYYY
139-
</div>
133+
<div role="spinbutton" aria-valuemin="1.0" aria-valuemax="2.0" aria-valuenow="1.5" aria-label="Select a value"></div>
140134
```
141135

142136
#### Passed Example 9
143137

144-
`aria-relevant` property with valid token list values
138+
The `aria-current` [attribute value][] of `page` is a valid `token` [value type][].
145139

146140
```html
147-
<div role="alert" aria-relevant="text removals"></div>
141+
<a href="/" aria-current="page">Home</a>
148142
```
149143

150144
#### Passed Example 10
151145

152-
`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][].
153147

154148
```html
155-
<div id="content1">Lorem ipsum...</div>
156-
<div
157-
role="scrollbar"
158-
aria-controls="content1 content2"
159-
aria-orientation="vertical"
160-
aria-valuemax="100"
161-
aria-valuemin="0"
162-
aria-valuenow="25"
163-
></div>
149+
<div role="alert" aria-relevant="text removals"></div>
164150
```
165151

166152
### Failed
167153

168154
#### Failed Example 1
169155

170-
`aria-required` property with invalid true/false value
156+
The `aria-required` [attribute value][] of `undefined` is not valid for a `true/false` [value type][].
171157

172158
```html
173159
<div role="textbox" aria-required="undefined" aria-label="A required textbox"></div>
174160
```
175161

176162
#### Failed Example 2
177163

178-
`aria-expanded` state with invalid true/false/undefined value
164+
The `aria-expanded` [attribute value][] of `collapsed` is not valid for a `true/false/undefined` [value type][].
179165

180166
```html
181-
<div role="button" aria-expanded="mixed">A button</div>
167+
<div role="button" aria-expanded="collapsed">A button</div>
182168
```
183169

184170
#### Failed Example 3
185171

186-
`aria-pressed` state with invalid tristate value
172+
The `aria-pressed` [attribute value][] of `horizontal` is not valid for a `tristate` [value type][].
187173

188174
```html
189175
<div role="button" aria-pressed="horizontal">An other button</div>
190176
```
191177

192178
#### Failed Example 4
193179

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.
195181

196182
```html
197-
<div role="textbox" aria-errormessage="error1 error2" aria-label="A textbox with an error"></div>
183+
<div role="gridcell" aria-rowindex="2.5">Fred</div>
198184
```
199185

200186
#### Failed Example 5
201187

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.
203189

204190
```html
205-
<div role="gridcell" aria-rowindex="2.5">Fred</div>
191+
<div role="spinbutton" aria-valuemin="one" aria-valuemax="three" aria-valuenow="two" aria-label="Choose a value"></div>
206192
```
207193

208194
#### Failed Example 6
209195

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`.
211197

212198
```html
213-
<div role="spinbutton" aria-valuemin="one" aria-valuemax="three" aria-valuenow="two" aria-label="Choose a value"></div>
199+
<div role="main" aria-live="page"></div>
214200
```
215201

216202
#### Failed Example 7
217203

218-
`aria-live` property with invalid token value
219-
220-
```html
221-
<div role="main" aria-live="nope"></div>
222-
```
223-
224-
#### Failed Example 8
225-
226-
Element with invalid token list value
227-
228-
```html
229-
<div role="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
235-
236-
```html
237-
<my-button role="button" aria-expanded="collapsed">My button</my-button>
238-
```
239-
240-
#### Failed Example 10
241-
242-
`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.
243205

244206
```html
245-
<div
246-
role="scrollbar"
247-
aria-controls="content1"
248-
aria-orientation="vertical"
249-
aria-valuemax="100"
250-
aria-valuemin="0"
251-
aria-valuenow="25"
252-
></div>
207+
<div role="alert" aria-relevant="text always"></div>
253208
```
254209

255210
### Inapplicable
@@ -272,23 +227,22 @@ Element has ARIA role, but no ARIA states or properties
272227

273228
#### Inapplicable Example 3
274229

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.
278231

279232
```html
280-
<div role="checkbox" aria-checked>Accept terms and conditions</div>
233+
<div role="alert" aria-live>Remember to be awesome!</div>
281234
```
282235

283236
#### Inapplicable Example 4
284237

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][].
286239

287240
```xml
288-
<math aria-hidden="true"></math>
241+
<math aria-hidden="false"></math>
289242
```
290243

291-
[wai-aria specifications]: #wai-aria-specifications 'List of WAI-ARIA Specifications'
292244
[html or svg element]: #namespaced-element
293245
[sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships
294246
[sc412]: https://www.w3.org/TR/WCAG21/#name-role-value
247+
[value type]: https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value
248+
[wai-aria state or property]: https://www.w3.org/TR/wai-aria-1.2/#state_prop_def

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
"name": "Stein Erik Skotkjerra",
117117
"url": "https://github.com/skotkjerra"
118118
},
119+
{
120+
"name": "Tom Brunet",
121+
"url": "https://github.com/tombrunet"
122+
},
119123
{
120124
"name": "Wilco Fiers",
121125
"url": "https://github.com/wilcofiers"

pages/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The ACT Rules Community Group is an open forum set up to document and harmonize
99

1010
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.
1111

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.
1313

1414
## Why it matters
1515

0 commit comments

Comments
 (0)