Skip to content

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
wants to merge 73 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
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 Sep 8, 2022
cfef38b
Rework a bit normative parts
Jym77 Aug 10, 2023
9a82752
Merge branch 'develop' into target-size-enhanced
Jym77 Aug 17, 2023
9ceba73
Merge branch 'develop' into target-size-enhanced
Jym77 Sep 14, 2023
c48767d
Refine rule a bit
Jym77 Sep 14, 2023
218bd99
Polish draft a bit
Jym77 Sep 15, 2023
62d2c9d
more work
Jym77 Sep 28, 2023
fa487ad
Merge branch 'develop' into target-size-enhanced
Jym77 Oct 5, 2023
90c4107
Attempt to write barebone defs
Jym77 Oct 5, 2023
67184e0
Some more notes
Jym77 Oct 13, 2023
b081edd
Text spacing rewrite (#1923)
Jym77 Oct 13, 2023
3f188b2
"Meta viewport allows for zoom" (b4f0c3): Explicit meaning of 'has' (…
Jym77 Oct 13, 2023
39748a1
Map Empty-heading rule to ARIA instead of WCAG (#2120)
WilcoFiers Oct 13, 2023
58463aa
Deprecate 4.1.1 rules (#2117)
WilcoFiers Oct 13, 2023
01a9d63
Fix markup issue in Iframe has name rule (#2116)
WilcoFiers Oct 13, 2023
dad2491
Stop linking to proposed rules (#2108)
WilcoFiers Oct 13, 2023
bb06ca3
Fix image-button accessibility support editorial oversight (#2106)
WilcoFiers Oct 13, 2023
a87ffeb
"Iframe not with interactive element" [akn7bn]: handle inert iframe (…
Jym77 Oct 16, 2023
1ea2503
Add much more examples
Jym77 Oct 26, 2023
23dc14b
Add much more examples
Jym77 Oct 26, 2023
c79f2f5
Merge branch 'develop' into target-size-enhanced
Jym77 Nov 9, 2023
e415158
Add more examples
Jym77 Nov 9, 2023
56bfa49
Merge branch 'develop' into target-size-enhanced
Jym77 Nov 23, 2023
4dffd15
Revert definition of clickable area
Jym77 Nov 23, 2023
38046c7
Clean up
Jym77 Nov 23, 2023
21f7cca
Merge branch 'develop' into target-size-enhanced
Jym77 Dec 14, 2023
5c492fb
Improve definition
Jym77 Dec 14, 2023
13e6ab8
Do not use aria-labelledby on raw div
Jym77 Dec 14, 2023
a37d2d9
Add definitions of implicit and explicit labels
Jym77 Dec 14, 2023
1351979
Add definition of shape-shifted element
Jym77 Dec 14, 2023
089d7aa
Clean up
Jym77 Dec 14, 2023
f5eb6d0
Remove example numbering until solidification
Jym77 Dec 14, 2023
f05a6ae
Merge branch 'develop' into target-size-enhanced
Jym77 Dec 21, 2023
3bf353f
Revert unrelated typo fix
Jym77 Dec 21, 2023
6618579
Write definitions
Jym77 Dec 21, 2023
421c5bf
Typos
Jym77 Dec 21, 2023
af064f2
Revert unrelated typo fix
Jym77 Dec 21, 2023
b4fe1de
Remove unrelated typo fix
Jym77 Dec 21, 2023
b65434a
Merge branch 'develop' into target-size-enhanced
Jym77 Jan 25, 2024
5faa824
Merge branch 'develop' into target-size-enhanced
Jan 26, 2024
7dc621c
Merge branch 'develop' into target-size-enhanced
Jym77 Feb 15, 2024
f92d3bb
Update rule and definition
Jym77 Feb 15, 2024
37a794a
Merge branch 'develop' into target-size-enhanced
Jym77 Feb 29, 2024
301f1f4
Clean up examples
Jym77 Feb 29, 2024
8719b7a
Move UA controlled exception from Applicability to Expectation
Jym77 Mar 1, 2024
cb8149c
Typo in link
Jym77 Mar 1, 2024
30e4c7f
Start breaking down rule
Jym77 Mar 7, 2024
affaf9d
Add atomic rule for equivalent control
Jym77 Mar 7, 2024
e26564b
Split essential size rule
Jym77 Mar 7, 2024
368b219
Split UA controlr exception
Jym77 Mar 7, 2024
654dfa0
Split inline exception
Jym77 Mar 7, 2024
5cf280f
Split empty area rule
Jym77 Mar 7, 2024
a17a20c
Polish composite rule
Jym77 Mar 7, 2024
7e49a1e
Add minimum size atomic rule
Jym77 Mar 7, 2024
505773a
Fix typo in date
Jym77 Mar 8, 2024
18d55ac
Improve examples
Jym77 Mar 8, 2024
1f256df
Write minimum spacing rule
Jym77 Mar 8, 2024
1a02922
Typos
Jym77 Mar 8, 2024
196e3ab
Typo
Jym77 Mar 8, 2024
60124e6
Improve text
Jym77 Mar 8, 2024
24922e5
Start writing equivalent condition for 2.5.8
Jym77 Mar 8, 2024
22d102b
Rename style file
Jym77 Mar 17, 2024
e2bc57a
Add body where needed
Jym77 Mar 17, 2024
9db0274
Finish examples
Jym77 Mar 17, 2024
43d244e
Add spelling exceptions
Jym77 Mar 17, 2024
35cc34c
Clean up reference list
Jym77 Mar 17, 2024
adbbebb
Typos
Jym77 Mar 17, 2024
1585357
Merge branch 'develop' into target-size-minimum
Jym77 Mar 23, 2024
656a93f
Add final rule and examples
Jym77 Apr 3, 2024
a0b6a07
Typo
Jym77 Apr 3, 2024
02f6b29
Merge branch 'develop' into target-size-minimum
Jym77 Apr 4, 2024
8e7e178
Merge branch 'develop' into target-size-minimum
Jym77 Apr 11, 2024
01d50e4
Merge branch 'develop' into target-size-minimum
Jym77 Feb 6, 2025
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
19 changes: 18 additions & 1 deletion __tests__/spelling-ignore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- https
- wai-aria
- validator
- 8lzn42

# Tag(s)
- svg # `aria-query` dom tags does not list `svg`
Expand Down Expand Up @@ -88,6 +89,7 @@
- rfc
- webauthn
- customizable
- ua #lowercase needed in reference list

# spell checker checks against strict casing & hence some repeated words here
- Autocomplete
Expand Down Expand Up @@ -136,7 +138,7 @@
- ozplayer
- GitHub

# Test case anamolies
# Test case anomalies
- brewitt-taylor
- level2-frame1
- level1-frame2
Expand Down Expand Up @@ -210,6 +212,11 @@
- dom-meta-content
- showModal

# Javascript identifiers
- clientRects
- getBoundingClientRect
- getClientRects

# Unsure why the dictionary does not have these words
- programmatically
- personalization
Expand Down Expand Up @@ -238,6 +245,7 @@
- focusability
- unitless
- luminance
- checkboxes # this seems to be the correct plural
- disambiguated
- grey

Expand Down Expand Up @@ -272,11 +280,20 @@
- 10px
- 15px
- 16px
- 18px
- 20px
- 24px
- 25px
- 30px
- 32px
- 35px
- 40px
- 41px
- 44px
- 45px
- 48px
- 50px
- 54px

# Language codes
- da
Expand Down
159 changes: 159 additions & 0 deletions _rules/target-size-empty-kj4tr0.md
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
Copy link
Collaborator

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.


### 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'
Loading
Loading