-
Notifications
You must be signed in to change notification settings - Fork 70
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
New Rule: Create Semantic Focus (a20046) #559
Closed
Closed
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
691f4a9
Create Scemantic Focus
ramitgarg 8faa42c
Update Scemantic Focus
ramitgarg 7fb0730
Merge branch 'develop' into patch-1
jeeyyy f97c0fe
Update and rename Scemantic Focus to semantic-focus-a20046.md
carlosapaduarte 42215ed
Update semantic-focus-a20046.md
carlosapaduarte a309504
Update semantic-focus-a20046.md
carlosapaduarte b762a1f
Update semantic-focus-a20046.md
carlosapaduarte d2e527e
Merge branch 'develop' into patch-1
WilcoFiers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
id: a20046 | ||
name: Sequential focus has semantic role | ||
rule_type: atomic | ||
|
||
description: | | ||
This rule checks that every element that is part of the sequential focus navigation order has a semantic role. | ||
|
||
accessibility_requirements: | ||
wcag20:4.1.2: # Name, Role, Value (A) | ||
forConformance: true | ||
failed: not satisfied | ||
passed: further testing needed | ||
inapplicable: further testing needed | ||
|
||
input_aspects: | ||
- DOM Tree | ||
- CSS Styling | ||
|
||
authors: | ||
- Carlos Duarte | ||
- Damien Engels | ||
- Marie Trudelle | ||
- Ramit Garg | ||
--- | ||
|
||
## Applicability | ||
|
||
The rule applies to all HTML and SVG elements in the [sequential focus navigation order](https://www.w3.org/TR/html/editing.html#sequential-focus-navigation) that are [included in the accessibility tree](#included-in-the-accessibility-tree). | ||
|
||
## Expectation | ||
|
||
Each target element has a [semantic role](#semantic-role) that is not `presentation` or `none`. | ||
|
||
## Assumptions | ||
|
||
_There are currently no assumptions._ | ||
|
||
## Accessibility support | ||
|
||
_There are no major accessibility support issues known for this rule._ | ||
|
||
## Background | ||
|
||
- [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html) | ||
- [G108: Using markup features to expose the name and role, allow user-settable properties to be directly set, and provide notification of changes](https://www.w3.org/WAI/WCAG21/Techniques/general/G108) | ||
- [ARIA4: Using a WAI-ARIA role to expose the role of a user interface component](https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA4) | ||
- [F79: Failure of Success Criterion 4.1.2 due to the focus state of a user interface component not being programmatically determinable or no notification of change of focus state available](https://www.w3.org/WAI/WCAG21/Techniques/failures/F79) | ||
|
||
## Test Cases | ||
|
||
### Passed | ||
|
||
#### Passed Example 1 | ||
|
||
Focusable element `a` has implicit semantic role `link` | ||
|
||
```html | ||
<a href="https://act-rules.github.io/">Go to home page</a> | ||
``` | ||
|
||
#### Passed Example 2 | ||
|
||
Element with `tabindex=0` has explicit semantic role | ||
|
||
```html | ||
<div id="id1" role="button" tabindex="0">Go</div> | ||
``` | ||
|
||
### Failed | ||
|
||
#### Failed Example 1 | ||
|
||
Focusable element `input` has role overriden to `none` | ||
|
||
```html | ||
<input type="text" role="none"> | ||
``` | ||
|
||
#### Failed Example 2 | ||
|
||
Element with `tabindex=0` has `presentation` role | ||
|
||
```html | ||
<div href="#desc" role="presentation" tabindex="0">More</div> | ||
``` | ||
|
||
### Inapplicable | ||
|
||
#### Inapplicable Example 1 | ||
|
||
Element `input` removed from the sequential navigation order | ||
|
||
```html | ||
<input type="text" tabindex="-1"> | ||
``` | ||
|
||
#### Inapplicable Example 2 | ||
|
||
Element `div` not in the sequential navigation order | ||
|
||
```html | ||
<div></div> | ||
``` | ||
|
||
#### Inapplicable Example 3 | ||
|
||
Element `button` is `disabled` and, thus, not focusable | ||
|
||
```html | ||
<button disabled>Click here</button> | ||
``` | ||
|
||
#### Inapplicable Example 4 | ||
|
||
Focusable element `a` is not included in the accessibility tree | ||
|
||
```html | ||
<a href="#main" aria-hidden="true">More</a> | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would (still) not say this fails WCAG 4.1.2.
A Div with tabindex is not a user interface component and doesn't need a role.