Skip to content

Commit 8d979ef

Browse files
giacomo-petriWilcoFiersJym77
authored
Updated ARIA state or property is permitted [5c01ea]: clarified global property is allowed except when prohibited and added examples (#2192)
* Update aria-state-or-property-permitted-5c01ea.md * Update aria-state-or-property-permitted-5c01ea.md * Update aria-state-or-property-permitted-5c01ea.md * Update spelling-ignore.yml added superclass * Apply suggestions from code review --------- Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>
1 parent 20212dd commit 8d979ef

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

__tests__/spelling-ignore.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
- unitless
240240
- luminance
241241
- disambiguated
242+
- superclass
242243
- grey
243244

244245
# Parts of Unicode

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

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The `aria-busy` [state][] is a [global][] [state][] that is [supported][] by all
110110

111111
#### Passed Example 4
112112

113-
The `aria-label` [property][] is a [global][] [property][]. It is allowed on any [semantic role][].
113+
The `aria-label` [property][] is a [global][] [property][]. It is allowed on any [semantic role][], except where specifically prohibited.
114114

115115
```html
116116
<div role="button" aria-label="OK">✓</div>
@@ -150,7 +150,7 @@ The `aria-controls` [property][] is [required][] for the [semantic][semantic rol
150150

151151
#### Passed Example 9
152152

153-
The `aria-label` [property][] is [global][]. It is allowed on any [semantic role][], including roles from the [WAI-ARIA Graphics Module](https://www.w3.org/TR/graphics-aria-1.0). This rule is applicable to SVG elements.
153+
The `aria-label` [property][] is [global][]. It is allowed on any [semantic role][], except where specifically prohibited, including roles from the [WAI-ARIA Graphics Module](https://www.w3.org/TR/graphics-aria-1.0). This rule is applicable to SVG elements.
154154

155155
```html
156156
<svg xmlns="http://www.w3.org/2000/svg" role="graphics-object" width="100" height="100" aria-label="yellow circle">
@@ -174,6 +174,29 @@ This `input` element does not have an [explicit role][] of `textbox`, but the `a
174174
<label>Password<input type="password" aria-required="true"/></label>
175175
```
176176

177+
#### Passed Example 12
178+
179+
This `div` element has an [explicit role][] of `switch`; the `aria-required` [property][] is [inherited][] from the `checkbox` [superclass role](https://www.w3.org/TR/wai-aria-1.2/#superclassrole).
180+
181+
```html
182+
<div role="switch" aria-checked="false" tabindex="0" aria-required="true">
183+
<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+
<span class="on" aria-hidden="true" style="display: none;">On</span>
188+
<span class="off" aria-hidden="true">Off</span>
189+
</div>
190+
```
191+
192+
#### Passed Example 13
193+
194+
This `div` element has an [explicit role][] of `separator`. The `aria-valuemin`, `aria-valuemax` and `aria-valuenow` [properties][property] are [supported][] for the `separator` role when the element is [focusable][].
195+
196+
```html
197+
<div role="separator" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" tabindex="0">My separator</div>
198+
```
199+
177200
### Failed
178201

179202
#### Failed Example 1
@@ -200,6 +223,14 @@ The `aria-label` property is [prohibited][] for an element with a `generic` role
200223
<div aria-label="Bananas"></div>
201224
```
202225

226+
#### Failed Example 4
227+
228+
The `aria-label` property is [prohibited][] for an element with a `paragraph` role.
229+
230+
```html
231+
<div role="paragraph" aria-label="Bananas"></div>
232+
```
233+
203234
### Inapplicable
204235

205236
#### Inapplicable Example 1

0 commit comments

Comments
 (0)