-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMetaRefresh2013.html
More file actions
550 lines (494 loc) · 20.7 KB
/
Copy pathMetaRefresh2013.html
File metadata and controls
550 lines (494 loc) · 20.7 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
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>reveal.js - The HTML Presentation Framework</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="reveal.js/dist/reset.css">
<link rel="stylesheet" href="reveal.js/dist/reveal.css">
<link rel="stylesheet" href="reveal.js/dist/theme/sky.css" id="theme">
<!-- Code syntax highlighting -->
<link rel="stylesheet" href="css/highlight/tomorrow-night-blue.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>Inclusive Design challenges with UI Widgets</h1>
<p>
By Prem Nawaz Khan (<a href="http://twitter.com/mpnkhan">@mpnkhan</a>)
</p>
<p>
Accessibility Evangelist at PayPal (<a href="https://twitter.com/PayPalInclusive/paypal-access-team/members">@PayPalInclusive</a>)
</p>
</section>
<section>
<h3>Things we Bother</h3>
<h4>Browser compatability<h4>
<img src="./imgs/MetaRefresh2013/crossBrowsers.jpg">
</section>
<section>
<h3>Things we Bother</h3>
<p>Do we code like this? </p>
<pre>
<code contenteditable>
#wrapper {
min-height: 500px; /* IEwin does not support min-height */
height: 500px;
* height:496px;
_height: 500px;
}
html>body #wrapper {
height: auto;
}
</code>
</pre>
<pre class="fragment"> Or like this?
<code contenteditable><!--[if IE 8]><link media="screen" rel="stylesheet" type="text/css" href="ie8.css"><![endif]-->
<!--[if IE 7]><link media="screen" rel="stylesheet" type="text/css" href="ie7.css"><![endif]-->
<!--[if lte IE 6]><link media="screen" rel="stylesheet" type="text/css" href="ie6.css"><![endif]-->
</code>
</pre>
</section>
<section>
<h3>Things we Bother</h3>
<h4>Search Engines</h4>
<img src="./imgs/MetaRefresh2013/search-engine-logos-main.gif">
</section>
<section>
<h3>Things we Bother</h3>
<h4> Responsive Web Design <h4>
<img src="./imgs/MetaRefresh2013/responsive-web-design.jpg">
</section>
<section>
<h3>Things we Bother</h3>
<pre>
<code contenteditable style="font-size: 18px;">
/* Large desktop */
@media (min-width: 1200px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }
/* Landscape phone to portrait tablet */
@media (max-width: 767px) { ... }
/* Landscape phones and down */
@media (max-width: 480px) { ... }
</code>
</pre>
<p>
References: <a href="http://mobile.smashingmagazine.com/2012/10/24/beyond-common-media-query-breakpoints/">Beyond Media Breakpoints</a>
<a href="http://www.netmagazine.com/tutorials/determining-breakpoints-responsive-design">Determing Breakpoints Responsive Design</a>
</p>
</section>
<section>
<h3>Do we Ever Care?</h3>
<img src="./imgs/MetaRefresh2013/th.jpg" alt="Everyone Equal">
<img src="./imgs/MetaRefresh2013/1.jpg" alt="Assistance for Blind">
<img src="./imgs/MetaRefresh2013/wand.jpg" alt="Magic Wand Keyboard">
</section>
<section>
<h3>Why We Do Need to Care?</h3>
<ol>
<li>Equal opportunity</li>
<li>Old People</li>
<li>People not fluent in the language</li>
<li>Search engine optimization (SEO)</li>
<li>Buying power of persons with disabilities</li>
<li>Policy</li>
</ol>
<p>
Reference: <a href="http://www.w3.org/WAI/bcase/">Business Case for your Organization</a>
</p>
</section>
<section>
<h3>Why We Do Need to Care?</h3>
<blockquote cite="http://www.karlgroves.com/2012/01/27/chasing-the-accessibility-business-case-conclusion/">
As a Developer the Real Business case is
"Quality-of-work" issue.
We are not paid extra for cross-browser compatibility, Security, SEO , Responsive Web Design, etc. Similarily we are not paid for Accessibility, either
</blockquote>
<p><a href="http://www.karlgroves.com/2012/01/27/chasing-the-accessibility-business-case-conclusion/">Chasing the Accessibility Business Case – Conclusion</a></p>
</section>
<section>
<a class="image" href="http://www.w3.org/WAI/intro/people-use-web/browsing">
<img src="./imgs/MetaRefresh2013/swing.jpg" alt="Accessible Swing">
</a>
<p>Every kid should have fun like this</p>
</section>
<section>
<h3>How People With Disabilities (PWD) use the web?</h3>
<h4>Assistive Technologies (AT) </h4>
<p>
Keyboard only, by people with cognitive, physical, and visual disabilities <br>
Touch screen only, by people with cognitive and physical disabilities <br>
Voice recognition (speech input) and other hands-free interaction <br>
Screen readers, Magnifier, Refreshable braille display, Alternative keyboard and mouse, Eye tracking, Keyboard customization, Keyboard and mouse filters, On-screen keyboard, Spelling and grammar tools, Voice recognition, Word prediction
</p>
<a href="http://www.bbc.co.uk/accessibility/guides/">How to guides</a><br>
<a href="http://www.w3.org/WAI/intro/people-use-web/browsing">How Person with Disability use Web</a>
</section>
<section>
<h3>Most Impactful Accessibility Challenges :</h3>
<p>
<ol>
Problematic items identified are (in order, with most difficult/frustrating first):
<li>The presence of inaccessible Flash content</li>
<li>CAPTCHA - images presenting text used to verify that you are a human user</li>
<li>Links or buttons that do not make sense</li>
<li>Images with missing or improper descriptions (alt text)</li>
<li>Screens or parts of screens that change unexpectedly</li>
<li>Complex or difficult forms</li>
<li>Lack of keyboard accessibility</li>
<li>Missing or improper headings</li>
<li>Too many links or navigation items</li>
<li>Complex data tables</li>
<li>Inaccessible or missing search functionality</li>
<li>Lack of "skip to main content" or "skip navigation" links</li>
</ol>
<p>Ref: <a href="http://webaim.org/projects/screenreadersurvey4/">Web Aim Survey, April 2012</a>
</section>
<section>
<h3> Few things to know : </h3>
<ul>
<li>Hiding Content with CSS </li>
<li>tabIndex: </li>
<li>Show focus </li>
<li>Device Independent Event Handlers </li>
<li>Aria Attributes </li>
<li>Label </li>
</ul>
</section>
<section>
<h3>Hiding Content with CSS </h3>
<p>
<pre><code contenteditable style="font-size: 18px;">
.hidden{
display: none; /* Content ignored by SR */
}
/* Old */
.offscreen { /*jump effect, if focusable content within the positioned element */
position: absolute;
left: -999em;
}
/* New */
.offscreen {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px,1px,1px,1px);
}
</code></pre>
</p>
</section>
<section>
<h3>tabIndex</h3>
<p>Tabindex is to define the order in which elements will receive focus when navigated by the user via the keyboard</p>
<ul>tabIndex can have the following values :
<li> "-1" => Can use element.focus(). Element will not in tabFlow</li>
<li> "0" => Element will be in tab flow + can use element.focus() </li>
<li> "positive integer" => Places element above tabIndex 0</li>
</ul>
</section>
<section>
<h3>Event Handlers</h3>
<ul>
<li>Use onFocus, onBlur, onSelect, onChange, and onClick (when onClick is used with link or form elements)</li>
<li>onMouseOver, onMouseOut, and onDblClick rely upon the use of a mouse </li>
<li>onKeyDown, onKeyUp, etc. rely upon Keyboard</li>
</ul>
<p><a href="http://webaim.org/techniques/javascript/eventhandlers">Read about Accessible Event Handlers</a></p>
</section>
<section>
<h3>Show focus (always)</h3>
<h4>Do NOT do this</h4>
<pre><code contenteditable style="font-size: 18px;">
a {
outline: 0 none;
}
</code></pre>
<p>
One of the reasons could be because of using old version of Eric Meyer's <a href="http://meyerweb.com/eric/tools/css/reset/reset200802.css">Reset.css</a>
</p>
<h4>Instead, do this</h4>
<pre><code contenteditable style="font-size: 18px;">
button:focus {
outline: dotted 1px #000;
}
</code></pre>
<p>
Reference: <a href="http://outlinenone.com/">http://outlinenone.com/</a>
</p>
</section>
<section>
<h3>Accessible Rich Internet <u>Applications</u> (Aria)</h3>
<img src="./imgs/MetaRefresh2013/AriaTypes.png" alt="Aria attributes are of type Role , State and Properties">
</section>
<section>
<h3>Aria Roles</h3>
<img src="./imgs/MetaRefresh2013/Roles.jpg" alt="Aria role is divided into Structure role, Landmark Roles and Widget Roles">
</section>
<section>
<h4>States and Properties</h4>
<ul>
States and properties are categorized as follows
<li>Widget Attributes (Eg. aria-haspopup, aria-hidden) </li>
<li> Live Region Attributes (Eg. aria-live) </li>
<li>Drag-and-Drop Attributes (Eg. aria-dropeffect, aria-grabbed) </li>
<li>Relationship Attributes (Eg. aria-describedby, aria-controls) </li>
</section>
<section>
<h3>Aria Overview</h3>
<ul>
<li> Passes Important Information to screen reader</li>
<li> Does NOT change the presentation or behavior of the Web page to sighted users</li>
<li> Does NOT makes the element focusable</li>
<li> Does NOT makes it Keyboard Accessible</li>
</section>
<section>
<h3>Labelling</h3>
<ul>
<li> aria-labelledby = "elemID"</li>
<li> aria-label = "label text"</li>
<li> Associated label (<label for=“myControl”>) or alt attribute </li>
<li> Text contents </li>
<li>Title attribute</li>
<li> aria-describedby = "elemID" for additional info</li>
</ul>
</section>
<section>
<h3>Ajax Updates</h3>
<ul>
<li><span class="code">aria-live="off | polite | assertive"</span></li>
<li><span class="code">aria-atomic="true | false"</span> - read the entire region or only what has changed</li>
<li><span class="code">aria-relevant =" additions | removals | text | all"</span> -</li>
</ul>
<pre><code contenteditable><div aria-live="polite" aria-relevant="additions" aria-atomic="true"> Ajax Updates</div>
</code></pre>
<p> Implicit live roles: </p>
<pre><code contenteditable>
<div role="alert" id="errMsgId"> Important Error Message</div>
<output role="status"></output>
</code></pre>
</section>
<section>
<h3>Accessible Button? </h3>
<p>
Eg. Element which looks like Button:
<span role="button" class="btn" onClick="alert('clicked')">Call to Action Button</span>
<pre><code contenteditable style="padding:0px;">
<span class="btn"> Call to Action Button </span>
</code></pre>
</p>
<p class="fragment">
Adding tabIndex of "0" and Role Button <span role="button" tabIndex="0" class="btn" onClick="alert('clicked')">Call to Action Button</span>
<pre class="fragment"><code contenteditable style="padding:0px;">
<span role="button" tabIndex="0" class="btn"> Call to Action Button </span>
</code></pre>
</p>
<p class="fragment">Add Some Focus Styles
<span role="button" tabIndex="0" class="btnA" onClick="alert('clicked')">Call to Action Button</span>
<pre class="fragment"><code contenteditable style="padding:0px;">
span.btn:hover, span.btn:focus {
text-shadow: -1px -1px 2px #465f97;
background: -moz-linear-gradient(#245192, #1e3b73 75%, #12295d);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #245192),color-stop(.75, #1e3b73),color-stop(1, #12295d));
border: 1px solid #0f2557;
}
</code></pre>
</p>
</section>
<section>
<h3>Accessible Button (contd) </h3>
<p> We would need to add some JS for handling KeyDown
<pre class="fragment"><code contenteditable style="padding:0px;">
keydown: function(e) { // Trigger the click event from the keyboard
var code = e.which;
if ((code === 13) || (code === 32)) { // 13 = Return, 32 = Space
$(this).click();
}
},
</code></pre>
</p>
<p class="fragment">
But this is Better , Isn't it?
</p>
<pre class="fragment"><code contenteditable style="padding:0px;"><a role="button" tabIndex="0" class="btn"> Call to Action Button </a>
<button class="btnA">Call to Action Button</button>
<button class="btnA" onClick="alert('clicked')">Call to Action Button</button>
</code></pre>
</p>
</section>
<section>
<h3>Accessible Tooltip</h3>
<pre><code contenteditable style="font-size: 14px;"><span title="" onmouseover="showTip('desc');" onmouseout="hideTip('desc');">tooltip </span>
<div class="ui-tooltip" id="desc">Some Tooltip Text</div>
</code></pre>
<p class="fragment"> Add tabIndex 0 or use anchor
<pre class="fragment"><code contenteditable style="font-size: 14px;">
<span title="" tabIndex="0" onmouseover="showTip('desc');"
onmouseout="hideTip('desc');">tooltip </span>
<div class="ui-tooltip" id="desc">Some Tooltip Text</div>
</code></pre>
</p>
<p class="fragment"> Add Keyboard support
<pre class="fragment"><code contenteditable style="font-size: 14px;"><span title="" tabIndex="0" aria-describedBy="desc"
onmouseover="showTip('desc');"
onmouseout="hideTip('desc');"
onfocus="showTip('desc');"
onblur="hideTip('desc');">tooltip </span>
<div class="ui-tooltip" id="desc" role="tooltip>Some Tooltip Text</div>
</code></pre>
</p>
<p class="fragment"> Aria-describedby and role="tooltip"
<pre class="fragment"><code contenteditable style="font-size: 14px;"><span title="" tabIndex="0" aria-describedBy="desc"
onmouseover="showTip('desc');"
onmouseout="hideTip('desc');">tooltip </span>
<div class="ui-tooltip" id="desc" role="tooltip>Some Tooltip Text</div>
</code></pre>
</p>
</section>
<section>
<h3>Accessible Drop Down</h3>
<p>
<pre><code contenteditable><a href="#" id="drop1" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>
<ul class="dropdown-menu" id="menu1">
<li><a href="#">New File</a></li>
<li><a href="#">Open...</a></li>
<li><a href="#">New Window</a></li>
</ul>
</code></pre>
</p>
<p class="fragment"> Adding tabIndex, Menu, Menu Item and Presentation roles</p>
<pre class="fragment"><code contenteditable>
<a href="#" role="button" aria-haspopup="true" aria-expanded="false" id="drop1" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>
<ul aria-labelledby="drop1" role="menu" class="dropdown-menu" id="menu1">
<li role="presentation"><a href="#" role="menuitem" tabindex="-1">New File</a></li>
<li role="presentation"><a href="#" role="menuitem" tabindex="-1">Open...</a></li>
<li role="presentation"><a href="#" role="menuitem" tabindex="-1">New Window</a></li>
</ul>
</code></pre>
</p>
</section>
<section>
<h3>Accessible Drop Down (Contd.)</h3>
<p>
<ul>
<li> Set aria-expanded to true and dynamically manage aria-expanded state</li>
<li> Set focus to first item on Menu.</li>
</ul>
</p>
<pre class="fragment"><code contenteditable>
if (!isActive) {
$parent.toggleClass('open')
setTimeout(function(){
$('[role=menu] li a', $parent)[0].focus()
},100)
$parent.find(toggle).attr('aria-expanded', true)
}else $parent.find(toggle).attr('aria-expanded', false)
</code></pre>
<p class="fragment"> Listen to KeyDown event and navigate with up/down arrow cycle thru Menu items</p>
<pre class="fragment"><code contenteditable>
$(document).on('keydown.dropdown.data-api', toggle + ', [role=menu]'
, Dropdown.prototype.keydown)
, keydown: function (e) {
index = $items.index($items.filter(':focus'))
if (e.keyCode == 38) index-- // up
if (e.keyCode == 40) index++ // down
if(index < 0) index = $items.length -1;
if(index == $items.length) index = 0;
$items
.eq(index)
.focus()
}
</code></pre>
</section>
<section>
<h3>Accessible Drop Down (Contd.)</h3>
<p> Close on Esc Key and on Focus Out </p>
<pre><code contenteditable>
, keydown: function (e) {
if (!isActive || (isActive && e.keyCode == 27))
return $parent.find(toggle).click().focus()
}
.on('focusout.dropdown.data-api', '.dropdown-menu', function(e){
var $this = $(this)
setTimeout(function() {
if(!$(document.activeElement).is($this.find("a"))){
clearMenus()
}
}, 150)
})
</code></pre>
</section>
<section>
<h3>Accessible Dialog</h3>
<p>Dialog boxes, in Most cases is an accessibility disaster</p>
<ol>
<li> Aria Roles of Dialog</li>
<li> aria-labelledBy to label the Dialog</li>
<li>Set focus to the dialog</li>
<li>Trap focus within the dialog</li>
<li>Close on Esc Key</li>
<li>Return the focus to the opener element, safely.</li>
</ol>
<p>
<a href="http://mpnkhan.github.com/BootStrapExamples/a11yfixes/bs.html">Dialog Example</a> <br>
<a href="http://www.nczonline.net/blog/2013/02/12/making-an-accessible-dialog-box/">Making an accessible dialog box</a>
</p>
</section>
<section>
<h3>Summary</h3>
<ul>
<li>Accessibility is a "quality-of-work" issue</li>
<li>It is Easy to make the widgets Accessible</li>
<li>Make your page Accessible first and them make your widgets Accessible</li>
<li>If you must use some thirdparty library, fork it, clone it and make it Accessible or make it Accessible in your clone</li>
</ul>
</section>
<section>
<h3>Anything Else ?</h3>
<ul>
<li>Questions?</li>
<li><a href="http://mpnkhan.github.com/BootStrapExamples/">Few A11Y examples using Twitter BootStrap</a></li>
<li>Twitter (<a href="https://twitter.com/mpnkhan">@mpnkhan</a>)</li>
</ul>
<p>
<ul> References:
<li><a href="https://developer.mozilla.org/en-US/docs/Accessibility/Keyboard-navigable_JavaScript_widgets">Keyboard-navigable JavaScript widgets</a></li>
<li><a href="http://www.w3.org/TR/wai-aria-practices/#aria_ex">Design Patterns</a></li>
<li><a href="http://www.w3.org/TR/aria-in-html/">Aria in HTML</a></li>
</ul>
</p>
</section>
</div> <!--end slides -->
</div> <!-- reveal div ends -->
<script src="reveal.js/dist/reveal.js"></script>
<script src="reveal.js/plugin/zoom/zoom.js"></script>
<script src="reveal.js/plugin/notes/notes.js"></script>
<script src="reveal.js/plugin/search/search.js"></script>
<script src="reveal.js/plugin/markdown/markdown.js"></script>
<script src="reveal.js/plugin/highlight/highlight.js"></script>
<script>
Reveal.initialize({
controls: true,
progress: true,
center: true,
hash: true,
plugins: [ RevealZoom, RevealNotes, RevealSearch, RevealMarkdown, RevealHighlight ]
});
</script>
</body>
</html>