-
Notifications
You must be signed in to change notification settings - Fork 75
Target size minimum #2167
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
Draft
Jym77
wants to merge
73
commits into
develop
Choose a base branch
from
target-size-minimum
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Target size minimum #2167
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
1f3a63a
Add target size enhanced rule
WilcoFiers cfef38b
Rework a bit normative parts
Jym77 9a82752
Merge branch 'develop' into target-size-enhanced
Jym77 9ceba73
Merge branch 'develop' into target-size-enhanced
Jym77 c48767d
Refine rule a bit
Jym77 218bd99
Polish draft a bit
Jym77 62d2c9d
more work
Jym77 fa487ad
Merge branch 'develop' into target-size-enhanced
Jym77 90c4107
Attempt to write barebone defs
Jym77 67184e0
Some more notes
Jym77 b081edd
Text spacing rewrite (#1923)
Jym77 3f188b2
"Meta viewport allows for zoom" (b4f0c3): Explicit meaning of 'has' (…
Jym77 39748a1
Map Empty-heading rule to ARIA instead of WCAG (#2120)
WilcoFiers 58463aa
Deprecate 4.1.1 rules (#2117)
WilcoFiers 01a9d63
Fix markup issue in Iframe has name rule (#2116)
WilcoFiers dad2491
Stop linking to proposed rules (#2108)
WilcoFiers bb06ca3
Fix image-button accessibility support editorial oversight (#2106)
WilcoFiers a87ffeb
"Iframe not with interactive element" [akn7bn]: handle inert iframe (…
Jym77 1ea2503
Add much more examples
Jym77 23dc14b
Add much more examples
Jym77 c79f2f5
Merge branch 'develop' into target-size-enhanced
Jym77 e415158
Add more examples
Jym77 56bfa49
Merge branch 'develop' into target-size-enhanced
Jym77 4dffd15
Revert definition of clickable area
Jym77 38046c7
Clean up
Jym77 21f7cca
Merge branch 'develop' into target-size-enhanced
Jym77 5c492fb
Improve definition
Jym77 13e6ab8
Do not use aria-labelledby on raw div
Jym77 a37d2d9
Add definitions of implicit and explicit labels
Jym77 1351979
Add definition of shape-shifted element
Jym77 089d7aa
Clean up
Jym77 f5eb6d0
Remove example numbering until solidification
Jym77 f05a6ae
Merge branch 'develop' into target-size-enhanced
Jym77 3bf353f
Revert unrelated typo fix
Jym77 6618579
Write definitions
Jym77 421c5bf
Typos
Jym77 af064f2
Revert unrelated typo fix
Jym77 b4fe1de
Remove unrelated typo fix
Jym77 b65434a
Merge branch 'develop' into target-size-enhanced
Jym77 5faa824
Merge branch 'develop' into target-size-enhanced
7dc621c
Merge branch 'develop' into target-size-enhanced
Jym77 f92d3bb
Update rule and definition
Jym77 37a794a
Merge branch 'develop' into target-size-enhanced
Jym77 301f1f4
Clean up examples
Jym77 8719b7a
Move UA controlled exception from Applicability to Expectation
Jym77 cb8149c
Typo in link
Jym77 30e4c7f
Start breaking down rule
Jym77 affaf9d
Add atomic rule for equivalent control
Jym77 e26564b
Split essential size rule
Jym77 368b219
Split UA controlr exception
Jym77 654dfa0
Split inline exception
Jym77 5cf280f
Split empty area rule
Jym77 a17a20c
Polish composite rule
Jym77 7e49a1e
Add minimum size atomic rule
Jym77 505773a
Fix typo in date
Jym77 18d55ac
Improve examples
Jym77 1f256df
Write minimum spacing rule
Jym77 1a02922
Typos
Jym77 196e3ab
Typo
Jym77 60124e6
Improve text
Jym77 24922e5
Start writing equivalent condition for 2.5.8
Jym77 22d102b
Rename style file
Jym77 e2bc57a
Add body where needed
Jym77 9db0274
Finish examples
Jym77 43d244e
Add spelling exceptions
Jym77 35cc34c
Clean up reference list
Jym77 adbbebb
Typos
Jym77 1585357
Merge branch 'develop' into target-size-minimum
Jym77 656a93f
Add final rule and examples
Jym77 a0b6a07
Typo
Jym77 02f6b29
Merge branch 'develop' into target-size-minimum
Jym77 8e7e178
Merge branch 'develop' into target-size-minimum
Jym77 01d50e4
Merge branch 'develop' into target-size-minimum
Jym77 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 hidden or 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
This file contains hidden or 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,159 @@ | ||
--- | ||
id: kj4tr0 | ||
name: Interactive component has no clickable area | ||
rule_type: atomic | ||
description: | | ||
This rule checks that elements that can receive pointer events have an actual size reduced to 0. | ||
accessibility_requirements: | ||
wcag21:2.5.5: # Target size (enhanced) (AAA) | ||
secondary: 'This success criterion is **less strict** than this rule. This is because the rule does not consider the size of some elements. Some of the failed examples may satisfy this success criterion.' | ||
wcag22:2.5.8: # Target Size (Minimum) (AA) | ||
secondary: 'This success criterion is **less strict** than this rule. This is because this criterion has a lower size requirement. Some of the failed examples may satisfy this success criterion.' | ||
input_aspects: | ||
- DOM Tree | ||
- CSS Styling | ||
acknowledgments: | ||
authors: | ||
- Jean-Yves Moyen | ||
test_assets: Map Image by <a href="https://www.freepik.com/free-vector/black-white-town-navigation-map_5663353.htm">Freepik</a> | ||
--- | ||
|
||
## Applicability | ||
|
||
This rule applies to any [HTML element][namespaced element] which [can be targeted by a pointer event][]. | ||
|
||
## Expectation | ||
|
||
Each test target has an empty [clickable area][], and its [clickable area][] cannot be made non-empty through scrolling. | ||
|
||
## Assumptions | ||
|
||
- This rule assumes that [focusable][] `widget` are effectively clickable. If a widget is [focusable][] without being clickable, it may fail this rule while [Success Criterion 2.5.5 Target Size (enhanced)][sc255] and [Success Criterion 2.5.8 Target Size (minimum)][sc258] are satisfied. | ||
|
||
## Accessibility Support | ||
|
||
Hit testing isn't properly defined, and this has been an [issue in the CSS specification](https://github.com/w3c/csswg-drafts/issues/2325) for years. Therefore, different User Agents may perform it differently, resulting in different [clickable areas][clickable area] for the same element. As of February 2024, the ACT rules Community Group is not aware of actual cases resulting in significantly different [clickable areas][clickable area]. | ||
|
||
## Background | ||
|
||
### Bibliography | ||
|
||
- [Understanding Success Criterion 2.5.5: Target Size (enhanced)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-enhanced.html) | ||
- [Understanding Success Criterion 2.5.8: Target Size (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html) | ||
|
||
## Test Cases | ||
|
||
### Passed | ||
|
||
#### Passed Example 1 | ||
|
||
This button has an empty [clickable area][] because it is moved off-screen. | ||
|
||
```html | ||
<style> | ||
#target { | ||
width: 44px; | ||
height: 44px; | ||
border-radius: 0; | ||
position: absolute; | ||
left: -9999px; | ||
} | ||
</style> | ||
<button id="target" onclick="alert('hello')">Hello</button> | ||
``` | ||
|
||
### Failed | ||
|
||
#### Failed Example 1 | ||
|
||
This `button` has a non-empty [clickable area][]. | ||
|
||
```html | ||
<style> | ||
#target { | ||
width: 35px; | ||
height: 35px; | ||
border-radius: 0; | ||
} | ||
</style> | ||
<button id="target" onclick="alert('hello')">Hi</button> | ||
``` | ||
|
||
#### Failed Example 2 | ||
|
||
This `button` has a [clickable area][] that can be made non-empty through vertical scrolling. | ||
|
||
```html | ||
<style> | ||
#target { | ||
width: 35px; | ||
height: 35px; | ||
border-radius: 0; | ||
position: absolute; | ||
top: 200vh; | ||
} | ||
</style> | ||
<button id="target" onclick="alert('hello')">Hi</button> | ||
``` | ||
|
||
#### Failed Example 3 | ||
|
||
This `button` has a [clickable area][] that can be made non-empty through horizontal scrolling. | ||
|
||
```html | ||
<style> | ||
#target { | ||
width: 35px; | ||
height: 35px; | ||
border-radius: 0; | ||
position: absolute; | ||
left: 110vw; | ||
} | ||
</style> | ||
<button id="target" onclick="alert('hello')">Hi</button> | ||
``` | ||
|
||
### Inapplicable | ||
|
||
#### Inapplicable Example 1 | ||
|
||
These `input` elements and `button` are `disabled` and therefore not [focusable][]. | ||
|
||
```html | ||
<fieldset disabled> | ||
<label>First name <input /></label><br /> | ||
<label>Last name <input /></label><br /> | ||
<button>submit</button> | ||
</fieldset> | ||
``` | ||
|
||
#### Inapplicable Example 2 | ||
|
||
This button cannot be [targeted by a pointer event][] because it is entirely covered by the `div` element with a dashed red border. | ||
|
||
```html | ||
<head> | ||
<title>Inapplicable Example</title> | ||
<link rel="stylesheet" href="/test-assets/target-size/shared-styles.css" /> | ||
<style> | ||
.cover { | ||
top: 0; | ||
height: 50px; | ||
width: 500px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<button onclick="alert('hello')">Say Hello</button> | ||
|
||
<div class="cover bad highlight"></div> | ||
</body> | ||
``` | ||
|
||
[can be targeted by a pointer event]: #can-be-targeted-by-pointer-event 'Definition of Can be Targeted by a Pointer Event' | ||
[clickable area]: #clickable-area 'Definition of Clickable Area' | ||
[focusable]: #focusable 'Definition of Focusable' | ||
[namespaced element]: #namespaced-element 'Definition of Namespaced Element' | ||
[sc255]: https://www.w3.org/TR/WCAG22/#target-size-enhanced 'Success Criterion 2.5.5 Target Size (enhanced)' | ||
[sc258]: https://www.w3.org/TR/WCAG22/#target-size-minimum 'Success Criterion 2.5.8 Target Size (minimum)' | ||
[targeted by a pointer event]: #can-be-targeted-by-pointer-event 'Definition of Can be Targeted by a Pointer Event' |
Oops, something went wrong.
Oops, something went wrong.
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 need some more background here. I'm not sure I understand what this rule is trying to do or really even how the S.C. are being applied.