-
Notifications
You must be signed in to change notification settings - Fork 82
New rule: role is permitted #2084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
692b313
fdbdbfd
05cd71b
a9ffc70
aea2cbd
53875b0
c8a6432
81a2a82
c302b75
80350ac
3157e39
69bf415
f578d1d
162e213
891c9d9
bb7a835
655589f
234141a
8be5958
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| --- | ||
| id: j7zzqr | ||
| name: ARIA role is permitted. | ||
| rule_type: atomic | ||
| description: | | ||
| This rule checks that WAI-ARIA roles are allowed for the element they are specified on. | ||
| accessibility_requirements: | ||
| html-aria:docconformance: | ||
| title: ARIA in HTML, 4. Document conformance requirements for use of ARIA attributes in HTML | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, this is going to be very nit picky.
I don't think the way you're interpreting this requirement is right. Or quite possibly, I think the requirement is written incorrectly. MAY in RFC2119 speak does not create a prohibitive statement. You can use these roles on those elements, and browsers have to support it when you do. But that's not the same as saying authors are not allowed to use other roles. It would have to be something like "if an author specifies a role it MUST be one from the third column." I think this is a solid rule, and we should definitely have it, but I'm a little reluctant to say this is a conformance requirement for ARIA in HTML. Even if that was the intended meaning, that's not what it says. I don't really want to hold this rule up over a technicality like this, but I do think something needs to be done about this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @WilcoFiers the sentence you quote needs to be put into the context of section 1 Author requirements fo ruse of ARIA in HTML
per section 1, it's an Authors MUST NOT - where the Author MAYs specificy what it allowed. if you think this is unclear because one has to piece together these different parts of the specification, then that's fair. The spec can be updated to restate the author requirements more overtly in tandem with the text you quoted. |
||
| forConformance: true | ||
| failed: not satisfied | ||
| passed: satisfied | ||
| inapplicable: satisfied | ||
| wcag20:1.3.1: # Info and Relationships (A) | ||
| secondary: true | ||
| wcag20:4.1.2: # Name, Role, Value (A) | ||
| secondary: true | ||
| wcag-technique:ARIA4: # Using a WAI-ARIA role to expose the role of a user interface component | ||
| secondary: true | ||
Jym77 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| input_aspects: | ||
| - Accessibility Tree | ||
| - DOM Tree | ||
| acknowledgments: | ||
| authors: | ||
| - Jean-Yves Moyen | ||
| --- | ||
|
|
||
| ## Applicability | ||
|
|
||
| This rule applies to any [HTML element][namespaced element] that is [included in the accessibility tree][] and has an [explicit semantic role][explicit role]. | ||
|
|
||
| ## Expectation | ||
|
|
||
| For each test target, its [explicit semantic role][explicit role] is allowed on this element, according to [ARIA in HTML specifications][aria in html document conformance]. | ||
Jym77 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Assumptions | ||
|
|
||
| There are no assumptions. | ||
|
|
||
| ## Accessibility Support | ||
|
|
||
| There are no accessibility support issues known. | ||
|
|
||
| ## Background | ||
|
|
||
| The presence of an invalid role often implies that the programmatic role do not correspond to the one that is conveyed visually, or that the interactions provided by the elements do not match the ones expected for this role. Therefore, both [Success Criterion 1.3.1 Info and Relationships][sc131] and [Success Criterion 4.1.2 Name, Role, Value][sc412] are secondary requirements for this rule. | ||
Jym77 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| [ARIA in HTML][aria in html document conformance] also defines the [implicit semantic role][implicit role] of each element. Setting the [explicit role][] as the same as the [implicit one][implicit role] is not recommended but nonetheless allowed. This rule doesn't use that in any of its test cases. | ||
|
|
||
| ### Related rules | ||
|
|
||
| - [Role attribute has valid value](https://www.w3.org/WAI/standards-guidelines/act/rules/674b10/proposed/) checks that the value of the `role` attribute exists in ARIA, while this rule checks that it is allowed on the element using it. | ||
|
|
||
| ### Bibliography | ||
|
|
||
| - [Document conformance requirements for use of ARIA attributes in HTML](https://www.w3.org/TR/html-aria/#docconformance) | ||
| - [Understanding SC 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html) | ||
| - [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html) | ||
| - [Technique ARIA4: Using a WAI-ARIA role to expose the role of a user interface component](https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA4) | ||
|
|
||
| ## Test Cases | ||
|
|
||
| ### Passed | ||
|
|
||
| #### Passed Example 1 | ||
|
|
||
| This `a` element has an [explicit role][] of `button`, which is allowed. | ||
|
|
||
| ```html | ||
| <a href="https://www.w3.org/WAI/standards-guidelines/act/rules/" role="button">All ACT rules</a> | ||
| ``` | ||
|
|
||
| #### Passed Example 2 | ||
|
|
||
| This `h1` element has an [explicit role][] of `tab`, which is allowed | ||
|
|
||
| ```html | ||
| <h1 role="tab">ACT rules</h1> | ||
|
||
| ``` | ||
|
|
||
| ### Failed | ||
Jym77 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| #### Failed Example 1 | ||
|
|
||
| This `button` element has an [explicit role][] of `heading`, which is not allowed. | ||
|
|
||
| ```html | ||
| <button role="heading">ACT rules</button> | ||
| ``` | ||
|
|
||
| ### Inapplicable | ||
|
|
||
| #### Inapplicable Example 1 | ||
|
|
||
| There is no [HTML element][namespaced element]. | ||
|
|
||
| ```svg | ||
| <svg xmlns="http://www.w3.org/2000/svg"> | ||
| <title>This is an SVG</title> | ||
| </svg> | ||
| ``` | ||
|
|
||
| #### Inapplicable Example 2 | ||
|
|
||
| This `button` element is not [included in the accessibility tree][]. | ||
|
|
||
| ```html | ||
| <button role="list" style="display:none;">Click me</button> | ||
|
||
| ``` | ||
|
|
||
| #### Inapplicable Example 3 | ||
|
|
||
| This `a` element does not have an [explicit semantic role][]:. | ||
|
|
||
| ```html | ||
| <a href="https://www.w3.org/WAI/standards-guidelines/act/rules/">All ACT rules</a> | ||
| ``` | ||
|
|
||
| [aria in html document conformance]: https://www.w3.org/TR/html-aria/#docconformance 'ARIA is HTML, Document conformance requirements for use of ARIA attributes in HTML' | ||
| [explicit role]: #explicit-role 'Definition of Explicit Role' | ||
| [implicit role]: #implicit-role 'Definition of Implicit Role' | ||
| [included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of Included in the Accessibility Tree' | ||
| [namespaced element]: #namespaced-element | ||
| [sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships | ||
| [sc412]: https://www.w3.org/TR/WCAG21/#name-role-value | ||
Uh oh!
There was an error while loading. Please reload this page.