Skip to content

Commit c9be2d2

Browse files
authored
WCAG22 - Focus Visible enh updates (#1121)
* Updates to the SC text and ripple effects. * Criterion typo * Updated SC in understanding, minor 2.4.7 update * Updates from issue 1055 * Aligned the 'at least' phrases in the SC text. * Update bsaed on 1064 * Updated mode of operation Based on #301 * Adding to the size metric and updating 1st line * Updated understanding to match SC text * Changes from the meeting https://www.w3.org/2020/06/30-ag-minutes.html#item02 * Adding 'discernable' https://www.w3.org/2002/09/wbs/35422/focus-visible-enh-issues3/results#xq4 * Adding fstorr's updates I needed to set this up to merge with the feature branch (rather than master) and my git-fu was no enough, so re-creating. * Renaming focus-vis-eng to focus-appearance-minumum * renaming the focus-appearance understanding doc * Adding Focus Appearance (Enhanced) * Adding technique for focus-appearance-enh * Added AAA to the new stuff section. * mbgowers update * SC updates from #1212 * Removing failures from focus-vis #1067 Co-authored-by: Alastair Campbell
1 parent e4dfc4d commit c9be2d2

12 files changed

+326
-102
lines changed

guidelines/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@

New Features in WCAG 2.2

9393
<ul>
9494
<li><a href="#accessible-authentication">Accessible Authenticationa>li>
9595
<li><a href="#dragging">Dragginga>li>
96+
<li><a href="#focus-appearance-minimum">Focus Appearance (Minimum)a>li>
97+
<li><a href="#focus-appearance-enhanced">Focus Appearance (Enhanced)a>li>
9698
<li><a href="#findable-help">Findable Helpa>li>
9799
<li><a href="#fixed-reference-points">Fixed Reference Pointsa>li>
98100
<li><a href="#focus-visible-enhanced">Focus Visible (enhanced)a>li>
@@ -273,7 +275,9 @@

Navigable

273275

274276
<section data-include="sc/20/section-headings.html" data-include-replace="true">section>
275277

276-
<section data-include="sc/22/focus-visible-enhanced.html" data-include-replace="true">section>
278+
<section data-include="sc/22/focus-appearance-minimum.html" data-include-replace="true">section>
279+
280+
<section data-include="sc/22/focus-appearance-enhanced.html" data-include-replace="true">section>
277281

278282
<section data-include="sc/22/fixed-reference-points.html" data-include-replace="true">section>
279283

@@ -742,7 +746,7 @@

Change Log

742746
<p>This section shows substantive changes made in WCAG 2.2 since WCAG 2.1. <a href="https://www.w3.org/WAI/WCAG21/errata/">Errata fixes to WCAG 2.1a> have also been incorporated into WCAG 2.2.p>
743747
<p>The full <a href="https://github.com/w3c/wcag/commits/master/guidelines">commit history to WCAG 2.2a> is available.p>
744748
<ul>
745-
<li>2020-01-14: Added <a href="#focus-visible-enhanced">Focus Visible Enhanceda>.li>
749+
<li>2020-01-14: Added <a href="#focus-appearance-minimum">Focus Visible (Enhanced)a>.li>
746750
ul>
747751
section>
748752
<section class="appendix informative section" id="acknowledgements">
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<section class="sc new">
2+
3+
<h4>Focus Appearance (Enhanced)h4>
4+
5+
<p class="conformance-level">AAAp>
6+
<p class="change">Newp>
7+
8+
<p>For the keyboard focus indicator of each User Interface Component, all of the following are true:p>
9+
<ul>
10+
<li><strong>Minimum area:strong> The <a>focus indication areaa> is greater than or equal to a 2 <a>CSS pixela> solid border around the control.li>
11+
<li><strong>Change of contrast:strong> Color changes used to indicate focus have a contrast ratio of at least 4.5:1 with the colors changed from the unfocused control.li>
12+
<li><strong>Unobscured:strong> No part of the focus indicator is hidden by author-created content.li>
13+
ul>
14+
15+
section>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<section class="sc new">
2+
3+
<h4>Focus Appearance (Minimum)h4>
4+
5+
<p class="conformance-level">AAp>
6+
<p class="change">Newp>
7+
8+
<p>For the keyboard focus indicator of each User Interface Component, all of the following are true:p>
9+
<ul>
10+
<li><strong>Minimum area:strong> The <a>focus indication areaa> is greater than or equal to a 1 <a>CSS pixela> border of the focused control, or has a thickness of at least 8 CSS pixels along the shortest side of the element.li>
11+
<li><strong>Change of contrast:strong> The color change for the focus indication area has a contrast ratio of at least 3:1 with the colors of the unfocused state.li>
12+
<li><strong>Adjacent contrast:strong> The focus indication area has a contrast ratio of at least 3:1 against all adjacent colors for the minimum area or greater, or has a thickness of at least 2 CSS pixels.li>
13+
<li><strong>Unobscured:strong> The item with focus is not entirely hidden by author-created content.li>
14+
ul>
15+
<p class="note">A keyboard focus indicator which has a pattern or gradient may have parts that do not meet the 3:1 contrast ratio for the change of contrast, as long as an area equal to the minimum does meet the contrast ratio.p>
16+
<p class="note">If the control has a visible boundary smaller than the hit area, the size measure is taken from the visible boundary.p>
17+
<p class="ednote">The working group is interested in feedback about the minimum area metric, and if there are unusual scenarios where visible indicators are caught by the wording.p>
18+
19+
section>

guidelines/sc/22/focus-visible-enhanced.html

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<dt class="new"><dfn>Focus indication areadfn>dt>
22
<dd class="new">
33
<p class="change">Newp>
4-
<p>The number of CSS pixels that change between the focused and unfocused states of a <a>User Interface Componenta>.
4+
<p>the pixels that change between the focused and unfocused states of a <a>User Interface Componenta>
55
p>
66

77
dd>

techniques/css/C41-enhanced.html

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
>
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3+
<head>
4+
<title>Creating a strong focus indicator within the componenttitle>
5+
<link rel="stylesheet" type="text/css" href="../../css/editors.css"/>
6+
head>
7+
<body>
8+
<h1>Creating a strong focus indicator within the componenth1>
9+
<section id="meta">
10+
<h2>Metadatah2>
11+
<p id="id">p>
12+
<p id="technology">CSSp>
13+
<p id="type">p>
14+
section>
15+
<section id="applicability">
16+
<h2>When to Useh2>
17+
<p>All technologies that support CSS.p>
18+
section>
19+
<section id="description">
20+
<h2>Descriptionh2>
21+
<p>The objective of this technique is to create a highly visible focus indicator that has sufficient contrast against the internal background color of a component.p>
22+
23+
section>
24+
<section id="examples">
25+
<h2>Examplesh2>
26+
<p>The examples demonstrate a simple implementation where a focus styles is applied to blue background. As the indicator is contained inside the component, you can be sure it maintains contrast whatever background the component is placed onp>
27+
28+
<section class="example">
29+
<h3>Inner borderh3>
30+
<p>HTMLp>
31+
<pre><code><button>Example button</button>code>pre>
32+
33+
<p>CSS to provide the indicator. It narrows the scope to buttons within the <code>maincode> element.p>
34+
<pre><code>button {
35+
background-color: #3f86d4 /* medium blue */
36+
color: white;
37+
padding: 10px;
38+
border: 1px #333 solid;
39+
}
40+
main button:focus {
41+
outline: 2px #fff5be solid; /* light yellow */
42+
outline-offset: -4px;
43+
}code>pre>
44+
45+
<figure id="focus-indicator-inside">
46+
<img src="../../understanding/22/img/focus-indicator-innerline-strong.png" alt="Three blue buttons with a dark border, the middle button showing a bright yellow outline inside the button." width="300" />
47+
<figcaption>The default and focused states of the button.figcaption>
48+
figure>
49+
50+
section>
51+
52+
section>
53+
<section id="tests">
54+
<h2>Testsh2>
55+
56+
<section class="test-procedure">
57+
<h3>Procedureh3>
58+
<p>For each focusable user interface element: p>
59+
<ol>
60+
<li>Place keyboard focus on each focusable user interface element on the page using the keyboard.li>
61+
<li>Check that the focus indicator area is at least the size of a 2 CSS px border around the component.li>
62+
<li>Check that the change of contrast of the indicator between focused and unfocused states has a ratio of 4.5:1 for the minimum focus indicator area.li>
63+
ol>
64+
section>
65+
<section class="test-results">
66+
<h3>Expected Resultsh3>
67+
<ul>
68+
<li>#2 and #3 are true.li>
69+
ul>
70+
section>
71+
section>
72+
<section id="related">
73+
<h2>Related Techniquesh2>
74+
<ul>
75+
<li><a href="../general/G195">G195a>li>
76+
ul>
77+
section>
78+
<section id="resources">
79+
<h2>Resourcesh2>
80+
<ul>
81+
<li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:focus">The :focus pseudo-class on the Mozilla Developer Networka>li>
82+
<li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible">The :focus-visible pseudo-class on the Mozilla Developer Networka>li>
83+
ul>
84+
section>
85+
body>
86+
html>

techniques/css/C41.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@

Procedure

5858
<p>For each focusable user interface element: p>
5959
<ol>
6060
<li>Place keyboard focus on each focusable user interface element on the page using the keyboard.li>
61-
<li>Check that the focus indicator area is at least the size of a 2 CSS px line along the longest edge of the component.li>
61+
<li>Check that the focus indicator area is at least the size of a 1 CSS px border around the component.li>
6262
<li>Check that the change of contrast of the indicator between focused and unfocused states has a ratio of 3:1 for the minimum focus indicator area.li>
6363
<li>If the focus indicator does not have 3:1 contrast ratio with its adjacent colors, check that it is at least 2px thick.li>
6464
ol>

techniques/general/G195.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@

Menus

2828
<li>Place focus on each focusable user interface element on the page using the mouse.li>
2929
<li>Check that there is a highly visible focus indicator.li>
3030
<li>Place focus on each focusable user interface element on the page using the keyboard.li>
31-
<li>Check that the focus indicator area is at least the size of a 2 CSS px line along the longest edge of the component.li>
31+
<li>Check that the focus indicator area is at least the size of a 1 CSS px border around the component.li>
3232
<li>Check that the change of contrast of the indicator between focused and unfocused states has a ratio of 3:1 for the minimum focus indicator area.li>
3333
<li>If the focus indicator does not have 3:1 contrast ratio with its adjacent colors, check that it is at least 2px thick.li>
3434
ol>

understanding/20/focus-visible.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@

Intent of Focus Visible

1919

2020
<p>It must be possible for a person to know which element among multiple elements has the keyboard focus. If there is only one keyboard actionable control on the screen, the success criterion would be met because the visual design presents only one keyboard actionable item.p>
2121

22-
<p>Where the success criterion says “mode of operation”, this is to account for platforms which may not always show a focus indicator. In most cases there is only one mode of operation so this success criteria applies.p>
22+
<p>“Mode of operation” accounts for user-agents which may not always show a focus indicator, or only show the focus indicator when the keyboard is used. User agents may optimise when the focus indicator is shown, such as only showing it when a keyboard is used. Authors are responsible for providing at least one mode of operation where the focus is visible. In most cases there is only one mode of operation so this success criterion applies. The focus indicator must not be time limited, when the keyboard focus is shown it must remain.p>
2323

24-
<p>Note that a keyboard focus indicator can take different forms.<span class="wcag22"> This criterion does not specify what the form is, but <a href="focus-visible-enhanced">Focus Visible (Enhanced)a> does define how visible the indicator should be. Passing <a href="focus-visible-enhanced">Focus Visible (Enhanced)a> would pass this success criterion.span>p>
24+
<p>Note that a keyboard focus indicator can take different forms.<span class="wcag22"> This criterion does not specify what the form is, but <a href="focus-appearance-minimum">Focus Appearance (Minimum)a> does define how visible the indicator should be. Passing <a href="focus-appearance-minimum">Focus Appearance (Minimum)a> would pass this success criterion.span>p>
2525

2626

2727
section>
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
>
2+
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta charset="UTF-8">meta>
5+
<title>Understanding Focus Appearance (Enhanced)title>
6+
<link rel="stylesheet" type="text/css" href="../../css/editors.css" class="remove">link>
7+
head>
8+
<body>
9+
<h1>Understanding Focus Appearance (Enhanced)h1>
10+
11+
<section id="status" class="advisement">
12+
<h2>Statush2>
13+
<p>This understanding document is part of the <a href="https://w3c.github.io/wcag/guidelines/22/"><strong>draftstrong> WCAG 2.2 contenta>. It may change or be removed before the final WCAG 2.2 is published.p>
14+
section>
15+
16+
17+
<section class="remove">
18+
19+
<h2>Focus Appearance (Enhanced) Success Criteria texth2>
20+
<blockquote>
21+
<h4>Focus Appearance (Enhanced)h4>
22+
23+
<p class="conformance-level">AAAp>
24+
<p class="change">Newp>
25+
26+
<p>For the keyboard focus indicator of each User Interface Component, all of the following are true:p>
27+
<ul>
28+
<li><strong>Minimum area:strong> The <a>focus indication areaa> is greater than or equal to a 2 <a>CSS pixela> solid border around the control.li>
29+
<li><strong>Change of contrast:strong> Color changes used to indicate focus have a contrast ratio of at least 4.5:1 with the colors changed from the unfocused control.li>
30+
<li><strong>Unobscured:strong> No part of the focus indicator is hidden by author-created content.li>
31+
ul>
32+
blockquote>
33+
section>
34+
35+
<section id="intent">
36+
37+
<h2>Intent of Focus Appearance (Enhanced)h2>
38+
39+
40+
<p>The purpose of this success criterion is to ensure a keyboard focus indicator is highly visible. This criterion is closely related to <a href="./focus-appearance-minimum.html">Success Criterion 2.4.11 Focus Appearance (Minimum)a> and defines a higher level of visibility for the focus indicator.p>
41+
42+
<p>In relation to Focus Visible (enhanced) this criterion:p>
43+
<ul>
44+
<li>Expands the minimum area from 1 CSS pixel around the perimeter of the element to 2 CSS pixels around the perimeter.li>
45+
<li>Increases the change of contrast to 4.5:1.li>
46+
<li>Does not allow for any part of the element to be obscured by other content.li>
47+
ul>
48+
<p>The other aspects of the success criterion are the same as Focus Visible (Minimum).p>
49+
50+
51+
52+
section>
53+
<section id="benefits">
54+
<h2>Benefits of Focus Appearance (Enhanced)h2>
55+
<p>The benefits of this success criterion are similar to Focus Appearance (Minimum).p>
56+
<ul>
57+
<li>Letting anyone who relies on the keyboard to operate the page by enabling them to visually determine the component on which keyboard operations will interact at any point in time.li>
58+
<li>People with low vision are better able to follow a highly visible focus indicator.li>
59+
<li>People with attention limitations, short term memory limitations, or limitations in executive processes benefit by being able to discover where the focus is located.li>
60+
ul>
61+
62+
section>
63+
64+
<section id="examples">
65+
<h2>Examples of Focus Visibleh2>
66+
<p>The examples of this success criterion are similar to Focus Appearance (Minimum).p>
67+
<ul>
68+
<li>When links receive focus, an outline is displayed around the link that contrasts with the background adjacent to the link.li>
69+
<li>When buttons receive focus, and outline is displayed within the button (around the text) that contrasts with the button’s background.li>
70+
<li>When text fields receive focus, an outline is displayed around the field, indicating that the input has focus.li>
71+
<li>When radio buttons receive focus, an outline is displayed around the control, indicating that the input has focus.li>
72+
ul>
73+
74+
section>
75+
76+
77+
<section id="techniques">
78+
<h2>Techniques for Focus Appearance (Enhanced)h2>
79+
80+
81+
<section id="sufficient">
82+
<h3>Sufficient Techniquesh3>
83+
84+
<p>@@@ Create a new techniques based on:p>
85+
<ol>
86+
<li>
87+
<a href="https://www.w3.org/WAI/WCAG21/Techniques/general/G195" class="general">Using an author-supplied, highly visible focus indicatora>
88+
li>
89+
<li>
90+
<a href="../../techniques/css/C40">Creating a two-color focus indicator to ensure sufficient contrasta>
91+
li>
92+
<li>
93+
<a href="../../techniques/css/C41">Creating a contrasting focus indicator inside the componenta>
94+
li>
95+
ol>
96+
97+
section>
98+
99+
<section id="advisory">
100+
<h3>Additional Techniques (Advisory)h3>
101+
102+
section>
103+
104+
<section id="failure">
105+
<h3>Failuresh3>
106+
107+
<ul>
108+
<li>
109+
<a href="https://www.w3.org/WAI/WCAG21/Techniques/failures/F78" class="failure">Failure due to styling element outlines and borders in a way that overrides or renders
110+
non-visible the default visual focus indicator
111+
a>
112+
li>
113+
<li>
114+
<a href="https://www.w3.org/WAI/WCAG21/Techniques/failures/F55" class="failure">Failure of Success Criterion 2.1.1, 2.4.7, and 3.2.1 due to using script to remove
115+
focus when focus is received
116+
a>
117+
li>
118+
ul>
119+
section>
120+
121+
section>
122+
123+
body>
124+
html>

0 commit comments

Comments
 (0)