Skip to content

Commit

Permalink
Updated ARIA state or property is permitted [5c01ea]: clarified globa…
Browse files Browse the repository at this point in the history
…l 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 <[email protected]>
Co-authored-by: Jean-Yves Moyen <[email protected]>
  • Loading branch information
3 people committed Feb 7, 2025
1 parent 22440f2 commit eb8484e
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 5 deletions.
95 changes: 94 additions & 1 deletion content-assets/wcag-act-rules/testcases.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"website": "https://www.w3.org/WAI/standards-guidelines/act/rules/",
"license": "https://act-rules.github.io/pages/license/",
"description": "Accessibility conformance testing rules for HTML",
"count": 1166,
"count": 1169,
"testcases": [
{
"ruleId": "674b10",
Expand Down Expand Up @@ -14725,6 +14725,68 @@
"url": "https://www.w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/0401164ef77abe96fd6502d35ed04952a057a8fe.html",
"rulePage": "https://www.w3.org/WAI/standards-guidelines/act/rules/5c01ea/proposed/"
},
{
"ruleId": "5c01ea",
"ruleName": "ARIA state or property is permitted",
"ruleAccessibilityRequirements": {
"wcag-technique:ARIA5": {
"forConformance": false,
"failed": "not satisfied",
"passed": "further testing needed",
"inapplicable": "further testing needed"
},
"aria12:state_property_processing": {
"title": "ARIA 1.2, 8.6 State and Property Attribute Processing",
"forConformance": true,
"failed": "not satisfied",
"passed": "satisfied",
"inapplicable": "satisfied"
},
"wcag20:1.3.1": {
"secondary": "This success criterion is **less strict** than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion."
},
"wcag20:4.1.2": {
"secondary": "This success criterion is **less strict** than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion."
}
},
"expected": "passed",
"testcaseId": "da2d6c53dd58121d0182d2498a104776da424e21",
"testcaseTitle": "Passed Example 12",
"relativePath": "testcases/5c01ea/da2d6c53dd58121d0182d2498a104776da424e21.html",
"url": "https://www.w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/da2d6c53dd58121d0182d2498a104776da424e21.html",
"rulePage": "https://www.w3.org/WAI/standards-guidelines/act/rules/5c01ea/proposed/"
},
{
"ruleId": "5c01ea",
"ruleName": "ARIA state or property is permitted",
"ruleAccessibilityRequirements": {
"wcag-technique:ARIA5": {
"forConformance": false,
"failed": "not satisfied",
"passed": "further testing needed",
"inapplicable": "further testing needed"
},
"aria12:state_property_processing": {
"title": "ARIA 1.2, 8.6 State and Property Attribute Processing",
"forConformance": true,
"failed": "not satisfied",
"passed": "satisfied",
"inapplicable": "satisfied"
},
"wcag20:1.3.1": {
"secondary": "This success criterion is **less strict** than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion."
},
"wcag20:4.1.2": {
"secondary": "This success criterion is **less strict** than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion."
}
},
"expected": "passed",
"testcaseId": "2c80908133ee63545a20ea45952de6f7d6cf845b",
"testcaseTitle": "Passed Example 13",
"relativePath": "testcases/5c01ea/2c80908133ee63545a20ea45952de6f7d6cf845b.html",
"url": "https://www.w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/2c80908133ee63545a20ea45952de6f7d6cf845b.html",
"rulePage": "https://www.w3.org/WAI/standards-guidelines/act/rules/5c01ea/proposed/"
},
{
"ruleId": "5c01ea",
"ruleName": "ARIA state or property is permitted",
Expand Down Expand Up @@ -14818,6 +14880,37 @@
"url": "https://www.w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/d7efe21b64461052aef8d3e0fc96049dda787039.html",
"rulePage": "https://www.w3.org/WAI/standards-guidelines/act/rules/5c01ea/proposed/"
},
{
"ruleId": "5c01ea",
"ruleName": "ARIA state or property is permitted",
"ruleAccessibilityRequirements": {
"wcag-technique:ARIA5": {
"forConformance": false,
"failed": "not satisfied",
"passed": "further testing needed",
"inapplicable": "further testing needed"
},
"aria12:state_property_processing": {
"title": "ARIA 1.2, 8.6 State and Property Attribute Processing",
"forConformance": true,
"failed": "not satisfied",
"passed": "satisfied",
"inapplicable": "satisfied"
},
"wcag20:1.3.1": {
"secondary": "This success criterion is **less strict** than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion."
},
"wcag20:4.1.2": {
"secondary": "This success criterion is **less strict** than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion."
}
},
"expected": "failed",
"testcaseId": "eedabccf6e01bca36ee87a2af00e9d7a63a7d615",
"testcaseTitle": "Failed Example 4",
"relativePath": "testcases/5c01ea/eedabccf6e01bca36ee87a2af00e9d7a63a7d615.html",
"url": "https://www.w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/eedabccf6e01bca36ee87a2af00e9d7a63a7d615.html",
"rulePage": "https://www.w3.org/WAI/standards-guidelines/act/rules/5c01ea/proposed/"
},
{
"ruleId": "5c01ea",
"ruleName": "ARIA state or property is permitted",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 13</title>
</head>
<body>
<div role="separator" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" tabindex="0">My separator</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Passed Example 12</title>
</head>
<body>
<div role="switch" aria-checked="false" tabindex="0" aria-required="true">
<span class="label">Notifications</span>
<span class="switch" style="position: relative; display: inline-block; top: 6px; border: 2px solid black; border-radius: 12px; height: 20px; width: 40px;">
<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>
</span>
<span class="on" aria-hidden="true" style="display: none;">On</span>
<span class="off" aria-hidden="true">Off</span>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Failed Example 4</title>
</head>
<body>
<div role="paragraph" aria-label="Bananas"></div>
</body>
</html>
45 changes: 41 additions & 4 deletions content/rules/5c01ea/proposed.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ github:
feedbackmail: [email protected]
footer: |
<p><strong>Rule Identifier:</strong> 5c01ea</p>
<p><strong>Date:</strong> Updated 2 December 2024</p>
<p><strong>Date:</strong> Updated 7 February 2025</p>
<p><strong>Authors:</strong> <a href="https://github.com/annethyme">Anne Thyme Nørregaard</a>, <a href="https://github.com/Jym77">Jean-Yves Moyen</a>. Contributors: <a href="https://www.w3.org/community/act-r/participants">Participants of the ACT Rules Community Group (CG)</a>.</p>
<p>This rule was written in the <a href="https://w3.org/community/act-r/">ACT Rules Community Group</a>. It is written as part of the EU-funded <a href="https://www.w3.org/WAI/about/projects/wai-tools/">WAI-Tools Project</a>. Implementations are part of the EU funded <a href="https://www.w3.org/WAI/about/projects/wai-coop/">WAI-CooP Project</a>. It will be reviewed by the Accessibility Guidelines Working Group (<a href="https://www.w3.org/groups/wg/ag">AG WG</a>).</p>
Expand All @@ -22,7 +22,7 @@ rule_meta:
original_file: aria-state-or-property-permitted-5c01ea.md
description: |
This rule checks that WAI-ARIA states or properties are allowed for the element they are specified on.
last_modified: 2 December 2024
last_modified: 7 February 2025
---

## Applicability
Expand Down Expand Up @@ -156,7 +156,7 @@ The `aria-busy` [state][] is a [global][] [state][] that is [supported][] by all

<a class="example-link" title="Passed Example 4" target="_blank" href="https://w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/655b73c1435335a6a16852210787dc3621e73cef.html">Open in a new tab</a>

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

```html
<div role="button" aria-label="OK">✓</div>
Expand Down Expand Up @@ -206,7 +206,7 @@ The `aria-controls` [property][] is [required][] for the [semantic][semantic rol

<a class="example-link" title="Passed Example 9" target="_blank" href="https://w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/6c0718872b1d915b49c48fe135b9fc251bcff561.html">Open in a new tab</a>

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

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

#### Passed Example 12

<a class="example-link" title="Passed Example 12" target="_blank" href="https://w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/da2d6c53dd58121d0182d2498a104776da424e21.html">Open in a new tab</a>

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

```html
<div role="switch" aria-checked="false" tabindex="0" aria-required="true">
<span class="label">Notifications</span>
<span class="switch" style="position: relative; display: inline-block; top: 6px; border: 2px solid black; border-radius: 12px; height: 20px; width: 40px;">
<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>
</span>
<span class="on" aria-hidden="true" style="display: none;">On</span>
<span class="off" aria-hidden="true">Off</span>
</div>
```

#### Passed Example 13

<a class="example-link" title="Passed Example 13" target="_blank" href="https://w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/2c80908133ee63545a20ea45952de6f7d6cf845b.html">Open in a new tab</a>

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

```html
<div role="separator" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" tabindex="0">My separator</div>
```

### Failed

#### Failed Example 1
Expand Down Expand Up @@ -266,6 +293,16 @@ The `aria-label` property is [prohibited][] for an element with a `generic` role
<div aria-label="Bananas"></div>
```

#### Failed Example 4

<a class="example-link" title="Failed Example 4" target="_blank" href="https://w3.org/WAI/content-assets/wcag-act-rules/testcases/5c01ea/eedabccf6e01bca36ee87a2af00e9d7a63a7d615.html">Open in a new tab</a>

The `aria-label` property is [prohibited][] for an element with a `paragraph` role.

```html
<div role="paragraph" aria-label="Bananas"></div>
```

### Inapplicable

#### Inapplicable Example 1
Expand Down

0 comments on commit eb8484e

Please sign in to comment.