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

WCAG 2.2 Pointer Target Spacing #1179

Merged
merged 32 commits into from Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e9fb5cd
Initial draft of pointer target spacing
alastc Jun 15, 2020
064bca6
Adding technique for pointer spacing
alastc Jun 25, 2020
0f1ba73
Merge branch 'master' into wcag22-pointer-target-spacing
alastc Jun 25, 2020
a2bb34e
Linked from technique to working example.
alastc Jun 25, 2020
0c43268
add id to figure
Jun 25, 2020
f054071
add id to figure in understanding
Jun 25, 2020
6e042ef
Tackling questions by JAWS-test
detlevhfischer Jun 26, 2020
914d2d8
minor correction
detlevhfischer Jun 26, 2020
33a9049
Modified the bit on native targets
detlevhfischer Jun 30, 2020
f2afbe4
removed mention of touch
detlevhfischer Jun 30, 2020
2598fc1
Edit of figcaption, examples
detlevhfischer Jun 30, 2020
c403203
Criteria > criterion, section on adapation
detlevhfischer Jun 30, 2020
3cf7ebf
Improving image legends
detlevhfischer Jun 30, 2020
8393a07
minor edits
detlevhfischer Jun 30, 2020
9968230
minor edits to legend
detlevhfischer Jun 30, 2020
78b316e
minor edits
detlevhfischer Jun 30, 2020
46b5681
minor edits in legends
detlevhfischer Jun 30, 2020
dba96a6
editorial: criteria > criterion
detlevhfischer Jun 30, 2020
72bd145
Adding Key term: target
detlevhfischer Jun 30, 2020
56d7447
minor edit
detlevhfischer Jun 30, 2020
fd72e01
Updating the enlargement exception.
alastc Jul 2, 2020
9fca895
Added exception.
alastc Jul 2, 2020
c770d73
Corrrecting punctuation.
alastc Jul 2, 2020
1fe18b5
Removing extra key-terms item
alastc Jul 2, 2020
4cdc3eb
Adding a line understanding for the user-agent exception.
alastc Jul 8, 2020
1fcbc94
corrected typo minumum
detlevhfischer Jul 16, 2020
94843d1
corrected typo combinded
detlevhfischer Jul 16, 2020
00df37d
Minor edits
detlevhfischer Jul 16, 2020
78fa9d7
Added intro sentence in section benefits
detlevhfischer Jul 16, 2020
128c97e
Fix type minumum > minimum
patrickhlauke Jul 16, 2020
3e4dbd0
Udate of name of sufficient Technique
detlevhfischer Jul 16, 2020
4a7ed23
Prepping for merge
alastc Jul 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions guidelines/index.html
Expand Up @@ -288,6 +288,8 @@ <h3>Input Modalities</h3>
<section data-include="sc/21/concurrent-input-mechanisms.html" data-include-replace="true"></section>

<section data-include="sc/22/dragging.html" data-include-replace="true"></section>

<section data-include="sc/22/pointer-target-spacing.html" data-include-replace="true"></section>

</section>

Expand Down
19 changes: 19 additions & 0 deletions guidelines/sc/22/pointer-target-spacing.html
@@ -0,0 +1,19 @@
<section class="sc new">

<h4>Pointer Target Spacing</h4>

<p class="conformance-level">AA</p>
<p class="change">New</p>

<p>For each <a>target</a>, there is an area with a width and height of at least 44 CSS pixels that includes it, and no other targets, except when:</p>
<ul>
<li><strong>Enlarge:</strong> A mechanism is available to change the CSS pixel size of each target, or its spacing, so there is an area with a width and height of at least 44 CSS pixels that includes it, and no other targets;</li>
<li><strong>Inline:</strong> The target is in a sentence or block of text;</li>
<li><strong>User agent:</strong> The size of the target is controlled by the user agent and is not modified by the author;</li>
<li><strong>Essential:</strong> A particular presentation of the target is essential to the information being conveyed.</li>
</ul>
<p class="note">This criterion has been formulated to increase the hit-area of small targets, but the group would like feedback from providers of touch-screen devices if there is another way of forming the criteria to better complement the tap-heuristics used.</p>
<p class="note">Are there issues with internationalization when describing inline links?</p>
<p class="note">Are there issues with pop-over content overlapping targets triggering failures?</p>

</section>
Binary file added techniques/css/img/pointer-spacing-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added techniques/css/img/pointer-spacing-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 113 additions & 0 deletions techniques/css/target-padding.html
@@ -0,0 +1,113 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Using min-height and min-width to ensure sufficient target spacing</title>
<link rel="stylesheet" type="text/css" href="../../css/editors.css"/>
</head>
<body>
<h1>Using min-height and min-width to ensure sufficient target spacing</h1>
<section id="meta">
<h2>Metadata</h2>
<p id="id"></p>
<p id="technology">CSS</p>
<p id="type"></p>
</section>
<section id="applicability">
<h2>When to Use</h2>
<p>All technologies that support CSS and pointer input.</p>
</section>
<section id="description">
<h2>Description</h2>
<p>The objective of this technique is to ensure that links in navigation or pagination menus will be spaced so that they fall within an area that measures at least 44 x 44 CSS pixels if the target area itself is smaller than that. The aim is to provide an adequate target clearance so the offset to adjacent targets is sufficient to prevent accidental pointer activation of adjacent targets.</p>

</section>
<section id="examples">
<h2>Examples</h2>
<p>The following examples can be seen as rendered versions in the <a href="../../working-examples/css-pointer-spacing/">working examples</a>.</p>

<section class="example">
<h3>Using a display value of inline-block and min-height / width</h3>
<p>The first example shows a situation where the targets (in this case, the linked numbers in th pagination menu) are smaller than 44 x 44 CSS pixels. However, the list items that contain them have a minimum height and width of 44 px set, so that sufficient target spacing is assured.</p>
<figure id="pointer-spacing-block">
<img src="img/pointer-spacing-1.png" alt="A horizontal pagination component immediately above the search results." />
<figcaption>Example of using CSS to ensure enough spacing around targets</figcaption>
</figure>
<p>Given the following HTML:</p>
<pre><code>&lt;nav class=&quot;pag&quot; aria-label=&quot;pagination menu&quot;&gt;
&lt;ol class=&quot;pagination-1&quot;&gt;
&lt;li&gt;&lt;span&gt;previous&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/nav&gt;</code></pre>
<p>The following CSS would ensure the minimum spacing is applied:</p>
<pre><code>ol.pagination-1 li {
display: inline-block;
min-width: 44px;
min-height: 44px;
}</code></pre>

</section>
<section class="example">
<h3>Using a display value of flex and min-height / width</h3>
<p>The second example uses min-width and min-height on the targets (the linked numbers in the pagination menu) and not on the parent container, thereby meeting this target spacing Success Criterion and incidentally also the AAA Success Criterion 2.5.5 Target Size.</p>
<figure id="pointer-spacing-flex">
<img src="img/pointer-spacing-1.png" alt="A horizontal pagination component immediately above the search results. It looks identical to the previous example. " />
<figcaption>Example of using CSS to ensure enough spacing within targets</figcaption>
</figure>
<p>Given the following HTML:</p>
<pre><code>&lt;nav class=&quot;pag&quot; aria-label=&quot;pagination menu&quot;&gt;
&lt;ol class=&quot;pagination-2&quot;&gt;
&lt;li&gt;&lt;span&gt;previous&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;next&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/nav&gt;</code></pre>
<p>The following CSS ensures the minimum size is applied:</p>
<pre><code>ol.pagination-2 a,
ol.pagination-2 strong,
ol.pagination-2 span {
display: block;
line-height:44px;
min-height:44px;
min-width: 44px;
}</code></pre>
</section>

</section>
<section id="tests">
<h2>Tests</h2>

<section class="test-procedure">
<h3>Procedure</h3>

<p>For each target that cannot be enlarged by a mechanism, is not inline, and is not covered by the essential exception:</p>
patrickhlauke marked this conversation as resolved.
Show resolved Hide resolved
<ul>
<li>Check that the target has enough spacing so that the space around it measures at least 44px width and 44px height.</li>
</ul>
</section>
<section class="test-results">
<h3>Expected Results</h3>
<ul>
<li>Check #1 is true</li>
</ul>
</section>
</section>
<section id="related">
<h2>Related Techniques</h2>

</section>
<section id="resources">
<h2>Resources</h2>

</section>
</body>
</html>
Binary file added understanding/22/img/pointer-target-example1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added understanding/22/img/pointer-target-example2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added understanding/22/img/pointer-target-example3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added understanding/22/img/pointer-target-example4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added understanding/22/img/pointer-target-example5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 153 additions & 0 deletions understanding/22/pointer-target-spacing.html
@@ -0,0 +1,153 @@
<!DOCTYPE html>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8"></meta>
<title>Understanding Pointer Target Spacing</title>
<link rel="stylesheet" type="text/css" href="../../css/editors.css" class="remove"></link>
</head>
<body>
<h1>Understanding Pointer Target Spacing</h1>

<section id="status" class="advisement">
<h2>Status</h2>
<p>This understanding document is part of the <a href="https://w3c.github.io/wcag/guidelines/22/"><strong>draft</strong> WCAG 2.2 content</a>. It may change or be removed before the final WCAG 2.2 is published.</p>
</section>

<section class="remove">

<h2>Pointer Target Spacing Success Criterion text</h2>
<blockquote>
<h4>Pointer Target Spacing</h4>

<p class="conformance-level">AA</p>
<p class="change">New</p>

<p>For each <a href="https://www.w3.org/TR/WCAG21/#dfn-target">target</a>, there is an area with a width and height of at least 44 CSS pixels that includes it, and no other targets, except when:</p>
<ul>
<li><strong>Enlarge:</strong> A mechanism is available to change the CSS pixel size of each target, or its spacing, so there is an area with a width and height of at least 44 CSS pixels that includes it, and no other targets;</li>
<li><strong>Inline:</strong> The target is in a sentence or block of text;</li>
<li><strong>User agent:</strong> The size of the target is controlled by the user agent and is not modified by the author;</li>
<li><strong>Essential:</strong> A particular presentation of the target is essential to the information being conveyed.</li>
</ul>
<p class="note">This criterion has been formulated to increase the hit-area of small targets, but the group would like feedback from providers of touch-screen devices if there is another way of forming the criterion to better complement the tap-heuristics used.</p>
<p class="note">Are there issues with internationalization when describing inline links?</p>
<p class="note">Are there issues with pop-over content overlapping targets triggering failures?</p>
</blockquote>
</section>

<section id="intent">
<h2>Intent of Pointer Target Spacing</h2>

<p>The intent of this Success Criterion is to ensure targets can easily be activated without accidentally activating an adjacent target. When targets are small, it is difficult for users with hand tremors and those who have difficulty with fine motor movement to activate them accurately. Providing spacing between targets will reduce the likelihood of accidentally activating the wrong control.</p>

<p>The requirement is for targets that are smaller than 44 x 44px to be included in an area with a width and height of at least 44px each. For the horizontal dimension, this means that the total width of 44px is composed of the width of the target and the width of the spacing that separates it from adjacent targets. The same applies to the height. For example, a target of 24 x 24px would meet the requirement if it had a spacing of 10 px on all sides. If the target is 44 x 44px or larger, no spacing between it and adjacent targets would be required.</p>


<p>There are three exceptions:</p>
<ol>
<li>If there is a mechanism to change the target sizes or spacing to meet the minimum, such as a button to change the sizes and layout of the targets.</li>
<li>If the target is inline within a sentence there doesn’t need to be a minimum target size.</li>
<li>If the spacing of the targets is essential to the information being conveyed there doesn’t need to be a minimum target size.</li>
</ol>

<p>The requirement is independent of the zoom factor of the page, when users zoom in the CSS pixel size of elements does not change. This means that authors cannot meet it by claiming that the target will have enough spacing or sufficient size if the user zooms into the page.</p>

<p>The requirement does not apply to the spacing of targets inside unstyled native elements. For example, when a default select element is used, the vertical spacing of option elements inside the select's dropdown list is exempt.</p>

<p>While the Success Criterion primarily helps touch users by ensuring that activation with the 'fat finger' will not accidentally trigger adjacent targets, it is also useful for mouse or pen users. It reduces the chances of erroneous activation due to a tremor or some other input imprecision.</p>

<p>As mobile devices generally have internal heuristics to identify which link is closest, spacing can work as effectively as a larger target size.</p>

<figure id="pointer-target-44x44">
<img src="img/pointer-target-example1.png" alt="A series of icons with measures showing they are each 44 by 44 pixels wide and high." />
<figcaption>The dimension of each icon target in a row is 44 by 44 CSS pixels, so the targets pass this Success Criterion without additional spacing.</figcaption>
</figure>

<figure id="pointer-target-38x38-spacing">
<img src="img/pointer-target-example2.png" alt="A row of icons with measures showing they are each 38 by 38 pixels wide and high, with 6 pixel spacing between them." />
<figcaption>The dimension of each icon target in a row is 38 by 38 CSS pixels, so a spacing of 6 CSS pixels is required to arrive at 44 CSS pixels for the combined width and spacing of the target. No adjacent targets are present above and below, i.e., there is sufficient vertical spacing for the height of 38 CSS pixels to be sufficient.</figcaption>
</figure>

<figure id="pointer-target-44x20-spacing">
<img src="img/pointer-target-example3.png" alt="A row of buttons which are more that 44px wide and 20px high. There are no targets above or below." />
<figcaption>The widths of the button with adjacent neighbors is at least 44 CSS pixels, while the height is only 22 CSS pixels. The target height combined with the vertical spacing above and below exceeds 44 CSS pixels, therefore, the targets pass this Success Criterion.</figcaption>
</figure>

<figure id="pointer-target-44-20-nospace">
<img src="img/pointer-target-example4.png" alt="A row of icons which are 44px wide and 20px high, with other targets above and below with only 2px spacing." />
<figcaption><strong>Fail:</strong> Two rows of buttons, all with a height of only 20 CSS pixels. In the top row, buttons all have a width of more than 44 CSS pixels. For the top row, targets above and below are in close proximity. The top spacing of the first row is 4 px while the bottom spacing is 2 px, which adds up to 26 px for target height and vertical spacing combined. Therefore, the buttons in the top row fail the Success Criterion. The button "Pop" in the second row is only 32px wide with no horizontal spacing, so it also fails the Success Criterion even when there is sufficient space below to meet the vertical spacing requirement.</figcaption>
</figure>

<p>Where targets are embedded inside other targets, the inner target either needs a size of at least 44 x 44 CSS pixels or must be placed at the edge or corner to make sure that there is sufficient adjacent spacing in each dimension.</p>

<figure id="pointer=target-embedded">
<img src="img/pointer-target-example5.png" alt="Three examples of a target adjacent to another target (see legend below)" />
<figcaption>Three examples of a person's profile image, which is supposed to be a target leading to another page, and a magnifying glass icon, which is supposed to open a lightbox view of the profile image. In the first example, the magnifying icon is outside the picture and passes. In the second example, the icon overlaps with the top-left corner of the image, but passes due to sufficient spacing top and left. In the third example, the icon sits inside the linked image. Since it is surrounded by an active click area, the icon target is not large enough to pass the success criterion.</figcaption>
</figure>

<p>Users with different disabilities have different needs for control sizes. It can be beneficial to provide an option to increase the active target area without increasing the visible target size. Another option is to provide a mechanism to control the density of layout and thereby change target size or spacing, or both. This can be beneficial for a wide range of users. For example, users with visual field loss may prefer a more condensed layout with smaller sized controls while users with other forms of low vision may prefer large controls.</p>

<p>Where user-agents control the size of a target, such as the options in a <code>select</code> drop-down, and the author has not tried to change the size of target with size or padding adjustments, the target is exempted from this criterion. It would be beneficial for users if the minimum size &amp; spacing requirement is meet, but where the user-agent has defined the target it is not the authors responsibility.</p>


</section>
<section id="benefits">
<h2>Benefits of Pointer Target Spacing</h2>
<p>Having targets with sufficient target spacing can help all users who may have difficulty in confidently targeting or operating small controls. Users who benefit include, but are not limited to:</p>
<ul>
patrickhlauke marked this conversation as resolved.
Show resolved Hide resolved
<li>Users who use a mobile device where the touch screen is the primary mode of interaction;</li>
<li>Users with mobility impairments such as hand tremors;</li>
<li>Users who use a device in environments where they are exposed to shaking such as public transportation;</li>
<li>Users who have difficulty with fine motor movements;</li>
<li>Users who access a device using one hand;</li>
<li>Users with large fingers, or who are operating the device with only a part of their finger or knuckle.</li>
</ul>

</section>

<section id="examples">
<h2>Examples of Pointer Target Spacing</h2>

<ul>
<li>Three buttons are on-screen and the target area of each button is 44 by 44 CSS pixels. Since the target size itself is 44 x 44 px, no additional spacing is required, the Success Criterion passes.</li>
<li>A row of buttons, each of which has a horizontal width of more than 44 px, but a height of only 30 px. Since there is sufficient spacing above and below the row of buttons, the Success Criterion passes.</li>
<li>Links within a paragraph of text have varying target dimensions. Links within paragraphs of text do not need to meet the 44 by 44 CSS pixels requirements, so the Success Criterion passes.</li>
</ul>
</section>


<section id="techniques">
<h2>Techniques for Pointer Target Spacing</h2>


<section id="sufficient">
<h3>Sufficient Techniques for Pointer Target Spacing</h3>


<ol>
<li>
<a href="../../techniques/css/target-padding.html" class="css">Adding padding around links</a>
</li>
</ol>

</section>

<section id="advisory">
<h3>Additional Techniques (Advisory) for Pointer Target Spacing</h3>

</section>

<section id="failure">
<h3>Failures for Pointer Target Spacing</h3>

</section>

</section>
<section id="resources">
<h2>Resources</h2>


</section>

</body>
</html>