SlideShare a Scribd company logo
Accessibility
&Forms
in HTML5

Aaron Gustafson
Easy Designs, LLC
slideshare.net/AaronGustafson
Accessibility & Forms




                    2
Accessibility & Forms




ARIA maps the OS to the web
Accessibility & Forms




Semantics+
Accessibility & Forms




Landmarks
help users
navigate
quickly
Accessibility & Forms




All the site’s a play...
The role attribute
Defines the part an element is playing (assuming it’s different than the
semantics would otherwise imply).

<section id="main" role="main">
 <!-- The primary content for the page would go here -->
</section>
Accessibility & Forms
Accessibility & Forms




<header role="banner">
Accessibility & Forms




<nav role="navigation">
Accessibility & Forms




<form role="search">
Accessibility & Forms




<section role="main">
Accessibility & Forms
Accessibility & Forms




<footer role="contentinfo">
Accessibility & Forms




<nav role="navigation">
Accessibility & Forms
Accessibility & Forms




<aside role="complementary">
Accessibility & Forms




Landmark roles
application
A region of the page representing a unique software unit executing a set of tasks for its
users. It is an area where assistive technologies should also return browse navigation
keys back over to the web application in this region.
banner
A region that contains the prime heading or internal title of a page.
complementary
A supporting section of the document that remains meaningful even when separated
from the main content.
contentinfo
Metadata that applies to the parent document.
form
A region of the document that represents a collection of form-associated elements.
main
navigation
search
Accessibility & Forms




Landmark roles
main
The main content of a document.
navigation
A collection of navigational elements (usually links) for navigating the document or
related documents.
search
The search tool of a web document.
Accessibility & Forms




Structural roles
article
columnheader
definition
directory
document
group
heading
img
list
listitem
math
note
presentation
region
row
rowheader
separator
Accessibility & Forms




<article role="article">
Accessibility & Forms
Accessibility & Forms




Structural roles
article
A section of a page that forms an independent part of a document, page, or site.
group
A set of user interface objects which are not intended to be included in a page summary
or table of contents by assistive technologies.
note
A section whose content is parenthetic or ancillary to the main content of the resource.
presentation
An element whose implicit native semantics will not be mapped to the accessibility API.
region
A large perceivable section of a web page or document, that the author feels is
important enough to be included in a page summary or table of contents.
separator
A divider that separates and distinguishes sections of content or groups of menu items.
Accessibility & Forms




Semantic comparison
       Ad-hoc             ARIA Role               HTML5

#header, #top      banner                header (kind of)


#main, #content    main                  none


#extra, .sidebar   complementary, note   aside


#footer, #bottom   contentinfo           footer


#nav               navigation            nav


.hentry            article               article
Accessibility & Forms




What is this!?
Accessibility & Forms




Widget roles
<span role="button">OK</span>
Accessibility & Forms




Widget roles
<span role="button">OK</span>

(of course <button>OK</button> would be better)
Accessibility & Forms




Widget roles
<span role="button">OK</span>

(of course <button>OK</button> would be better)


<div role="alert">
 <p>Something went wrong.</p>
</div>
Accessibility & Forms




Widget roles
<span role="button">OK</span>

(of course <button>OK</button> would be better)


<div role="alert">
 <p>Something went wrong.</p>
</div>


<div role="alertdialog">
 <p>Something went wrong.</p>
 <img src="x.png" alt="dismiss" role="button" />
</div>
Accessibility & Forms




Widget roles
alert             marquee            slider
alertdialog       menuitem           spinbutton
button            menuitemcheckbox   status
checkbox          menuitemradio      tab
combobox          option             tabpanel
dialog            progressbar        textbox
gridcell          radio              timer
link              radiogroup         tooltip
log               scrollbar          treeitem



Widget Container Roles
grid              menubar            tree
listbox           tablist            treegrid
menu              toolbar
Accessibility & Forms




Widget properties
aria-activedescendant   aria-multiline
aria-atomic             aria-multiselectable
aria-autocomplete       aria-orientation
aria-controls           aria-owns
aria-describedby        aria-posinset
aria-dropeffect         aria-readonly
aria-flowto             aria-relevant
aria-haspopup           aria-required
aria-label              aria-setsize
aria-labelledby         aria-sort
aria-level              aria-valuemax
aria-live               aria-valuemin
Accessibility & Forms




What’s going on!?
Accessibility & Forms




Widget states
                          B         B
                         (off)      (on)



<span>
 <img src="bold-off.png" alt="bold" />
</span>
<span>
 <img src="bold-on.png" alt="bold" />
</span>
Accessibility & Forms




Widget states
                          B         B
                         (off)      (on)



<span>
 <img src="bold-off.png" alt="not bold" />
</span>
<span>
 <img src="bold-on.png" alt="bold" />
</span>
Accessibility & Forms




Widget states
                          B         B
                         (off)      (on)



<span role="button" aria-pressed="false">
 <img src="bold-off.png" alt="not bold" />
</span>
<span role="button" aria-pressed="true">
 <img src="bold-on.png" alt="bold" />
</span>
Accessibility & Forms




Widget states
aria-busy
aria-checked
aria-disabled
aria-expanded
aria-grabbed
aria-hidden
aria-invalid
aria-pressed
aria-selected
aria-valuenow (the W3C defines this as a “property”)
aria-valuetext (ditto)
Accessibility & Forms




Highlighting living content
Accessibility & Forms




Live regions
Accessibility & Forms




Live regions




<input class="tweet-counter" value="140" disabled="disabled">
Accessibility & Forms




Live regions




<span id="chars_left_notice" class="numeric">
 <strong id="status-field-char-counter"
       class="char-counter">140</strong>
</span>
Accessibility & Forms




Live regions




<span class="tweet-counter">140
 <b class="hidden"> characters remaining</b></span>


.hidden {
  position: absolute;
  left: −999em;
}
Accessibility & Forms




Live regions




<span class="tweet-counter">maximum of 140 characters</span>



<span class="tweet-counter">140
 <b class="hidden"> characters remaining</b></span>
Accessibility & Forms




Live regions




<span aria-live="polite" aria-atomic="true"
      class="tweet-counter">140<b class="hidden">
      characters remaining</b></span>
Accessibility & Forms




Live regions
Accessibility & Forms




Notification options
off
change not announced

polite
change announced after user completes her current activity

assertive
user agent should interrupt the user’s activity, but not immediately
Accessibility & Forms




Who is Supporting WAI-ARIA?
Accessibility & Forms




For more
WAI-ARIA Spec
w3.org/TR/wai-aria/


WAI-ARIA Support in Browsers
paciellogroup.com/blog/aria-tests/ARIA-SafariaOperaIEFF.html
Accessibility & Forms




Fixing “broken” tables
Accessibility & Forms




HTML4 best practice
<table summary="Characteristics are given in the second column, with the negative
side in the left column and the positive side in the right column">
  <caption>Characteristics with positive and negative sides</caption>
  <thead>
    <tr>
      <th scope="col">Negative</th>
      <th scope="col">Characteristic</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Sad</td>
      <th scope="row">Mood</th>
      <td>Happy</td>
    </tr>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




HTML5 options
<p>In the following table, characteristics are given in the second
  column, with the negative side in the left column and the positive
  side in the right column.</p>
<table>
  <caption>Characteristics with positive and negative sides</caption>
  <thead>
    <tr>
      <th scope="col">Negative</th>
      <th scope="col">Characteristic</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




HTML5 options
<table>
  <caption>
    <strong>Characteristics with positive and negative sides.</strong>
    <p>Characteristics are given in the second column, with the
      negative side in the left column and the positive side in the right
      column.</p>
  </caption>
  <thead>
    <tr>
      <th scope="col">Negative</th>
      <th scope="col">Characteristic</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




HTML5 options
<table>
  <caption>
    <strong>Characteristics with positive and negative sides.</strong>
    <details>
      <summary>Help</summary>
      <p>Characteristics are given in the second column, with the
         negative side in the left column and the positive side in the right
         column.</p>
    </details>
  </caption>
  <thead>
    <tr>
      <th scope="col">Negative</th>
      <th scope="col">Characteristic</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




HTML5 options
<figure>
  <figcaption>Characteristics with positive and negative sides</figcaption>
  <p>Characteristics are given in the second column, with the
    negative side in the left column and the positive side in the right
    column.</p>
  <table>
    <thead>
      <tr>
         <th scope="col">Negative</th>
         <th scope="col">Characteristic</th>
         <th scope="col">Positive</th>
      </tr>
    </thead>
    <tbody>
      <!-- … -->
    </tbody>
  </table>
</figure>
Accessibility & Forms




HTML5 options
<table>
 <thead>
    <tr>
      <th scope="col">Characteristic</th>
      <th scope="col">Negative</th>
      <th scope="col">Positive</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">Mood</th>
      <td>Sad</td>
      <td>Happy</td>
    </tr>
    <!-- … -->
  </tbody>
</table>
Accessibility & Forms




More usable forms
Accessibility & Forms




Dates and times
<input type=”datetime”>
A UI control for selecting a date and time that includes timezone information.

<input type=”datetime-local”>
A UI control for selecting a date and time that does not include timezone information.

<input type=”date”>
A UI control for selecting a date with access to all date components
(day, month and year).

<input type=” month”>
A UI control for selecting a date that provides access to month and year only.

<input type=”time”>
A UI control for selecting a time that does not include timezone information.

<input type=”week”>
A UI control for selecting a date that provides access to week and year only.
Accessibility & Forms




Dates and times



             Safari




                                  Opera



<input type="date" name="dob"/>
Accessibility & Forms




Numbers
<input type=”number”>
A UI control for selecting a number.

<input type=”range”>
A UI control for selecting an imprecise number.
Accessibility & Forms




Numbers


<input type="number" name="foo"/>




<input type="range" min="1" max="11" name="foo"/>
Accessibility & Forms




New types
<input type=”email”>
A UI control for entering an email.

<input type=”url”>
A UI control for entering a URL.

<input type=”tel”>
A UI control for entering a telephone number.
Accessibility & Forms




New types




  <input type="email" …/>   <input type="url" …/>
Accessibility & Forms




New types
<input type=”search”>
A UI control for plain text editing of one or more search terms.




                    my search terms                         x
Accessibility & Forms




New types
<input type=”color”>
A UI control for selecting a color.


                        #EC4D0E
Accessibility & Forms




UI control attributes
autocomplete
Tells the User Agent whether or not the value should be stored.

autofocus
Tells the User Agent to bring focus to the form control on page load.

form
An id reference to the form to which a given control belongs.

required
Indicated the form control must be provided a value.

placeholder
Offers users a short hint about the required value.
Accessibility & Forms




Value control
min and max
Lower and upper boundary for an element value (dates, time, and numbers only).

step
The granularity of values allowed (dates, time, and numbers only).


 <input type="range" min="1" max="11" step="0.5" .../>
Accessibility & Forms




Value control
pattern
A regular expression pattern that the User Agent should validate the input against.

 <input type="text"
        pattern="d{6}w{3}"
        placeholder="6 digits followed by 3 letters"
        .../>
Accessibility & Forms




Value control
pattern
An id reference to a datalist element containing acceptable values.

 <input type="text" list="countries" name="country"/>
 <datalist id="countries">
  <option>Afghanistan</option>
  <option>Åland Islands</option>
  <!-- ... -->
 </datalist>
Accessibility & Forms




             Slides available at
  http://slideshare.net/AaronGustafson

     This presentation is licensed under
             Creative Commons
Attribution-Noncommercial-Share Alike 3.0

          flickr Photo Credits
          “HTML5 logo in Braille” by Ted Drake
         “Dual Samsung Monitors” by steve-uk
                “Statue of Liberty” by gadl
                   “Lego” by DavePress
            “iFlickr touch screen” by exfordy
               “Green Plant” by kevin1024

More Related Content

Similar to HTML5 Accessibility

Your Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages SuckYour Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages SuckAnthony Montalbano
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them All
David Yeiser
 
Building Dynamic Navigation in your Rails 4 Layout
Building Dynamic Navigation in your Rails 4 LayoutBuilding Dynamic Navigation in your Rails 4 Layout
Building Dynamic Navigation in your Rails 4 Layout
Alexander Miller
 
London React April- r3t & a11y : This is for everyone , Shaun Dunne.
London React April-  r3t & a11y : This is for everyone , Shaun Dunne.London React April-  r3t & a11y : This is for everyone , Shaun Dunne.
London React April- r3t & a11y : This is for everyone , Shaun Dunne.
React London Community
 
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Raj Lal
 
Ariane
ArianeAriane
Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)Joao Lucas Santana
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2James Pearce
 
An Introduction to WAI-ARIA
An Introduction to WAI-ARIAAn Introduction to WAI-ARIA
An Introduction to WAI-ARIA
IWMW
 
What are accessible names and why should you care?
What are accessible names and why should you care?What are accessible names and why should you care?
What are accessible names and why should you care?
Russ Weakley
 
Getting to Know Bootstrap for Rapid Web Development
Getting to Know Bootstrap for Rapid Web DevelopmentGetting to Know Bootstrap for Rapid Web Development
Getting to Know Bootstrap for Rapid Web Development
Laurence Svekis ✔
 
Rich Internet Applications - How to Make them Accessible
Rich Internet Applications - How to Make them AccessibleRich Internet Applications - How to Make them Accessible
Rich Internet Applications - How to Make them Accessible
Dylan Barrell
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
Marc Grabanski
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
Patrick Lauke
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
Patrick Lauke
 
Html 5, a gentle introduction
Html 5, a gentle introductionHtml 5, a gentle introduction
Html 5, a gentle introduction
Diego Scataglini
 
HTML5 Accessibility CSUN 2012
HTML5 Accessibility CSUN 2012HTML5 Accessibility CSUN 2012
HTML5 Accessibility CSUN 2012
Steven Faulkner
 
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
Felix Arntz
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf Platform
Alfresco Software
 

Similar to HTML5 Accessibility (20)

Your Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages SuckYour Custom WordPress Admin Pages Suck
Your Custom WordPress Admin Pages Suck
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them All
 
Building Dynamic Navigation in your Rails 4 Layout
Building Dynamic Navigation in your Rails 4 LayoutBuilding Dynamic Navigation in your Rails 4 Layout
Building Dynamic Navigation in your Rails 4 Layout
 
London React April- r3t & a11y : This is for everyone , Shaun Dunne.
London React April-  r3t & a11y : This is for everyone , Shaun Dunne.London React April-  r3t & a11y : This is for everyone , Shaun Dunne.
London React April- r3t & a11y : This is for everyone , Shaun Dunne.
 
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
 
Ariane
ArianeAriane
Ariane
 
Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
 
An Introduction to WAI-ARIA
An Introduction to WAI-ARIAAn Introduction to WAI-ARIA
An Introduction to WAI-ARIA
 
What are accessible names and why should you care?
What are accessible names and why should you care?What are accessible names and why should you care?
What are accessible names and why should you care?
 
Getting to Know Bootstrap for Rapid Web Development
Getting to Know Bootstrap for Rapid Web DevelopmentGetting to Know Bootstrap for Rapid Web Development
Getting to Know Bootstrap for Rapid Web Development
 
Rich Internet Applications - How to Make them Accessible
Rich Internet Applications - How to Make them AccessibleRich Internet Applications - How to Make them Accessible
Rich Internet Applications - How to Make them Accessible
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
WAI-ARIA An introduction to Accessible Rich Internet Applications / CSS Minsk...
 
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
WAI-ARIA An introduction to Accessible Rich Internet Applications / JavaScrip...
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 
Html 5, a gentle introduction
Html 5, a gentle introductionHtml 5, a gentle introduction
Html 5, a gentle introduction
 
HTML5 Accessibility CSUN 2012
HTML5 Accessibility CSUN 2012HTML5 Accessibility CSUN 2012
HTML5 Accessibility CSUN 2012
 
Introduction to Web Components
Introduction to Web ComponentsIntroduction to Web Components
Introduction to Web Components
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf Platform
 

More from Aaron Gustafson

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]
Aaron Gustafson
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]
Aaron Gustafson
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]
Aaron Gustafson
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Aaron Gustafson
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?
Aaron Gustafson
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]
Aaron Gustafson
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]
Aaron Gustafson
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]
Aaron Gustafson
 
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Aaron Gustafson
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]
Aaron Gustafson
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]
Aaron Gustafson
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]
Aaron Gustafson
 
Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]
Aaron Gustafson
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for Everyone
Aaron Gustafson
 
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]
Aaron Gustafson
 
Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]
Aaron Gustafson
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2
Aaron Gustafson
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1
Aaron Gustafson
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]
Aaron Gustafson
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]
Aaron Gustafson
 

More from Aaron Gustafson (20)

Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]Delivering Critical Information and Services [JavaScript & Friends 2021]
Delivering Critical Information and Services [JavaScript & Friends 2021]
 
Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]Adapting to Reality [Guest Lecture, March 2021]
Adapting to Reality [Guest Lecture, March 2021]
 
Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]Designing the Conversation [Beyond Tellerrand 2019]
Designing the Conversation [Beyond Tellerrand 2019]
 
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
Getting Started with Progressive Web Apps [Beyond Tellerrand 2019]
 
Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?Progressive Web Apps: Where Do I Begin?
Progressive Web Apps: Where Do I Begin?
 
Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]Media in the Age of PWAs [ImageCon 2019]
Media in the Age of PWAs [ImageCon 2019]
 
Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]Adapting to Reality [Starbucks Lunch & Learn]
Adapting to Reality [Starbucks Lunch & Learn]
 
Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]Conversational Semantics for the Web [CascadiaJS 2018]
Conversational Semantics for the Web [CascadiaJS 2018]
 
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]Better Performance === Greater Accessibility [Inclusive Design 24 2018]
Better Performance === Greater Accessibility [Inclusive Design 24 2018]
 
PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]PWA: Where Do I Begin? [Microsoft Ignite 2018]
PWA: Where Do I Begin? [Microsoft Ignite 2018]
 
Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]Designing the Conversation [Concatenate 2018]
Designing the Conversation [Concatenate 2018]
 
Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]Designing the Conversation [Accessibility DC 2018]
Designing the Conversation [Accessibility DC 2018]
 
Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]Performance as User Experience [AEADC 2018]
Performance as User Experience [AEADC 2018]
 
The Web Should Just Work for Everyone
The Web Should Just Work for EveryoneThe Web Should Just Work for Everyone
The Web Should Just Work for Everyone
 
Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]Performance as User Experience [AEA SEA 2018]
Performance as User Experience [AEA SEA 2018]
 
Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]Performance as User Experience [An Event Apart Denver 2017]
Performance as User Experience [An Event Apart Denver 2017]
 
Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2Advanced Design Methods 1, Day 2
Advanced Design Methods 1, Day 2
 
Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1Advanced Design Methods 1, Day 1
Advanced Design Methods 1, Day 1
 
Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]Designing the Conversation [Paris Web 2017]
Designing the Conversation [Paris Web 2017]
 
Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]Exploring Adaptive Interfaces [Generate 2017]
Exploring Adaptive Interfaces [Generate 2017]
 

HTML5 Accessibility

  • 1. Accessibility &Forms in HTML5 Aaron Gustafson Easy Designs, LLC slideshare.net/AaronGustafson
  • 3. Accessibility & Forms ARIA maps the OS to the web
  • 5. Accessibility & Forms Landmarks help users navigate quickly
  • 6. Accessibility & Forms All the site’s a play... The role attribute Defines the part an element is playing (assuming it’s different than the semantics would otherwise imply). <section id="main" role="main"> <!-- The primary content for the page would go here --> </section>
  • 9. Accessibility & Forms <nav role="navigation">
  • 10. Accessibility & Forms <form role="search">
  • 13. Accessibility & Forms <footer role="contentinfo">
  • 14. Accessibility & Forms <nav role="navigation">
  • 16. Accessibility & Forms <aside role="complementary">
  • 17. Accessibility & Forms Landmark roles application A region of the page representing a unique software unit executing a set of tasks for its users. It is an area where assistive technologies should also return browse navigation keys back over to the web application in this region. banner A region that contains the prime heading or internal title of a page. complementary A supporting section of the document that remains meaningful even when separated from the main content. contentinfo Metadata that applies to the parent document. form A region of the document that represents a collection of form-associated elements. main navigation search
  • 18. Accessibility & Forms Landmark roles main The main content of a document. navigation A collection of navigational elements (usually links) for navigating the document or related documents. search The search tool of a web document.
  • 19. Accessibility & Forms Structural roles article columnheader definition directory document group heading img list listitem math note presentation region row rowheader separator
  • 22. Accessibility & Forms Structural roles article A section of a page that forms an independent part of a document, page, or site. group A set of user interface objects which are not intended to be included in a page summary or table of contents by assistive technologies. note A section whose content is parenthetic or ancillary to the main content of the resource. presentation An element whose implicit native semantics will not be mapped to the accessibility API. region A large perceivable section of a web page or document, that the author feels is important enough to be included in a page summary or table of contents. separator A divider that separates and distinguishes sections of content or groups of menu items.
  • 23. Accessibility & Forms Semantic comparison Ad-hoc ARIA Role HTML5 #header, #top banner header (kind of) #main, #content main none #extra, .sidebar complementary, note aside #footer, #bottom contentinfo footer #nav navigation nav .hentry article article
  • 25. Accessibility & Forms Widget roles <span role="button">OK</span>
  • 26. Accessibility & Forms Widget roles <span role="button">OK</span> (of course <button>OK</button> would be better)
  • 27. Accessibility & Forms Widget roles <span role="button">OK</span> (of course <button>OK</button> would be better) <div role="alert"> <p>Something went wrong.</p> </div>
  • 28. Accessibility & Forms Widget roles <span role="button">OK</span> (of course <button>OK</button> would be better) <div role="alert"> <p>Something went wrong.</p> </div> <div role="alertdialog"> <p>Something went wrong.</p> <img src="x.png" alt="dismiss" role="button" /> </div>
  • 29. Accessibility & Forms Widget roles alert marquee slider alertdialog menuitem spinbutton button menuitemcheckbox status checkbox menuitemradio tab combobox option tabpanel dialog progressbar textbox gridcell radio timer link radiogroup tooltip log scrollbar treeitem Widget Container Roles grid menubar tree listbox tablist treegrid menu toolbar
  • 30. Accessibility & Forms Widget properties aria-activedescendant aria-multiline aria-atomic aria-multiselectable aria-autocomplete aria-orientation aria-controls aria-owns aria-describedby aria-posinset aria-dropeffect aria-readonly aria-flowto aria-relevant aria-haspopup aria-required aria-label aria-setsize aria-labelledby aria-sort aria-level aria-valuemax aria-live aria-valuemin
  • 32. Accessibility & Forms Widget states B B (off) (on) <span> <img src="bold-off.png" alt="bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 33. Accessibility & Forms Widget states B B (off) (on) <span> <img src="bold-off.png" alt="not bold" /> </span> <span> <img src="bold-on.png" alt="bold" /> </span>
  • 34. Accessibility & Forms Widget states B B (off) (on) <span role="button" aria-pressed="false"> <img src="bold-off.png" alt="not bold" /> </span> <span role="button" aria-pressed="true"> <img src="bold-on.png" alt="bold" /> </span>
  • 35. Accessibility & Forms Widget states aria-busy aria-checked aria-disabled aria-expanded aria-grabbed aria-hidden aria-invalid aria-pressed aria-selected aria-valuenow (the W3C defines this as a “property”) aria-valuetext (ditto)
  • 38. Accessibility & Forms Live regions <input class="tweet-counter" value="140" disabled="disabled">
  • 39. Accessibility & Forms Live regions <span id="chars_left_notice" class="numeric"> <strong id="status-field-char-counter" class="char-counter">140</strong> </span>
  • 40. Accessibility & Forms Live regions <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span> .hidden { position: absolute; left: −999em; }
  • 41. Accessibility & Forms Live regions <span class="tweet-counter">maximum of 140 characters</span> <span class="tweet-counter">140 <b class="hidden"> characters remaining</b></span>
  • 42. Accessibility & Forms Live regions <span aria-live="polite" aria-atomic="true" class="tweet-counter">140<b class="hidden"> characters remaining</b></span>
  • 44. Accessibility & Forms Notification options off change not announced polite change announced after user completes her current activity assertive user agent should interrupt the user’s activity, but not immediately
  • 45. Accessibility & Forms Who is Supporting WAI-ARIA?
  • 46. Accessibility & Forms For more WAI-ARIA Spec w3.org/TR/wai-aria/ WAI-ARIA Support in Browsers paciellogroup.com/blog/aria-tests/ARIA-SafariaOperaIEFF.html
  • 47. Accessibility & Forms Fixing “broken” tables
  • 48. Accessibility & Forms HTML4 best practice <table summary="Characteristics are given in the second column, with the negative side in the left column and the positive side in the right column"> <caption>Characteristics with positive and negative sides</caption> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <tr> <td>Sad</td> <th scope="row">Mood</th> <td>Happy</td> </tr> <!-- … --> </tbody> </table>
  • 49. Accessibility & Forms HTML5 options <p>In the following table, characteristics are given in the second column, with the negative side in the left column and the positive side in the right column.</p> <table> <caption>Characteristics with positive and negative sides</caption> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <!-- … --> </tbody> </table>
  • 50. Accessibility & Forms HTML5 options <table> <caption> <strong>Characteristics with positive and negative sides.</strong> <p>Characteristics are given in the second column, with the negative side in the left column and the positive side in the right column.</p> </caption> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <!-- … --> </tbody> </table>
  • 51. Accessibility & Forms HTML5 options <table> <caption> <strong>Characteristics with positive and negative sides.</strong> <details> <summary>Help</summary> <p>Characteristics are given in the second column, with the negative side in the left column and the positive side in the right column.</p> </details> </caption> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <!-- … --> </tbody> </table>
  • 52. Accessibility & Forms HTML5 options <figure> <figcaption>Characteristics with positive and negative sides</figcaption> <p>Characteristics are given in the second column, with the negative side in the left column and the positive side in the right column.</p> <table> <thead> <tr> <th scope="col">Negative</th> <th scope="col">Characteristic</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <!-- … --> </tbody> </table> </figure>
  • 53. Accessibility & Forms HTML5 options <table> <thead> <tr> <th scope="col">Characteristic</th> <th scope="col">Negative</th> <th scope="col">Positive</th> </tr> </thead> <tbody> <tr> <th scope="row">Mood</th> <td>Sad</td> <td>Happy</td> </tr> <!-- … --> </tbody> </table>
  • 55. Accessibility & Forms Dates and times <input type=”datetime”> A UI control for selecting a date and time that includes timezone information. <input type=”datetime-local”> A UI control for selecting a date and time that does not include timezone information. <input type=”date”> A UI control for selecting a date with access to all date components (day, month and year). <input type=” month”> A UI control for selecting a date that provides access to month and year only. <input type=”time”> A UI control for selecting a time that does not include timezone information. <input type=”week”> A UI control for selecting a date that provides access to week and year only.
  • 56. Accessibility & Forms Dates and times Safari Opera <input type="date" name="dob"/>
  • 57. Accessibility & Forms Numbers <input type=”number”> A UI control for selecting a number. <input type=”range”> A UI control for selecting an imprecise number.
  • 58. Accessibility & Forms Numbers <input type="number" name="foo"/> <input type="range" min="1" max="11" name="foo"/>
  • 59. Accessibility & Forms New types <input type=”email”> A UI control for entering an email. <input type=”url”> A UI control for entering a URL. <input type=”tel”> A UI control for entering a telephone number.
  • 60. Accessibility & Forms New types <input type="email" …/> <input type="url" …/>
  • 61. Accessibility & Forms New types <input type=”search”> A UI control for plain text editing of one or more search terms. my search terms x
  • 62. Accessibility & Forms New types <input type=”color”> A UI control for selecting a color. #EC4D0E
  • 63. Accessibility & Forms UI control attributes autocomplete Tells the User Agent whether or not the value should be stored. autofocus Tells the User Agent to bring focus to the form control on page load. form An id reference to the form to which a given control belongs. required Indicated the form control must be provided a value. placeholder Offers users a short hint about the required value.
  • 64. Accessibility & Forms Value control min and max Lower and upper boundary for an element value (dates, time, and numbers only). step The granularity of values allowed (dates, time, and numbers only). <input type="range" min="1" max="11" step="0.5" .../>
  • 65. Accessibility & Forms Value control pattern A regular expression pattern that the User Agent should validate the input against. <input type="text" pattern="d{6}w{3}" placeholder="6 digits followed by 3 letters" .../>
  • 66. Accessibility & Forms Value control pattern An id reference to a datalist element containing acceptable values. <input type="text" list="countries" name="country"/> <datalist id="countries"> <option>Afghanistan</option> <option>Åland Islands</option> <!-- ... --> </datalist>
  • 67. Accessibility & Forms Slides available at http://slideshare.net/AaronGustafson This presentation is licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 flickr Photo Credits “HTML5 logo in Braille” by Ted Drake “Dual Samsung Monitors” by steve-uk “Statue of Liberty” by gadl “Lego” by DavePress “iFlickr touch screen” by exfordy “Green Plant” by kevin1024