Skip to content

Commit 2f14f14

Browse files
shunguoyWilcoFiers
andauthored
Update permitted ARIA state or property for combobox role (#2322)
* update the rule for combobox role #rule-2311 * update the text #rule-2311 * Update aria-state-or-property-permitted-5c01ea.md * Update _rules/aria-state-or-property-permitted-5c01ea.md Update the property value Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> * update the required state and properties rule #rule-2311 * Update _rules/aria-state-or-property-permitted-5c01ea.md Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> --------- Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
1 parent 813dacb commit 2f14f14

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

_rules/aria-state-or-property-permitted-5c01ea.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ The presence of prohibited ARIA attributes is often the result of a developer us
5757

5858
In HTML, there are language features that do not have corresponding implicit WAI-ARIA semantics. As per [ARIA in HTML](https://www.w3.org/TR/html-aria/), those elements can have [global states or properties][global]. Some of those elements can also have [inherited][], [supported][], or [required][] [states][state] or [properties][property] that correspond to a [WAI-ARIA role](https://www.w3.org/TR/wai-aria-1.2/#introroles). For example, the `audio` element has no corresponding ARIA semantics but it can have [inherited][], [supported][], or [required][] [states][state] or [properties][property] of the [`application` role](https://www.w3.org/TR/wai-aria-1.2/#application).
5959

60+
Note that required WAI-ARIA states or properties for a role may change with the advance of the WAI-ARIA specifications. For example, both aria-expanded and aria-controls were required in [ARIA 1.2](https://www.w3.org/TR/wai-aria-1.2/#combobox) for combobox role, but the aria-controls was removed from required states or properties in [ARIA 1.3](https://www.w3.org/TR/wai-aria-1.3/#combobox). The examples in this rule follow [ARIA 1.3](https://www.w3.org/TR/wai-aria-1.3/#combobox).
61+
6062
Assessing the value of the attribute is out of scope for this rule.
6163

6264
### Assumptions
@@ -126,26 +128,26 @@ The `aria-checked` [state][] is [required][] for the [semantic][semantic role] `
126128

127129
#### Passed Example 6
128130

129-
The `aria-controls` [property][] is [required][] for the [semantic][semantic role] `combobox`.
131+
The `aria-expanded` [property][] is [required][] for the [semantic][semantic role] `combobox`.
130132

131133
```html
132134
<div role="combobox" aria-controls="id1" aria-expanded="false" aria-label="My combobox">My combobox</div>
133135
```
134136

135137
#### Passed Example 7
136138

137-
The `aria-controls` [property][] is [required][] for the [semantic][semantic role] `combobox`. [WAI-ARIA states and properties][wai-aria state or property] with empty value are still applicable to this rule.
139+
The `aria-expanded` [property][] is [required][] for the [semantic][semantic role] `combobox`.
138140

139141
```html
140-
<div role="combobox" aria-expanded="false" aria-controls aria-label="My combobox">My combobox</div>
142+
<div role="combobox" aria-expanded="false" aria-controls="id1" aria-label="My combobox">My combobox</div>
141143
```
142144

143145
#### Passed Example 8
144146

145-
The `aria-controls` [property][] is [required][] for the [semantic][semantic role] `combobox`. [WAI-ARIA states and properties][wai-aria state or property] with empty value (specified as an empty string) are still applicable to this rule.
147+
The `aria-expanded` [property][] is [required][] for the [semantic][semantic role] `combobox`. [WAI-ARIA states and properties][wai-aria state or property] with `undefined` value are still applicable to this rule.
146148

147149
```html
148-
<div role="combobox" aria-expanded="false" aria-controls="" aria-label="My combobox">My combobox</div>
150+
<div role="combobox" aria-expanded="undefined" aria-controls="id1" aria-label="My combobox">My combobox</div>
149151
```
150152

151153
#### Passed Example 9
@@ -181,8 +183,13 @@ This `div` element has an [explicit role][] of `switch`; the `aria-required` [pr
181183
```html
182184
<div role="switch" aria-checked="false" tabindex="0" aria-required="true">
183185
<span class="label">Notifications</span>
184-
<span class="switch" style="position: relative; display: inline-block; top: 6px; border: 2px solid black; border-radius: 12px; height: 20px; width: 40px;">
185-
<span style="position: absolute; top: 2px; left: 2px; display: inline-block; border: 2px solid black; border-radius: 8px; height: 12px; width: 12px; background: black;"></span>
186+
<span
187+
class="switch"
188+
style="position: relative; display: inline-block; top: 6px; border: 2px solid black; border-radius: 12px; height: 20px; width: 40px;"
189+
>
190+
<span
191+
style="position: absolute; top: 2px; left: 2px; display: inline-block; border: 2px solid black; border-radius: 8px; height: 12px; width: 12px; background: black;"
192+
></span>
186193
</span>
187194
<span class="on" aria-hidden="true" style="display: none;">On</span>
188195
<span class="off" aria-hidden="true">Off</span>

0 commit comments

Comments
 (0)