Skip to content
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

Rule: ARIA required context role (ff89c9) #255

Merged
merged 74 commits into from
Nov 25, 2019
Merged
Changes from 2 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4b2cd9a
Create SC1-3-1-aria-required-context-role.md
Sep 14, 2018
bdbfbeb
Update SC1-3-1-aria-required-context-role.md
Sep 15, 2018
f80607d
Editorial update per feedback
Oct 3, 2018
409bb9a
Removed test case per feedback
Oct 3, 2018
8f79ac6
Update to Accessibility Support
Oct 3, 2018
4f4701d
Cleaner WAI-ARIA references
Oct 5, 2018
7b43dde
Editorials per feedback from Kasper
Oct 18, 2018
2ac617f
Create owner-element.md
Jan 22, 2019
ded2be6
Update owner-element.md
Jan 22, 2019
8a81b50
Update rule to use new Owner element definition
Jan 22, 2019
1542f48
Update owner-element.md
Jan 22, 2019
b9b79a8
chore: merge from master
jeeyyy Jan 22, 2019
8bf6038
Update included-in-the-accessibility-tree.md
Jan 22, 2019
dfc56b2
Update owner-element.md
Jan 22, 2019
c2ccbc1
Removed role="none"/"presentation"
Jan 22, 2019
35d480e
Updated test cases to match new definitions
Jan 22, 2019
9835b44
Add note about divergence from WAI-ARIA spec
Jan 22, 2019
d92d89c
Update SC1-3-1-aria-required-context-role.md
Jan 22, 2019
16f50c7
Editorials
Jan 22, 2019
47e4ce5
`aria-owns` support added to Accessibility Support
Feb 12, 2019
96472af
Test case moved from Failed to Inapplicable
Feb 12, 2019
0785f09
Changed "element" to "node"
Feb 12, 2019
9c81dcd
Disclaimer notes inserted
Feb 12, 2019
52a4b1e
Note added on hiding elements
Feb 12, 2019
4339973
Editorials per Wilco's comments
Mar 5, 2019
5c7b137
Updating to account for competing owned elements
Mar 6, 2019
127beb4
Adding links to definitions
Mar 6, 2019
473016f
Added link to definition
Mar 6, 2019
b952555
Rule updated to use new "owned by" definition
Mar 6, 2019
dc50845
Reverting changes to "included in the acc. tree"
Mar 6, 2019
542090d
Added inapplicable test case
Mar 6, 2019
31a7bf1
Added Passed test case
Mar 7, 2019
576eb0d
New assumption: role being used to comply to WCAG
Mar 7, 2019
c031c89
Further elaboration of assumption
Mar 7, 2019
8d08752
Editorials per Kasper's comments
Mar 21, 2019
08069fa
Fix incorrect code and descriptions in test cases
Apr 23, 2019
7578413
Accessibility Support note on empty elements
Apr 23, 2019
b360785
Editorial: Slight rewording of Expectation
May 1, 2019
4b13b65
Add id to frontmatter of rule
May 1, 2019
922d3e8
Update template + editorials + note for Appl.
Jun 7, 2019
33d0f44
Now tree-crossing ownership for implicit ownership
Jun 12, 2019
e9f8a8a
Added test cases crossing shadow boundaries
Jun 12, 2019
1a6d693
Extended description for shadow DOM test cases
Jun 13, 2019
9a6da41
Update SC1-3-1-aria-required-context-role.md
Brynanders Jul 3, 2019
6839767
Merge branch 'develop' into sc1-3-1-aria-required-context-role
jeeyyy Jul 3, 2019
376ce5f
Editorials
Jul 10, 2019
9b73e57
Editorial: plural for consistency
Jul 12, 2019
87777d3
Change test case description to match test case
Jul 12, 2019
476a2e6
Merge branch 'develop' into sc1-3-1-aria-required-context-role
jeeyyy Jul 17, 2019
4ff8e00
Rename SC1-3-1-aria-required-context-role.md to aria-required-context…
jeeyyy Jul 17, 2019
b7e25e0
Insert link to Understanding 1.3.1 document
Jul 18, 2019
c41e314
Add example to Appl. + change definition links
Jul 26, 2019
78169f8
Remove `slot` element from Passed Example 6
Jul 26, 2019
ee977ac
Add content to elements + Add new test case
Jul 26, 2019
c41dfe3
More links to "explicit-role" def. + fix typo
Aug 5, 2019
8f62229
Expectation: Note on superclass/subclass roles
Aug 6, 2019
32b92de
Edit subclass inclusion in required context roles
Aug 13, 2019
07ba91a
Add note about descoping DPUB from applicability
Aug 13, 2019
191b5cc
Adding inapplicable DPUB test case
Aug 14, 2019
c4e760e
Merge branch 'develop' into sc1-3-1-aria-required-context-role
jeeyyy Aug 14, 2019
f152e32
chore: merge from develop
jeeyyy Aug 14, 2019
8262e3a
Rename owner-element.md to owned-by.md
Aug 16, 2019
4efedba
Remove note + inclusion i acc. tree for point 1
Aug 16, 2019
1af2679
Editorials + change test cases
Aug 16, 2019
45f5648
Changing Passed Example 5 to pass SC 1.3.1
Aug 21, 2019
ca84d89
Merge branch 'develop' into sc1-3-1-aria-required-context-role
WilcoFiers Sep 25, 2019
89aee3c
Merge branch 'develop' into sc1-3-1-aria-required-context-role
Jym77 Oct 18, 2019
f4f5188
chore: update rule to use accessibility tree as input
WilcoFiers Nov 1, 2019
5b45798
Merge branch 'develop' into sc1-3-1-aria-required-context-role
WilcoFiers Nov 1, 2019
e3db62e
chore: fix failing tests
WilcoFiers Nov 1, 2019
5cbc373
Apply suggestions from code review
WilcoFiers Nov 13, 2019
7362c00
Merge branch 'develop' into sc1-3-1-aria-required-context-role
WilcoFiers Nov 13, 2019
5db02eb
Update aria-required-context-role-ff89c9.md
WilcoFiers Nov 13, 2019
b8519e1
Merge branch 'develop' into sc1-3-1-aria-required-context-role
jeeyyy Nov 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions _rules/SC1-3-1-aria-required-context-role.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
name: ARIA required context role
description: |
This rule checks that a role does not exist outside of its required context roles

success_criterion:
- 1.3.1 # Info and Relationships
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update to the new format.


test_aspects:
- DOM Tree
- CSS Styling

authors:
- Anne Thyme Nørregaard
---

## Test procedure

### Applicability

The rule applies to any HTML or SVG element that is [exposed to assistive technologies](#exposed-to-assistive-technologies) and has an explicit [semantic role](#semantic-role) that has [required context roles](https://www.w3.org/TR/wai-aria-1.1/#scope) listed for that role in [WAI-ARIA](https://www.w3.org/TR/wai-aria).

### Expectation

Each target element is [owned](https://www.w3.org/TR/wai-aria-1.1/#dfn-owned-element) by an element that is [exposed to assistive technologies](#exposed-to-assistive-technologies) and has a [semantic role](#semantic-role) matching one of the [required context roles](https://www.w3.org/TR/wai-aria-1.1/#scope) listed for that role in [WAI-ARIA](https://www.w3.org/TR/wai-aria).

## Assumptions

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.


_There are currently no assumptions_

## Accessibility Support

When a required owned element is not a child, but rather a descendant, certain AT have issues recognizing the owned element.

## Background

- [Required Context Role](https://www.w3.org/TR/wai-aria-1.1/#scope)

## Test Cases

### Passed

#### Passed example 1

Element with role ´listitem´ is contained within its required context role ´list´, expressed as an explicit role.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

´ -> `


```html
<div role="list">
<div role="listitem"></div>
</div>
```

#### Passed example 2

Multiple levels of required context roles.

```html
<div role="table">
<div role="row">
<div role="cell"></div>
</div>
</div>
</div>
```

#### Passed example 3

Element with role ´listitem´ is contained within its required context role ´list´, through the implicit role of ´ul´.

```html
<ul>
<div role="listitem"></div>
</ul>
```

#### Passed example 4

Element contained within its required context role even though it is not a direct child of the context role.

```html
<div role="list">
<div>
<div>
<div>
<div role="listitem"></div>
</div>
<div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two <div> should be </div> (although it doesn't change the outcome)

<div>
</div>
```

### Failed

#### Failed example 1

No context role.

```html
<div role="listitem"></div>
```

#### Failed example 2

Wrong context role

```html
<div role="tablist">
<div role="listitem"></div>
</div>
```

#### Failed example 3

Element not contained within its required context role.

```html
<div role="list"></div>
<div role="listitem"></div>
```

### Inapplicable

#### Inapplicable example 1

Element does not have an explicit semantic role

```html
<ul></ul>
```

#### Inapplicable example 2

Element is not exposed to assistive technologies.

```html
<div role="tab" aria-hidden="true"></div>
```

#### Inapplicable example 3

Role does not have any required context roles listed in WAI-ARIA spec.

```html
<div role="radio"></div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the #546 , this test case is missing an accessible name to conform to SC 1.3.1 . Moreover, the radio implicit role required aria-checked to share its state.

Proposal

<label for="control-radio"> A radio control</label>
<div role="radio" aria-checked="true" id="control-radio"></div>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say it actually doesn't. The rule Form field has an accessible name is only for 4.1.2.
I would also say that the requirement for having aria-checked on there is for 4.1.2 - if it is a requirement at all, since there is a fallback value (false) specified for it in WAI-ARIA (see "Implicit value for role" in https://www.w3.org/TR/wai-aria-1.1/#radio).

It's not that I don't want to put it on, but then at least also the tabpanel roles in Passed Example 5, Failed Example 5 and Failed Example 6 also needs to have a name, since accessible name is required for that role too (see https://www.w3.org/TR/wai-aria-1.1/#tabpanel).

```