Skip to content

Commit 4fa3c49

Browse files
authored
Working examples bug fixes (#3970)
Various fixes including: 1. Adding `lang` attributes to `html` elements 2. Giving accessible names to `input` elements 3. Updating `doctype`s 4. Fixing a broken link 5. Updating a remote jQuery library call to a non 1.x version that's served over `https`
1 parent 1258d74 commit 4fa3c49

File tree

6 files changed

+103
-38
lines changed

6 files changed

+103
-38
lines changed

techniques/aria/ARIA9.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h3>A conference workshop booking table</h3>
5959
&lt;table&gt;
6060
&lt;caption&gt;Dinosaur Conference workshop booking table&lt;/caption&gt;
6161
&lt;tr&gt;
62-
&lt;td rowspan="2"&gt;&lt;/td&gt;
62+
&lt;th rowspan="2" scope="col"&gt;Track&lt;/th&gt;
6363
&lt;th colspan="2" scope="colgroup"&gt;Thursday&lt;/th&gt;
6464
&lt;th colspan="2" scope="colgroup"&gt;Friday&lt;/th&gt;
6565
&lt;/tr&gt;
@@ -70,7 +70,7 @@ <h3>A conference workshop booking table</h3>
7070
&lt;th scope="col" id="pm2"&gt;2 to 5 PM&lt;/th&gt;
7171
&lt;/tr&gt;
7272
&lt;tr&gt;
73-
&lt;th id="track1" scope="row"&gt;track 1&lt;/th&gt;
73+
&lt;th id="track1" scope="row"&gt;Track 1&lt;/th&gt;
7474
&lt;td&gt;
7575
&lt;h2 id="title-TM1"&gt;The Paleozoic era &lt;/h2&gt;
7676
&lt;p&gt;2 places left&lt;/p&gt;
@@ -97,7 +97,7 @@ <h3>A conference workshop booking table</h3>
9797
&lt;/td&gt;
9898
&lt;/tr&gt;
9999
&lt;tr&gt;
100-
&lt;th id="track2" scope="row"&gt;track 2&lt;/th&gt;
100+
&lt;th id="track2" scope="row"&gt;Track 2&lt;/th&gt;
101101
&lt;td&gt;
102102
&lt;h2 id="title-TM2"&gt;The Cretaceous period&lt;/h2&gt;
103103
&lt;p&gt;18 places left&lt;/p&gt;

working-examples/aria-alert-identify-errors/index.html

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
<!doctype html>
2-
<html>
2+
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<title>Using role=alert to Identify Errors</title>
6-
<script src="http://code.jquery.com/jquery.js"></script>
5+
<title>Using ARIA live regions or role=alert to identify errors</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<style>
8+
body{
9+
background:#fff;
10+
color:#000;
11+
font-family:system-ui;
12+
}
13+
14+
input{
15+
border:1px solid #000;
16+
font:inherit;
17+
}
18+
19+
[type=submit]{
20+
background: #666;
21+
color:#fff;
22+
}
23+
</style>
24+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
25+
726
<script>
827
$(document).ready(function(e) {
928
$('#signup').submit(function() {
@@ -50,7 +69,7 @@
5069
</head>
5170

5271
<body>
53-
<h1>Using ARIA Live Regions or role=alert to Identify Errors</h1>
72+
<h1>Using ARIA live regions or <code class="language-html">role=alert</code> to identify errors</h1>
5473
<form name="signup" id="signup" method="post" action="">
5574
<p id="errors" role="alert" aria-atomic="true"></p>
5675
<p>
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5-
<title>aria-labelledby example 1: Extend time-out</title>
6-
4+
<meta content="charset=UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<title>aria-labelledby example 1: Extend time-out</title>
7+
<style>
8+
body{
9+
background:#fff;
10+
color:#000;
11+
font-family: system-ui;
12+
}
13+
</style>
714
</head>
8-
915
<body>
1016

11-
<h2>Extend timeout</h2>
17+
<h1><code class="language-html">aria-labelledby</code> example 1: Extend time-out</h1>
1218

1319
<form>
1420
<p><span id="timeout-label"><label for="timeout-duration">Extend time-out to</label></span>
@@ -18,6 +24,6 @@ <h2>Extend timeout</h2>
1824
</form>
1925

2026

21-
<p>(Adapted from <a href="http://www.marcozehe.de/2008/03/23/easy-aria-tip-2-aria-labelledby-and-aria-described">Easy ARIA tip #2: aria-labelledby and aria-describedby</a>, an example put together by Marco Zehe in 2008)</p>
27+
<p>(Adapted from <a href="https://www.marcozehe.de/easy-aria-tip-2-aria-labelledby-and-aria-describedby/">Easy ARIA tip #2: aria-labelledby and aria-describedby</a>, an example put together by Marco Zehe in 2008)</p>
2228
</body>
2329
</html>

working-examples/aria-labelledby-workshop-booking-timetable/index.html

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
1-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2-
<html xmlns="http://www.w3.org/1999/xhtml">
1+
<!DOCTYPE html>
2+
<html lang="en">
33
<head>
4-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
4+
<meta charset="utf-8"/>
55
<title>Dinosaur conference</title>
6-
</head>
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
8+
<style>
9+
body{
10+
background:#fff;
11+
color:#000;
12+
font:1rem / 1.5 system-ui;
13+
}
714

15+
table{
16+
border:1px solid hsl(0, 0%, 0%);
17+
border-collapse:collapse;
18+
margin-block-end:1rem;
19+
}
20+
th, td{
21+
border:1px solid;
22+
}
23+
24+
input[type=submit]{
25+
font:inherit;
26+
}
27+
</style>
28+
</head>
829
<body>
930
<h1>Dinosaur conference workshops timetable Thursday, 14. & Friday, 15. March 2013</h1>
1031

@@ -13,7 +34,7 @@ <h1>Dinosaur conference workshops timetable Thursday, 14. & Friday, 15. March 2
1334
Dinosaur conference workshop booking table
1435
</caption>
1536
<tr>
16-
<td rowspan="2"></td>
37+
<th rowspan="2" scope="col">Track</th>
1738
<th colspan="2" scope="colgroup">Thursday</th>
1839
<th colspan="2" scope="colgroup">Friday</th>
1940
</tr>
@@ -26,12 +47,12 @@ <h1>Dinosaur conference workshops timetable Thursday, 14. & Friday, 15. March 2
2647
</tr>
2748

2849
<tr>
29-
<th id="track1" scope="row">track 1</th>
50+
<th id="track1" scope="row">Track 1</th>
3051
<td>
31-
<h2 id="title-TM1">The Paleozoic era </h2>
52+
<h2 id="title-TM1">The Paleozoic era</h2>
3253
<p>2 places left</p>
3354
<p><input type="checkbox" id="TM1" aria-labelledby="title-TM1 track1 am1 TM1-att">
34-
<label id="TM1-att" for="TM1">Attend</label></p>
55+
<label id="TM1-att" for="TM1">Attend</label></p>
3556
</td>
3657

3758
<td>
@@ -59,7 +80,7 @@ <h2 id="title-FA1">The Jurassic period</h2>
5980

6081

6182
<tr>
62-
<th id="track2" scope="row">track 2</th>
83+
<th id="track2" scope="row">Track 2</th>
6384
<td>
6485
<h2 id="title-TM2">The Cretaceous period</h2>
6586
<p>18 places left</p>
@@ -89,16 +110,14 @@ <h2 id="title-FA2">Emerging scholarship </h2>
89110
</td>
90111
</tr>
91112
</table>
92-
<p>&nbsp;</p>
93-
<table role="presentation" cellspacing="0" cellpadding="4" border="0">
113+
<table role="presentation" cellspacing="0" cellpadding="4">
94114
<tr>
95115
<td><label for="123">Maiden Name:</label></td>
96116
<td>
97117
<input type="text" maxlength="255" size="30" id="123" value="" name="maidenName" aria-describedby="986">
98118
<span id="986">(Only enter if different from last name) </span>
99119
</td>
100120
</table>
101-
<p>&nbsp;</p>
102121
<input type="submit" value="Log in">
103122
</body>
104123
</html>

working-examples/device-motion-sensor-input-failure/index.html

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
4-
<style type="text/css">
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<style>
7+
body{
8+
background: #fff;
9+
color:#000;
10+
font-family:system-ui;
11+
}
512

6-
.slidecontainer {
7-
width:100%;
8-
}
13+
button{
14+
font:inherit;
15+
}
16+
17+
.slidecontainer {
18+
width:100%;
19+
}
920
</style>
1021

1122
<title>WCAG Failure Example of Motion Sensor</title>
@@ -14,14 +25,14 @@
1425

1526
<pre class="output"></pre>
1627

17-
<h1>Slider Motion Sensor Failure Example </h1>
28+
<h1>Slider Motion Sensor Failure Example</h1>
1829

1930
<p>Open this slider on a device with a motion sensor, such as a smart phone or tablet. Tilt the device to the right and left to adjust the slider value. The decrease and increase buttons also adjust the value. There is no way to deactivate the motion sensor. </p>
2031
<p>Note: This example may not work across all browsers.</p>
2132

2233
<div class="slidecontainer">
2334
<button type="button" name="decrease" onclick="decreaseFunction()">Decrease Value</button>
24-
<input type="range" min="1" max="100" value="50" class="slider" id="motionSlider">
35+
<input aria-label="demo slider" type="range" min="1" max="100" value="50" class="slider" id="motionSlider">
2536
<button type="button" name="increase" onclick="increaseFunction()">Increase Value</button>
2637
<p aria-live="polite">Slider Value: <span id="demo"></span></p>
2738
</div>

working-examples/device-motion-sensor-input/index.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
33
<head>
4-
<style type="text/css">
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<style>
7+
body{
8+
background: #fff;
9+
color:#000;
10+
font-family:system-ui;
11+
}
512

6-
.slidecontainer {
13+
button{
14+
font:inherit;
15+
}
16+
.slidecontainer {
717
width:100%;
8-
}
18+
}
919
</style>
1020

1121
<title>WCAG Example of Motion Sensor</title>
@@ -14,14 +24,14 @@
1424

1525
<pre class="output"></pre>
1626

17-
<h1>Slider Motion Sensor Example </h1>
27+
<h1>Slider Motion Sensor Example</h1>
1828

1929
<p>Open this slider on a device with a motion sensor, such as a smart phone or tablet. Tilt the device to the right and left to adjust the slider value. The decrease and increase buttons also adjust the value. The check box disables the motion sensing adjustment.</p>
2030
<p>Note: This example may not work across all browsers.</p>
2131

2232
<div class="slidecontainer">
2333
<button type="button" name="decrease" onclick="decreaseFunction()">Decrease Value</button>
24-
<input type="range" min="1" max="100" value="50" class="slider" id="motionSlider">
34+
<input aria-label="demo slider" type="range" min="1" max="100" value="50" class="slider" id="motionSlider">
2535
<button type="button" name="increase" onclick="increaseFunction()">Increase Value</button>
2636
<p aria-live="polite">Slider Value: <span id="demo"></span></p>
2737
</div>

0 commit comments

Comments
 (0)