Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Selfish Accessibility: HTML5 Developer Conference 2014


Published on

We can all pretend that we're helping others by making web sites accessible, but we are really making the web better for our future selves. Learn some fundamentals of web accessibility and how it can benefit you (whether future you from aging or you after something else limits your abilities). We'll review simple testing techniques, basic features and enhancements, coming trends, and where to get help. This isn't intended to be a deep dive into ARIA, but more of an overall primer for those who aren't sure where to start nor how it helps them.

Published in: Technology, Design

Selfish Accessibility: HTML5 Developer Conference 2014

  1. 1. Selfish Accessibility Presented by Adrian Roselli for HTML5 Developer Conference 2014 I suspect there’s a hashtag.
  2. 2. About Adrian Roselli • Co-written four books. • Technical editor for two books. • Written over fifty articles, most recently for .net Magazine and Web Standards Sherpa. Great bedtime reading!
  3. 3. About Adrian Roselli • Member of W3C HTML Working Group, W3C Accessibility Task Force, five W3C Community Groups. • Building for the web since 1994. • Founder, owner at Algonquin Studios ( • Learn more at • Avoid on Twitter @aardrian. I warned you.
  4. 4. What We’ll Cover • Boring Statistics • How to Be Selfish • Basic Tests • Some Techniques • Questions (ongoing!) Work with me, people.
  5. 5. Boring Statistics 1 of 4 sections.
  6. 6. Any Disability • In the United States: • 10.4% aged 21-64 years old, • 25% aged 65-74 years old, • 50% aged 75+. • Includes: • Visual • Hearing • Mobility • Cognitive
  7. 7. Vision Impairments • 285 million worldwide: • 39 million are blind, • 246 million have low vision. • 82% of people living with blindness are aged 50 and above. • 1.8% of Americans aged 21-64. • 4.0% of Americans aged 65-74. • 9.8% of Americans aged 75+.
  8. 8. Hearing Impairments • 360 million people worldwide have disabling hearing loss. • 17% (36 million) of American adults report some degree of hearing loss: • 18% aged 45-64 years old, • 30% aged 65-74 years old, • 47% aged 75+ years old.
  9. 9. Mobility Impairments • In the United States: • 5.5% aged 21-64 years old. • 15.6% aged 65-74 years old. • 32.9% aged 75+.
  10. 10. Cognitive Impairments • Dyslexia • Dyscalculia • Memory issues • Distractions • In the United States: • 4.3% aged 21-64 years old. • 5.4% aged 65-74 years old. • 14.4% aged 75+.
  11. 11. How to Be Selfish 2 of 4 sections.
  12. 12. WebAIM’s Hierarchy for Motivating Accessibility Change
  13. 13. My Hierarchy for Motivating Accessibility Change Is better, no?
  14. 14. Getting Older • Affects (nearly) everyone, • Carries risks and side effects, • Is not for the young. I’m still experimenting with it.
  15. 15. Rising Damp on Flickr.
  16. 16. Darren Baldwin on Flickr.
  17. 17. Accidents • Broken limbs, • Eye injuries, • Hearing injuries, • Head trauma. All of these have happened to me, multiple times.
  18. 18. James Lee on Flickr.
  19. 19. Rev Stan on Flickr.
  20. 20. Let Ideas Compete on Flickr.
  21. 21. Fluffy Steve on Flickr.
  22. 22. Paul Townsend on Flickr.
  23. 23. But I’m Invincible! • Multi-tasking, • Sunlight, • Eating at your desk, • No headphones handy, • Content is not in your native language. The sun is trying to kill me.
  24. 24. Shawn Liu on Flickr.
  25. 25. Bitznbitez on Flickr.
  26. 26. Mariëlle on Flickr.
  27. 27. barockschloss on Flickr.
  28. 28. Seb on Flickr.
  29. 29. A.Davy on Flickr.
  30. 30. Raul Lieberwirth on Flickr.
  31. 31. Tim Norris on Flickr.
  32. 32. Lars Kristian Flem on Flickr.
  33. 33. Steve Rhodes on Flickr.
  34. 34. SuperFantastic on Flickr.
  35. 35. Jacob Enos on Flickr.
  36. 36.
  37. 37. Tech Support • Think of your family! • Think of your time spent helping them! This is why we hate the holidays.
  38. 38. Robert Simmons on Flickr.
  39. 39. The Message • Supporting accessibility now helps to serve future you. • Supporting accessibility now helps injured you, encumbered you. • Getting younger developers to buy in helps future you – if you teach them well. There is no try.
  40. 40. Basic Tests 3 of 4 sections.
  41. 41. Click on Field Labels • When you click label text next to a text box, does the cursor appear in the field? • When you click label text next to a radio / checkbox, does it get toggled? • When you click label text next to a select menu, does it get focus?
  42. 42. Unplug Your Mouse • Turn off your trackpad, stick, trackball, etc. • Can you interact with all controls (links, menus, forms) with only the keyboard? • Can you tell which item has focus? • Does the tab order match your expectation?
  43. 43. Turn off Images • Can you still make sense of the page? • Is content missing? • Can you still use the site? • Is your alt text useful?
  44. 44. Turn on High Contrast Mode • Windows only. • Background images and colors are replaced. • Text colors are replaced. • Does this make your site unusable?
  45. 45. Turn off CSS • Does important content or functionality disappear? • Do error messages or other items that rely on visual cues make sense? • Is content still in a reasonable order? • Do any styles (colors, text effects, etc.) remain?
  46. 46. Test for Colorblindness/Contrast • Is there enough contrast? • Are hyperlinks, menus, etc. still visible? • Tools: • Chrome Color Contrast Analyzer • Lea Verou’s Contrast Ratio • WebAIM Color Contrast Checker •
  47. 47. Protanopia
  48. 48. Deuteranopia
  49. 49. Tritanopia
  50. 50. Look for Captions & Transcripts • Do video/audio clips have text alternatives? • Are links to closed-captions or transcripts built into the player or separate text links? • Is there an audio description available? • Tools: • Media Access Australia YouTube captioning tutorial, Vimeo captioning tutorial • Tiffany Brown’s WebVTT tutorial
  51. 51.
  52. 52. Hyperlinks! • Is there any “click here,” “more,” “link to…”? • Are you using all-caps, URLs, emoticons? • Do you warn before opening new windows? • Do links to downloads provide helpful info? • Are you using pagination links? • Are your links underlined (or otherwise obvious)? • Is there alt text for image links? • Is the link text consistent?
  53. 53.
  54. 54. Some Techniques 4 of 4 sections.
  55. 55. WAI-ARIA • Web Accessibility Initiative – Accessible Rich Internet Applications. • Adds accessibility information to HTML elements. • Can be used with prior versions of HTML. • WAI-ARIA 1.0 published March 20, 2014.
  56. 56. Four Five Rules of ARIA Use 1. If you can use a native HTML5 element with semantics/behavior already built in, then do so, instead of repurposing another element. RT this!
  57. 57. Four Five Rules of ARIA Use 2. Do not change native semantics. Unless you really have to (no <h1> with a role="button", for example). RT this!
  58. 58. Four Five Rules of ARIA Use 3. All interactive ARIA controls must be usable with the keyboard — keyboard users must be able to perform equivalent actions. RT this!
  59. 59. Four Five Rules of ARIA Use 4. Do not use role="presentation" or aria- hidden="true" on a focusable element. If you do so, some users will never be able to focus. RT this!
  60. 60. Four Five Rules of ARIA Use 5. All interactive elements must have an accessible name (in progress). This may come from a visible (text on a button) or invisible (alt text on an image) property. As of May 12: Accessible name:
  61. 61. Role Playing Stolen from Heydon Pickering:
  62. 62. HTML/ARIA Don’t • <div onclick="DoThing();">Do a thing.</div> I see this all the time.
  63. 63. HTML/ARIA Don’t • <div onclick="DoThing();" tabindex="0">Do a thing.</div> I see this a bunch, too.
  64. 64. HTML/ARIA Don’t • <div onclick="DoThing();" tabindex="0" onkeypress="DoThing();">Do a thing.</div> Excluded bits like if(event.keyCode==32||event.keyCode==13)DoThing();
  65. 65. HTML/ARIA Don’t • <div onclick="DoThing();" tabindex="0" onkeypress="DoThing();" role="button">Do a thing.</div> ARIA roles to the rescue! Er…
  66. 66. HTML/ARIA Do • <button onclick="DoThing();" onkeypress="DoThing();">Do a thing.</button> Or just start with the right element.
  67. 67. WAI-ARIA • Accessibility Lipstick on a Usability Pig • By Jared Smith: a-usability-pig/ • What is WAI-ARIA, what does it do for me, and what not? • By Marco Zehe: wai-aria-what-does-it-do-for-me-and-what-not/ ARIA ALL THE THINGS!
  68. 68. HTML5 Elements • Sectioning elements already have accessibility built in. Use them. • <header> • <nav> • <main> (one per page) • <aside> • <footer> • <form> (a search form) This stuff is baked in!
  69. 69. HTML5/ARIA Landmarks • They don’t always have support in assistive technologies (AT), so use roles as well. • <header role="banner"> (once per page) • <nav role="navigation"> • <main role="main"> (one per page) • <aside role="complementary"> • <footer role="contentinfo"> (once per page) • <form role="search">
  70. 70. Generic Desktop Layout <header role="banner"> <nav role="navigation"> <aside role="complementary"> <form role="search"> <footer role="contentinfo"> <main role="main">
  71. 71. Generic “Mobile” Layout <header role="banner"> <nav role="navigation"> <aside role="complementary"> <form role="search"> <footer role="contentinfo"> <main role="main"> “Mobile” really means narrow screen in RWD, as well as this context.
  72. 72. HTML5 Headings • Use normal heading ranks to convey document structure. • Don’t skip; go in order. <h1> <h2> <h3> <h4> <h5> <h6> Fun fact: NCSA Mosaic 1.0 had provisions for an <h7>:
  73. 73. HTML5 Headings • Document Outline Algorithm… • Is a myth, • Isn’t implemented in any browsers, • Should not be relied upon. • Don’t be fooled by articles claiming otherwise. • Spec being updated. • No SEO benefit for one over other.
  74. 74. The New <div>itis • <section>orrhea, <article> abuse. • These map to regions in page navigation order (role="region"). • Can overwhelm users of AT. • If it doesn’t get an <h#>, don’t use it. • If it shouldn’t be in the document outline, don’t use it.
  75. 75. Alternative Text • Which is correct? • <img src="fox.png" alt="Photo of a fox reading aloud from a book."> • <img src="fox.png" title="Photo of a fox reading aloud from a book."> • <img src="fox.png" aria-label="Photo of a fox reading aloud from a book."> • <img src="fox.png" aria-labelledby="FoxPic"> <p id="FoxPic">Photo of a fox reading aloud from a book.</p>
  76. 76. Alternative Text • Use alt. • Longdesc links to more verbose alternative.
  77. 77. Alternative Text Decision Tree 1. What role does image play? 2. Does it present new info? 3. What type of info? Informative Yes alt="" or <a href="foo"><img alt="">Link</a> alt="" or Use CSS alt="descriptive identification" or alt="short label" + caption PurelyDecorative Sensory No alt="label for link" alt=“short alternative" or alt="short label" + caption alt="short label + location of long alternative" or long text alternative on same or linked page Long/Complex Short/Simple
  78. 78. Questions This isn’t a section, you should have been asking all along.
  79. 79. Resources • Web Accessibility and Older People: Meeting the Needs of Ageing Web Users • Easy Checks - A First Review of Web Accessibility • How People with Disabilities Use the Web: Overview web/Overview.html In addition to the gems I’ve sprinkled throughout.
  80. 80. Resources • 2.11 ARIA Role, State, and Property Quick Reference state-and-property-quick-reference • 2.12 Definitions of States and Properties (all aria-* attributes) states-and-properties-all-aria--attributes In addition to the gems I’ve sprinkled throughout.
  81. 81. Resources • a11yTips • How to Write User Stories for Web Accessibility write-user-stories-accessibility-requirements • Book Excerpt: A Web for Everyone everyone In addition to the gems I’ve sprinkled throughout.
  82. 82. Selfish Accessibility Presented by Adrian Roselli for HTML5 Developer Conference 2014 My thanks and apologies. Slides from this talk will be available at