-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathindex.html
More file actions
487 lines (473 loc) · 23.2 KB
/
index.html
File metadata and controls
487 lines (473 loc) · 23.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<title></title>
<link rel="stylesheet" href="./index.css" />
<link rel="stylesheet" href="../checka11y.css" />
</head>
<body>
<h1>Checka11y.css playground</h1>
<p>The intention of this file is to test out the new a11y checks you are adding, so this web page should try to not comply with a11y as much as possible.</p>
<hr />
<section>
<h2>HTML: html tag should have a lang attribute</h2>
<p>See top of page.</p>
</section>
<section>
<h2>Page title: the title tag should not be empty or missing</h2>
<p>See top of page.</p>
</section>
<section>
<h2>Images: All images require an alt attribute, whether it has a value or is null</h2>
<img src="./assets/a11y.png" />
</section>
<section>
<h2>Images: All images should have a meaningful and descriptive alt attribute.</h2>
<img alt=" " src="./assets/a11y.png" />
<img alt="*" src="./assets/a11y.png" />
<img alt="iMaGe" src="./assets/a11y.png" />
<img alt="graphic" src="./assets/a11y.png" />
<img alt="photo" src="./assets/a11y.png" />
<img alt="photograph" src="./assets/a11y.png" />
<img alt="drawing" src="./assets/a11y.png" />
<img alt="painting" src="./assets/a11y.png" />
<img alt="artwork" src="./assets/a11y.png" />
<img alt="logo" src="./assets/a11y.png" />
<img alt="bullet" src="./assets/a11y.png" />
<img alt="button" src="./assets/a11y.png" />
<img alt="arrow" src="./assets/a11y.png" />
<img alt="more" src="./assets/a11y.png" />
<img alt="spacer" src="./assets/a11y.png" />
<img alt="blank" src="./assets/a11y.png" />
<img alt="chart" src="./assets/a11y.png" />
<img alt="table" src="./assets/a11y.png" />
<img alt="diagram" src="./assets/a11y.png" />
<img alt="graph" src="./assets/a11y.png" />
<img alt="myfile.png" src="./assets/a11y.png" />
<img alt="myfile.jpg" src="./assets/a11y.png" />
<img alt="myfile.gif" src="./assets/a11y.png" />
<img alt="myfile.svg" src="./assets/a11y.png" />
<img alt="myfile.bmp" src="./assets/a11y.png" />
<img alt="image image" src="./assets/a11y.png" />
<img alt="image graphic" src="./assets/a11y.png" />
<img alt="graphic of a graphic" src="./assets/a11y.png" />
<img alt="image of an image" src="./assets/a11y.png" />
<img alt="bullet 1" src="./assets/a11y.png" />
</section>
<section>
<h2>Images: Should avoid longdesc attribute and it must be an URL.</h2>
<img alt="accessibility icon" src="./assets/a11y.png" longdesc="https://test.test" />
<img alt="accessibility icon" src="./assets/a11y.png" longdesc="https://test.jpg" />
<img alt="accessibility icon" src="./assets/a11y.png" longdesc="https://test.png" />
<img alt="accessibility icon" src="./assets/a11y.png" longdesc="https://test.gif" />
<img alt="accessibility icon" src="./assets/a11y.png" longdesc="https://test.avif" />
<img alt="accessibility icon" src="./assets/a11y.png" longdesc="https://test.svg" />
<img alt="accessibility icon" src="./assets/a11y.png" longdesc="This longdesc is invalid because it should be an URL instead of plain text" />
<img alt="accessibility icon" src="./assets/a11y.png" longdesc="" />
</section>
<section>
<h2>iframe: iframe has title attribute</h2>
<iframe src="https://checka11y.jackdomleo.dev" height="500" width="500"></iframe>
<iframe src="https://checka11y.jackdomleo.dev" height="500" width="500" title="Test with title"></iframe>
</section>
<section>
<h2>Lists: All children of <ol> must only be <li>, <template> or <script></h2>
<ol>
<template><span>Some text</span></template>
<li>Hello, I'm a <li> inside a <ol></li>
<div>Hello, I'm a <div> inside a <ol></div>
<li>Hello, I'm a <li> inside a <ol></li>
<script>// silence</script>
</ol>
</section>
<section>
<h2>Lists: All children of <ul> must only be <li>, <template> or <script></h2>
<ul>
<template><span>Some text</span></template>
<li>Hello, I'm a <li> inside a <ul></li>
<div>Hello, I'm a <div> inside a <ul></div>
<li>Hello, I'm a <li> inside a <ul></li>
<script>// silence</script>
</ul>
</section>
<section>
<h2>Navigation: If more than one navigation exists, each navigation should be labelled.</h2>
<nav>This is the first navigation</nav>
<p>This is separating content</p>
<nav>This is the second navigation</nav>
</section>
<section>
<h2>Description list: Direct children of a <dl> can only be <dt> and <dd></h2>
<dl>
<dt>Hello, I'm <dt> element inside <dl> element</dt>
<dd>Hello, I'm <dd> element inside <dl> element</dd>
<p>Hello, I'm <p> element inside <dl> element. </p>
</dl>
</section>
<section>
<h2>External Links: Provide advanced warning to a user when a link opens in a new window or tab</h2>
<a href="https://github.com/jackdomleo7/Checka11y.css" target="_blank">Checka11y Repo</a>
</section>
<section>
<h2>Checks for invalid HTML elements nested inside an <a></h2>
<h3>Links: <audio> with controls attribute can not be a child of <a> as it is an invalid HTML</h3>
<a>
<audio controls></audio>
</a>
<h3>Links: <button> can not be a child of <a> as it is an invalid HTML</h3>
<a>
<button>Hello, I am a button inside an <a></button>
</a>
<h3>Links: <details> can not be a child of <a> as it is an invalid HTML</h3>
<a>
<details>Hello, I am a details inside an anchor tag</details>
</a>
<h3>Links: <embed> can not be a child of <a> as it is an invalid HTML</h3>
<a>
<embed src="./assets/a11y.png" />
</a>
<h3>Links: <iframe> can not be a child of <a> as it is an invalid HTML</h3>
<a>
<iframe src="https://checka11y.jackdomleo.dev" height="300" width="300" title="Test for anchor tag with iframe as a child"></iframe>
</a>
<h3>Links: <img> with usemap attribute can not be a child of <a> as it is an invalid HTML</h3>
<a>
<img src="./assets/a11y.png" alt="Test for anchor tag with usemap attribute" usemap>
</a>
<h3>Links: <input> without type hidden attribute can not be a child of <a> as it is an invalid HTML</h3>
<a>
<input type="text" placeholder="I am an input tag">
</a>
<h3>Links: <label> can not be a child of <a> as it is an invalid HTML</h3>
<a>
<label>Hello, I am a label inside an anchor tag</label>
</a>
<h3>Links: <object> with usemap attribute can not be a child of <a> as it is an invalid HTML</h3>
<a>
<object data="./assets/a11y.png" width="500" height="500" usemap></object>
</a>
<h3>Links: <select> can not be a child of <a> as it is an invalid HTML</h3>
<a>
<select>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</a>
<h3>Links: <textarea> can not be a child of <a> as it is an invalid HTML</h3>
<a>
<textarea placeholder="Hello, I am a textarea"></textarea>
</a>
<h3>Links: <video> with controls attribute can not be a child of <a> as it is an invalid HTML</h3>
<a>
<video controls></video>
</a>
</section>
<section>
<h2>Checks for invalid HTML elements nested inside an <button></h2>
<h3>Buttons: <a> with href attribute can not be a child of <button> as it is an invalid HTML</h3>
<button>
<a href="#">Hello, I am a link inside a <button></a>
</button>
<h3>Buttons: <audio> with controls attribute can not be a child of <button> as it is an invalid HTML</h3>
<button>
<audio controls></audio>
</button>
<h3>Buttons: <button> can not be a child of <button> as it is an invalid HTML</h3>
<button>
<button>A <button></button>
</button>
<h3>Buttons: <details> can not be a child of <button> as it is an invalid HTML</h3>
<button>
<details>Hello, I am a details inside a button tag</details>
</button>
<h3>Buttons: <embed> can not be a child of <button> as it is an invalid HTML</h3>
<button>
<embed src="./assets/a11y.png" />
</button>
<h3>Buttons: <iframe> can not be a child of <button> as it is an invalid HTML</h3>
<button>
<iframe src="https://checka11y.jackdomleo.dev" height="300" width="300" title="Test for button tag with iframe as a child"></iframe>
</button>
<h3>Buttons: <img> with usemap attribute can not be a child of <button> as it is an invalid HTML</h3>
<button>
<img src="./assets/a11y.png" alt="Test for img tag with usemap attribute" usemap>
</button>
<h3>Buttons: <input> without type hidden attribute can not be a child of <button> as it is an invalid HTML</h3>
<button>
<input type="text" placeholder="I am an input tag">
</button>
<h3>Buttons: <label> can not be a child of <button> as it is an invalid HTML</h3>
<button>
<label>Hello, I am a label inside a button tag</label>
</button>
<h3>Buttons: <object> with usemap attribute can not be a child of <button> as it is an invalid HTML</h3>
<button>
<object data="./assets/a11y.png" width="500" height="500" usemap></object>
</button>
<h3>Buttons: <select> can not be a child of <button> as it is an invalid HTML</h3>
<button>
<select>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</button>
<h3>Buttons: <textarea> can not be a child of <button> as it is an invalid HTML</h3>
<button>
<textarea placeholder="Hello, I am a textarea"></textarea>
</button>
<h3>Buttons: <video> with controls attribute can not be a child of <button> as it is an invalid HTML</h3>
<button>
<video controls></video>
</button>
</section>
<section>
<h2>Dir attribute: The dir attribute can only have the values, ltr, rtl and auto.</h2>
<p dir="lr">This is an <p> with dir attribute set to lr (invalid)</p>
<p dir="rtl">This is an <p> with dir attribute set to rtl (valid)</p>
</section>
<section>
<h2>Check the tabindex of commonly tabbed to elements and show an error if it is -1</h2>
<h3>Links with an href attribute cannot have a tabindex of -1</h3>
<a href="https://checka11y.jackdomleo.dev" target="_self" tabindex="-1">I am an anchor tag ( with an href attribute ) having a tabindex of-1</a>
<h3><area> elements with an href attribute cannot have a tabindex of -1</h3>
<img src="./assets/a11y.png" alt="Test for area elements with an href attribute" usemap="#workmap" width="400" height="379"/>
<map name="workmap">
<area shape="rect" coords="34,44,270,350" alt="Clickable area" href="https://checka11y.jackdomleo.dev" tabindex="-1"/>
</map>
<h3><input> elements that are not disabled cannot have a tabindex of-1</h3>
<label for="test-input"></label>
<input type="text" placeholder="I am input tag" name="test-input" id="test-input" tabindex="-1"/>
<h3><select> elements that are not disabled cannot have a tabindex of-1</h3>
<select name="options" id="options" tabindex="-1">
<option value="first-option">First option</option>
<option value="second-option">Second option</option>
</select>
<h3><textarea> elements that are not disabled cannot have a tabindex of -1</h3>
<textarea placeholder="Hello, I am a textarea" tabindex="-1"></textarea>
<h3><button> elements that are not disabled cannot have a tabindex of-1</h3>
<button tabindex="-1">Hello, I am a button</button>
<h3><iframe> elements cannot have a tabindex of -1</h3>
<iframe src="https://checka11y.jackdomleo.dev" height="500" width="500" tabindex="-1" title="Test for tabindex of -1 on an iframe"></iframe>
<h3>HTML elements with editable content cannot have a tabindex of -1</h3>
<p contenteditable="true" tabindex="-1">I am a paragraph tag with editable content</p>
</section>
<section>
<h2>Autoplay enabled: Do not set video/audio on the page to autoplay</h2>
<video src="https://cdn.videvo.net/videvo_files/video/free/2016-11/small_watermarked/Smoke_Light_08_Videvo_preview.webm" autoplay controls muted></video>
</section>
<section>
<h2>Headings: all headings should have (meaningful) content</h2>
<div>
<p>An empty heading does not make sense from a semantic point of view and is a sign of an underlying problem</p>
<h1></h1>
<h2></h2>
<h3></h3>
<h4></h4>
<h5></h5>
<h6></h6>
</div>
</section>
<section>
<h2>Headings: reachable by assistive technologies</h2>
<p>Headings should be reachable by assistive technologies (do not use <code>aria-hidden</code> or similars on a heading)</p>
<h1 aria-hidden="true">H1 with aria-hidden="true"</h1>
<h2 aria-hidden="true">H2 with aria-hidden="true"</h2>
<h3 aria-hidden="true">H3 with aria-hidden="true"</h3>
<h4 aria-hidden="true">H4 with aria-hidden="true"</h4>
<h5 aria-hidden="true">H5 with aria-hidden="true"</h5>
<h6 aria-hidden="true">H6 with aria-hidden="true"</h6>
</section>
<section id="heading-skip-levels">
<h2>Headings: do not skip levels</p>
<h4>H4 (correct: because no higher level above it, even when it skipped h3)</h4>
<h1>H1 (error: not in order, should be unique)</h1>
<h2>H2 (correct)</h2>
<h3>H3 (error: first h3 after h4)</h3>
<h6>H6 (correct: because no higher level above it, even when it skipped h5)</h6>
<h5>H5 (error: not in order)</h5>
</div>
</section>
<section>
<h2>Inline style: <code>!important</code> should be avoided so end-users can override the default styles</h2>
<div>
<p style="color: inherit;">This paragraph has inline style without <code>!important</code> (OK).</p>
<p style="color: inherit !important;">This paragraph has inline style with <code>!important</code> (Error).</p>
</div>
</section>
<section>
<h2>Accesskey attribute: avoid using attribute accesskey</h2>
<p>Accesskey attribute could interfere and conflict with screen readers and assistive technologies that use shortcuts or keyboard combinations to facilitate the users</p>
<div>
<p>Press <strong>S</strong> to save the changes</p>
<button accesskey="s">Save</button>
</div>
</section>
<section>
<h2>Links should have meaningful content or be labelled appropriately for assistive technologies</h2>
<div>
<a href="https://github.com/jackdomleo7/Checka11y.css"></a>
<a>Hello, I am an anchor</a>
<a href aria-label="I am empty but have an aria-label"></a>
<a href aria-labelledby="id-to-element"></a>
</div>
</section>
<section>
<h2>Buttons should have meaningful content or be labelled appropriately for assistive technologies</h2>
<div>
<button></button>
<button>Hello, I am a button</button>
<button aria-label="I am empty but have an aria-label"></button>
<button aria-labelledby="id-to-element"></button>
</div>
</section>
<section>
<h2>Avoid using <code><u></code> element as it could look like a link</h2>
<div>
<u>Hello, I am not a link, I am just underlined text</u>
<em><b>I am a bold <code><em></code> element to denote stress emphasis</b></em>
</div>
</section>
<section>
<h2>Avoid using mouse event handlers without the appropriate keyboard alternative on HTML Elements</h2>
<div>
<div onclick="">A div with onclick</div>
<div onclick="" onkeydown="">A div with onclick and onkeydown</div>
<div onclick="" onkeydown="" role="button">A div with onclick, onkeydown and role=button</div>
<div onclick="" onkeydown="" role="button" tabindex="-1">A div with onclick, onkeydown, role=button and tabindex=-1</div>
</div>
</section>
<section>
<h2>The <code>title</code> attribute has many accessibility concerns, consider using an alternative method.</h2>
<p title="Hello!">
I have a title attribute. Hover me.
</p>
</section>
<section>
<h2>Elements with aria-hidden should not have focusable descendants.</h2>
<div aria-hidden="true">
<a>Anchor</a>
</div>
<div aria-hidden="true">
<map>
<area />
</map>
</div>
<div aria-hidden="true">
<audio controls></audio>
</div>
<div aria-hidden="true">
<button>Button</button>
</div>
<div aria-hidden="true">
<iframe src="https://checka11y.jackdomleo.dev" title="Checka11y.css website"></iframe>
</div>
<div aria-hidden="true">
<input type="texr" />
</div>
<div aria-hidden="true">
<select><option>Option</option></select>
</div>
<div aria-hidden="true">
<details>Hello again<summary>Hello</summary></details>
</div>
<div aria-hidden="true">
<textarea></textarea>
</div>
<div aria-hidden="true">
<video controls></video>
</div>
</section>
<section>
<h1 role="text">This should not have role=text</h1>
<h2 role="text">This should not have role=text</h2>
<h3 role="text">This should not have role=text</h3>
<h4 role="text">This should not have role=text</h4>
<h5 role="text">This should not have role=text</h5>
<h6 role="text">This should not have role=text</h6>
</section>
<section>
<h2>Anchor tags should not be used as buttons</h2>
<a href="#">Do something</a>
<a href="javascript:void(0)" role="button">Do another thing</a>
<a href="javascript:doSomething(0)">Do another thing</a>
</section>
<section>
<h2>A <code><section></code> should contain a heading element</h2>
<section>
<h2>This is a heading element.</h1>
</section>
<section><!-- This is an empty section --></section>
<section>
<p>this is not a heading element, just a cool paragraph.</p>
</section>
</section>
<section>
<h2>A <code><a></code> has an <code>href</code> linking to a PDF, Word, Excel, or PowerPoint document.</h2>
<ul>
<li><a href="/static/foo.pdf">.pdf (PDF)</a></li>
<li><a href="/static/foo.docx">.docx (Word)</a></li>
<li><a href="/static/foo.doc">.doc (Word)</a></li>
<li><a href="/static/foo.xls">.xls (Excel)</a></li>
<li><a href="/static/foo.xlsx">.xlsx (Excel)</a></li>
<li><a href="/static/foo.pptx">.pptx (PowerPoint)</a></li>
<li><a href="/static/foo.pptm">.pptm (PowerPoint)</a></li>
<li><a href="/static/foo.ppt">.ppt (PowerPoint)</a></li>
<li><a href="/static/foo.txt">.txt (Text)</a></li>
</ul>
<h2>A <code><a></code> has an <code>href</code> linking to a content site (Youtube, etc)</h2>
<ul>
<li><a href="https://youtube.com/foo">YouTube Link</a></li>
<li><a href="https://youtu.be/bar">YouTube Link</a></li>
<li><a href="https://spotify.com/en/">Spotify Link</a></li>
</ul>
</section>
<section id='interactive-elements'>
<h2>Interactive Elements: not reachable by assistive technologies</h2>
<p>Interactive Elements should be reachable by assistive technologies (do not use <code>aria-hidden</code> on a Interactive Elements.) </p>
<a aria-hidden="true" href='https://github.com/jackdomleo7/Checka11y.css'>Anchor for Interactive purposes</a>
<map name="workmap" aria-hidden="true">
<area shape="rect" coords="34,44,270,350" alt="Clickable area" href="https://checka11y.jackdomleo.dev"/>
</map>
<map name="workmap" >
<area shape="rect" coords="34,44,270,350" alt="Clickable area" href="https://checka11y.jackdomleo.dev" aria-hidden="true"/>
</map>
<audio aria-hidden="true" controls></audio>
<button aria-hidden="true">Button</button>
<iframe aria-hidden="true" src="https://checka11y.jackdomleo.dev" title="Checka11y.css website"></iframe>
<input aria-hidden="true" type="text" />
<select aria-hidden="true"><option>Option</option></select>
<details >Interactive details element<summary aria-hidden="true">Summary</summary></details>
<textarea aria-hidden="true">textarea</textarea>
<video aria-hidden="true" controls></video>
<div aria-hidden='true' role='button'>interactive custom button</div>
<div role="link" aria-hidden="true">Custom Link</div>
<div role="combobox" aria-hidden="true">ComboBox</div>
<ul role="menu">
<li role="menuitem" aria-hidden="true">Menu Item 1</li>
<li role="menuitem" tabindex="0">Menu Item 2</li>
</ul>
<div role="menuitemcheckbox" aria-hidden="true">Menu Checkbox</div>
<div role="menuitemradio" aria-hidden="true">Menu Radio</div>
<div role="option" aria-hidden="true">Option</div>
<div role="radio" aria-hidden="true">Radio Button</div>
<div role="scrollbar" aria-hidden="true">Scroll Bar</div>
<div role="searchbox" aria-hidden="true">Search Box</div>
<div role="separator" aria-valuenow aria-hidden="true">Separator with aria-valuenow</div>
<div role="separator" aria-valuemax aria-hidden="true">Separator with aria-valuemax</div>
<div role="separator" aria-valuemin aria-hidden="true">Separator with aria-valuemin</div>
<div role="slider" aria-hidden="true">Slider</div>
<div role="spinbutton" aria-hidden="true">Spin Button</div>
<div role="switch" aria-hidden="true">Switch</div>
<div role="tablist">
<div role="tab" aria-selected="true">Tab 1</div>
<div role="tab" aria-hidden='true'>Tab 2</div>
</div>
<div role="textbox" aria-hidden="true">Text Box</div>
<div role="treeitem" aria-hidden="true">Tree Item</div>
</section>
</body>
</html>