Skip to content

Commit e17ea0c

Browse files
giacomo-petriJym77WilcoFiers
authored
Updated "Scrollable content can be reached with sequential focus navigation" [0ssw9k]: scrollable regions pass when there is an open modal (#2219)
* scrollable regions should pass when there is an open modal - updated expectation to exclude inert elements from sequential focus - added passing example * Update _rules/scrollable-element-keyboard-accessible-0ssw9k.md Co-authored-by: Jean-Yves Moyen <[email protected]> * Update scrollable-element-keyboard-accessible-0ssw9k.md --------- Co-authored-by: Jean-Yves Moyen <[email protected]> Co-authored-by: Wilco Fiers <[email protected]>
1 parent 6be0845 commit e17ea0c

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

_rules/scrollable-element-keyboard-accessible-0ssw9k.md

+45-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ This rule applies to any [HTML element][] that has [visible][] [children][] in t
3939

4040
## Expectation
4141

42-
Each test target is either included in [sequential focus navigation][] or has a [descendant][] in the [flat tree][] that is included in [sequential focus navigation][].
42+
For each target element, at least one of the following is true:
43+
- the element is included in [sequential focus navigation][]; or
44+
- the element has a [descendant][] in the [flat tree][] that is included in [sequential focus navigation][]; or
45+
- the element is [inert][].
4346

4447
## Assumptions
4548

@@ -108,6 +111,46 @@ This [scrollable][] `section` element contains a link that is included in [seque
108111
</section>
109112
```
110113

114+
#### Passed Example 3
115+
116+
This [scrollable][] `section` element is [inert][] because of the modal dialog, so neither the `section` nor its [descendant][] elements are included in [sequential focus navigation][].
117+
118+
```html
119+
<style>
120+
dialog:-internal-dialog-in-top-layer::backdrop {
121+
background: rgba(1, 1, 1, 0.8);
122+
}
123+
</style>
124+
<section style="height: 100px; width: 500px; overflow: scroll;" tabindex="0">
125+
<h1>WCAG 2.1 Abstract</h1>
126+
<p>
127+
Web Content Accessibility Guidelines (WCAG) 2.1 covers a wide range of recommendations for making Web content more
128+
accessible. Following these guidelines will make content more accessible to a wider range of people with
129+
disabilities, including accommodations for blindness and low vision, deafness and hearing loss, limited movement,
130+
speech disabilities, photosensitivity, and combinations of these, and some accommodation for learning disabilities
131+
and cognitive limitations; but will not address every user need for people with these disabilities. These guidelines
132+
address accessibility of web content on desktops, laptops, tablets, and mobile devices. Following these guidelines
133+
will also often make Web content more usable to users in general.
134+
<button id="ppButton" onclick="openDialog()">Read more about WCAG 2.2</button>
135+
</p>
136+
</section>
137+
<dialog id="ppDialog" aria-labelledby="dialogLabel">
138+
<h2 id="dialogLabel">WCAG 2.2</h2>
139+
<p>
140+
<a href="https://www.w3.org/TR/WCAG22/">WCAG 2.2</a>
141+
</p>
142+
<button id="cancel" onclick="ppDialog.close()">Cancel</button>
143+
</dialog>
144+
<script>
145+
const openDialog = () => {
146+
ppDialog.showModal();
147+
myFrame.tabIndex = '-1'
148+
}
149+
ppDialog.addEventListener('close', () => myFrame.tabIndex = 0)
150+
window.addEventListener('DOMContentLoaded', openDialog);
151+
</script>
152+
```
153+
111154
### Failed
112155

113156
#### Failed Example 1
@@ -262,6 +305,7 @@ This `iframe` element is not a scrollable element, but instead contains a nested
262305
[sequential focus navigation]: https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation 'HTML sequential focus navigation, 2020/04/03'
263306
[flat tree]: https://drafts.csswg.org/css-scoping/#flat-tree 'CSS draft, flat tree, 2020/04/03'
264307
[computed]: https://www.w3.org/TR/css-cascade-3/#computed-value
308+
[inert]: #inert 'Definition of Inert'
265309
[overflow]: https://www.w3.org/TR/CSS22/visufx.html#overflow
266310
[padding]: https://www.w3.org/TR/CSS22/box.html#propdef-padding
267311
[padding-left]: https://www.w3.org/TR/CSS22/box.html#propdef-padding-left

0 commit comments

Comments
 (0)