Accessibility of Rich Internet Applications (Afternoon Session)<br />Hans Hillen (TPG)<br />Steve Faulkner (TPG)<br />1<br...
HTML5 accessibility<br />New Solutions<br />New Problems<br />
Accessible HTML5<br />will be a beautiful thing<br />
Current support for HTML5 accessibility<br />What is meant by support?<br />Features provided<br />Features implemented<br...
What is meant by support?<br />Features are implemented in browsers<br />Useful site - When can I use...<br />Does not mea...
the <video> element<br />No major browser has full accessibility support for HTML5 video<br />Providing full accessibility...
the <video> element<br />All major browser now support HTML5 video<br />Meaning you can watch/hear a video and use the con...
the <video> element<br />Terril Thompson:<br />“That all sounds like a lot of work. Isn't HTML5 <video> supposed to be eas...
Example the <canvas> element<br />All major browser now support HTML5 canvas<br />Meaning dynamic images, animation, games...
Example the <canvas> element<br />Only one major browser supports HTML5 canvas accessibility<br />And only partially<br />
Example the <canvas> element<br />The accessibility features of canvas are still being specified.<br />What is implemented...
Accessible implementation<br />What’s it mean?<br />Conveys semantics required to understand and interact.<br />Can be use...
The humble button<br />Accessibility API<br />Input device<br />browser<br />role=button<br />state=focused<br />value= se...
Accessibility APIs<br />MSAA<br />Iaccessible2<br />UI automation<br />AX<br />STK<br />roles<br />states<br />properties<...
A tool to look under the hood<br />MSAA inspect.32.exe or inspect.exe<br />
Another tool to look under the hood<br />Aviewer<br />
The humble button<br />Accessibility features for a button a whirlwind tour<br />
New HTML5 form controls<br />When implemented and implemented accessibly, will make it a lot easier to provide accessible ...
Placeholder attribute<br />Minor addition to HTML5<br />Yet brings new headaches for developers and users<br />Poor contra...
ARIA landmark roles vs HTML5 section elements<br />ARIA defines roles that act as landmarks for intra page navigation and ...
Section elements and landmarks<br />Examples of use<br />Bruce Lawson’s site<br />Wordpress<br />Mappings between section ...
ARIA Landmark Roles<br />Landmark roles identify important sections commonly found in web pages:<br />Applied to container...
ARIA Landmark Roles<br /><ul><li>Available Landmark Roles
Banner: A region that contains the primary heading or web site title. (site logo, login details, etc.)
Search: The search tool of a web document.
Navigation: The documents Navigation menus and links.
Main: The main content of web document.
Form: contains a collection of items and objects that, as a whole, combine to create a form.
Complementary: content that has meaning outside the page as well (e.g. a sidebar with related articles).
Contentinfo: Metadata that applies to the parent document (e.g. copy right disclaimers, company info).
Application: See next slide.</li></ul>Using WAI ARIA Landmark Roles<br />
Aria Landmark Roles: Role=“Application”<br />Normally, Screen readers browse in ‘virtual mode’<br />Screen reader navigate...
Application Role vs. Document Role<br />Some parts of your application may actually be treated as a document rather than a...
HTML5 Accessibility information<br />HTML5Accessibility.com<br />
Implementing ARIA Solutions<br />Practical examples<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applic...
Recap: How to Apply ARIA<br />Start with HTML elements<br />Any HTML element can be extended with ARIA. Examples:<br /><ul...
<div role=“tab”></li></ul>Add state /properties attributes if applicable.<br />A single elements can have one or more stat...
<div role=“button” aria-pressed=“true” aria-disabled=“true”></li></ul>Attribute names always start with ‘aria-’<br />03 / ...
ARIA: Important Notes<br /><ul><li>ARIA doesn’t change anything to your widget:</li></ul>It only provides semantic informa...
Role values generally stay the same, state values can change	</li></ul>Trough user input (event handlers), <br />elem.setA...
Focus and Keyboard Accessibility<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<...
Focus & Keyboard Accessibility<br />To be accessible, ARIA input widgets need focus<br />Use natively focusable elements, ...
Focus & Keyboard Accessibility (2)<br /><ul><li>Every Widget must be operable by keyboard
Create you own event handlers to manage
For composite widgets (trees, menus, etc.) individual parts can be reached using other keys, such as:
Arrow keys
Home, End, PgUp, PgDn
Enter, Space
Keep in mind: how would I navigate this widget in a desktop environment?
Mouse based actions must also be available through the keyboard. For example:
Write Key handlers trigger the same results mouse events
Use context menus to make relevant options accessible.</li></ul>03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet...
Expected Widget Behavior<br />Not sure about how a widget should behave with the keyboard?<br />Use the DHTML Style Guide:...
Managing Interwidget Navigation<br />Make sure that all widgets are reachable through keyboard<br />Depend on Tab order (d...
Skipping Mechanisms<br /><ul><li>The ability to skip content is crucial for both screen reader and keyboard users
Skip links are out of date, out of fashion and often is misused
Better alternatives for skipping:</li></ul>Collapsible sections<br />Consistent shortcuts (e.g. a shortcut that moves focu...
Popup Dialogs and Windows<br /><ul><li>More and more web apps use HTML based popup dialogs rather than actual browser wind...
If dialog supports moving or resizing, these features must be keyboard accessible
Support closing dialogs using Enter (OK) or Escape (Cancel) keys</li></ul>Focus should be placed back on a logical element...
Selection & Editing<br />Trees, Lists, Grids can support single or multiple selection<br />Multiple selection must be keyb...
Forms & ARIA<br /><ul><li>You can used ARIA to make your form validation easier to manage.</li></ul>aria-required & aria-i...
Advanced ARIA Implementation Techniques<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSU...
Upcoming SlideShare
Loading in …5
×

Accessible web applications

3,312 views

Published on

accessible web application workshop slides presented at CSUN 2011 by Hans Hillen and Steve Faulkner from The Paciello Group (TPG)

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,312
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
34
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • With accessibility support HTML5 will become a powerful, useful, interoperable, versatile language for the world wide web.
  • Each HTML feature has a role, name, state and other property values that need to be hooked into the accessibility APIs by the browser. Assistive technology can then use this information to convey a representation of the feature to users.
  • For users of assistive technology to be able to access and interact with web content, browser developers need to expose HTML5 features through accessibility applications interfaces and make interactive features operable without the use of a mouse.
  • This site is a resource to provide information about which HTML5user interface features are accessibility supported in browsers, making them usable by people who rely upon assistive technology (AT) to use the web.It is not intended to dissuade developers from using HTML5 features. Sometimes there are better choices, sometimes developers have to add a little extra to make the feature useful or usable, and other times features have simply not been implemented by any browser or only by browsers that do not yet support assistive technologies. As a consequence it may not yet be practical to use a particular HTML5 feature. Example work around for lack of implementation or lack of accessible implementation are are provided.
  • Demos:Bad treeGood Tree
  • Demo: Slider
  • Jquery Demo (collapsible sections)GXT Focus Manager
  • GXT Focus Manager demo (open window under &quot;Window&quot; tab)
  • Basic GridGridrow editor
  • Validation sample
  • CA example
  • Jquery dialog example
  • Stock sample
  • ARIA grid fix example
  • Accessible web applications

    1. 1. Accessibility of Rich Internet Applications (Afternoon Session)<br />Hans Hillen (TPG)<br />Steve Faulkner (TPG)<br />1<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />
    2. 2. HTML5 accessibility<br />New Solutions<br />New Problems<br />
    3. 3. Accessible HTML5<br />will be a beautiful thing<br />
    4. 4. Current support for HTML5 accessibility<br />What is meant by support?<br />Features provided<br />Features implemented<br />Features implemented with accessibility support<br />In Browsers<br />In Assistive Technology<br />
    5. 5. What is meant by support?<br />Features are implemented in browsers<br />Useful site - When can I use...<br />Does not mean features are usable by all users even if they use a browser that ‘supports’ a feature.<br />Firefox video support<br />
    6. 6. the <video> element<br />No major browser has full accessibility support for HTML5 video<br />Providing full accessibility support means jumping through hoops:<br />Scripted controls<br />Scripted captioning and audio description<br />
    7. 7. the <video> element<br />All major browser now support HTML5 video<br />Meaning you can watch/hear a video and use the controls if you can see, hear and use a mouse<br />
    8. 8. the <video> element<br />Terril Thompson:<br />“That all sounds like a lot of work. Isn't HTML5 <video> supposed to be easy?”<br />“Ultimately though ... HTML5 <video> is easy. A novice web developer can pop a video onto their web page in less than a minute with some very simple HTML markup. Unfortunately if they do that today it won't be accessible without a little additional sweat. Someday, hopefully, browsers will do all of this work for us, and every video will be accessible. That's what we're working toward.”<br />
    9. 9. Example the <canvas> element<br />All major browser now support HTML5 canvas<br />Meaning dynamic images, animation, games and content is available without plug-ins<br />
    10. 10. Example the <canvas> element<br />Only one major browser supports HTML5 canvas accessibility<br />And only partially<br />
    11. 11. Example the <canvas> element<br />The accessibility features of canvas are still being specified.<br />What is implemented in IE9 gives an idea of how canvas accessibility will work.<br />Example<br />
    12. 12. Accessible implementation<br />What’s it mean?<br />Conveys semantics required to understand and interact.<br />Can be used in a device independent way<br />Uses common design patterns<br />Accomodates browser & OS accessibility features<br />interoperable<br />
    13. 13. The humble button<br />Accessibility API<br />Input device<br />browser<br />role=button<br />state=focused<br />value= search<br />action=press<br />
    14. 14. Accessibility APIs<br />MSAA<br />Iaccessible2<br />UI automation<br />AX<br />STK<br />roles<br />states<br />properties<br />interaction<br />+ device independent<br />interaction<br />
    15. 15. A tool to look under the hood<br />MSAA inspect.32.exe or inspect.exe<br />
    16. 16. Another tool to look under the hood<br />Aviewer<br />
    17. 17. The humble button<br />Accessibility features for a button a whirlwind tour<br />
    18. 18. New HTML5 form controls<br />When implemented and implemented accessibly, will make it a lot easier to provide accessible UI’s<br />Current implementation is patchy and where implemented, accessibility support is poor.<br />Lets take a quick tour: HTML5 form controls<br />
    19. 19. Placeholder attribute<br />Minor addition to HTML5<br />Yet brings new headaches for developers and users<br />Poor contrast<br />disappears<br />Results in different accessible labels across browsers and labelling methods<br />HTML5 Accessibility Chops: the placeholder attribute<br />
    20. 20. ARIA landmark roles vs HTML5 section elements<br />ARIA defines roles that act as landmarks for intra page navigation and identification of common content areas<br />HTML5 defines section elements for common semantic features of pages, some old some new<br />There is some overlap<br />HTML5 section elements are largely unimplemented (accessible).<br />FireFox has some experimental implementation<br />
    21. 21. Section elements and landmarks<br />Examples of use<br />Bruce Lawson’s site<br />Wordpress<br />Mappings between section elements and landmark roles: <br />HTML5 Accessibility Chops: section elements<br />
    22. 22. ARIA Landmark Roles<br />Landmark roles identify important sections commonly found in web pages:<br />Applied to container elements<br />Allow AT users to quickly see which sections a page has and navigate to individual sections <br />In JAWS, use the following commands:<br />; (semicolon):jump to next landmark<br />Shift + ;(semicolon): jump to previous landmark<br />Ctrl + Ins + ;(semicolon): Show list of available landmarks <br />In NVDA use<br />D to jump to next landmark<br />Shift + D to previous landmark<br />NVDA+f7 Show list of available landmarks <br />
    23. 23. ARIA Landmark Roles<br /><ul><li>Available Landmark Roles
    24. 24. Banner: A region that contains the primary heading or web site title. (site logo, login details, etc.)
    25. 25. Search: The search tool of a web document.
    26. 26. Navigation: The documents Navigation menus and links.
    27. 27. Main: The main content of web document.
    28. 28. Form: contains a collection of items and objects that, as a whole, combine to create a form.
    29. 29. Complementary: content that has meaning outside the page as well (e.g. a sidebar with related articles).
    30. 30. Contentinfo: Metadata that applies to the parent document (e.g. copy right disclaimers, company info).
    31. 31. Application: See next slide.</li></ul>Using WAI ARIA Landmark Roles<br />
    32. 32. Aria Landmark Roles: Role=“Application”<br />Normally, Screen readers browse in ‘virtual mode’<br />Screen reader navigates a virtual copy of the web page.<br />Screen reader intercepts all keystrokes, and uses them for its own virtual navigation (e.g. ‘H’ for heading navigation).<br />For dynamic web apps, virtual mode may need to be turned off<br />Interactive widgets need the keystrokes themselves.<br />Content needs to be live, not a virtual copy.<br />Normally, the user had to switch manually between virtual an non-virtual mode.<br />role=“application”<br />When applied a container element the screen reader will automatically switch to non virtual mode.<br />
    33. 33. Application Role vs. Document Role<br />Some parts of your application may actually be treated as a document rather than application UI. For example:<br />A web based email client has panes in which messages are read or created.<br />A blog viewer web application can load articles to read.<br />In these parts, the screen reader user needs virtual mode:<br />To make use of the special navigation that comes with it. <br />To be able to read non focusable content<br />role=“document”<br />When applied to a container inside an application role, the screen reader will switch back to virtual mode.<br />Allows documents to be read or edited inside a web app.<br />
    34. 34. HTML5 Accessibility information<br />HTML5Accessibility.com<br />
    35. 35. Implementing ARIA Solutions<br />Practical examples<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />27<br />
    36. 36. Recap: How to Apply ARIA<br />Start with HTML elements<br />Any HTML element can be extended with ARIA. Examples:<br /><ul><li><span>, <div>, <table>, <td>, <ul>, <li>, <p>, <img> </li></ul>Add a ‘role’ attribute.<br />Only one role is allowed per element, <br /><ul><li><span role=“checkbox”>
    37. 37. <div role=“tab”></li></ul>Add state /properties attributes if applicable.<br />A single elements can have one or more states<br /><ul><li><span role=“checkbox” aria-checked=“true”>
    38. 38. <div role=“button” aria-pressed=“true” aria-disabled=“true”></li></ul>Attribute names always start with ‘aria-’<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />28<br />
    39. 39. ARIA: Important Notes<br /><ul><li>ARIA doesn’t change anything to your widget:</li></ul>It only provides semantic information for AT<br />Behavior and styles still need to be provided by developer<br /><ul><li>Some HTML elements already have a default, ‘native’ role.</li></ul>e.g. <td> (role = ‘cell’), <a> (role=“link”), <input>, <li><br />Native role is always overridden by ARIA role<br /><ul><li>E.g. <table role=“tab”> is announced as a tab by a screen reader rather than a table
    40. 40. Role values generally stay the same, state values can change </li></ul>Trough user input (event handlers), <br />elem.setAttribute(‘aria-selected’, ‘false’);<br /><ul><li>Some roles have required state attributes</li></ul>E.g. A ‘radio’ role requires the ‘aria-checked’ state<br /><ul><li>Requirements for an ‘ARIA ready’ widget: Focusable & Keyboard Accessible!</li></ul>03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />29<br />
    41. 41. Focus and Keyboard Accessibility<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />30<br />
    42. 42. Focus & Keyboard Accessibility<br />To be accessible, ARIA input widgets need focus<br />Use natively focusable elements, such as <a>, <input />, etc<br />Add ‘tabindex’ attribute for non focusable elements, such as <span>, <div>, etc.<br />Tabindex=“0”: Element becomes part of the tab order<br />Tabindex=“-1” (Element is not in tab order, but focusable)<br />For composite widgets (menus, trees, grids, etc.):<br />Every widget should only have 1 stop in the tab order.<br />Keep track where your widget’s current tab stop is:<br />Alternative for tabindex: ‘aria-activedescendant=“<idref>”<br />Focus remains on outer container<br />AT perceives element with the specified ID as being focused.<br />You must manually highlight this active element, e.g. With CSS<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />31<br />
    43. 43. Focus & Keyboard Accessibility (2)<br /><ul><li>Every Widget must be operable by keyboard
    44. 44. Create you own event handlers to manage
    45. 45. For composite widgets (trees, menus, etc.) individual parts can be reached using other keys, such as:
    46. 46. Arrow keys
    47. 47. Home, End, PgUp, PgDn
    48. 48. Enter, Space
    49. 49. Keep in mind: how would I navigate this widget in a desktop environment?
    50. 50. Mouse based actions must also be available through the keyboard. For example:
    51. 51. Write Key handlers trigger the same results mouse events
    52. 52. Use context menus to make relevant options accessible.</li></ul>03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />32<br />
    53. 53. Expected Widget Behavior<br />Not sure about how a widget should behave with the keyboard?<br />Use the DHTML Style Guide:<br />http://dev.aol.com/dhtml_style_guide<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />33<br />
    54. 54. Managing Interwidget Navigation<br />Make sure that all widgets are reachable through keyboard<br />Depend on Tab order (default or custom?)<br />Support global keyboard shortcuts<br />How do you notify your users?<br />Implementing a custom focus manager<br />Might be best solution for very complex UI's<br />Let go of the traditional tab order idea ("all focusable elements must be reachable by tab order")<br />Provide intuitive skipping mechanisms<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />34<br />
    55. 55. Skipping Mechanisms<br /><ul><li>The ability to skip content is crucial for both screen reader and keyboard users
    56. 56. Skip links are out of date, out of fashion and often is misused
    57. 57. Better alternatives for skipping:</li></ul>Collapsible sections<br />Consistent shortcuts (e.g. a shortcut that moves focus between panes and dialogs)<br />Custom focus manager that allows the user to move focus into a container to skip its contents <br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />35<br />
    58. 58. Popup Dialogs and Windows<br /><ul><li>More and more web apps use HTML based popup dialogs rather than actual browser windows/dialogs</li></ul>Get a screen reader to perceive it properly using role="dialog"<br /><ul><li>Dialogs should have their own tab order</li></ul>Focus should "wrap"<br /><ul><li>For modal dialogs, it should not be possible to interact with the main page </li></ul>Prevent keyboard access<br />Virtual mode access can't be prevented<br /><ul><li>For non modal dialogs, provide shortcut to switch between dialog and main page
    59. 59. If dialog supports moving or resizing, these features must be keyboard accessible
    60. 60. Support closing dialogs using Enter (OK) or Escape (Cancel) keys</li></ul>Focus should be placed back on a logical element, e.g. the button that triggered the dialog.<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />36<br />
    61. 61. Selection & Editing<br />Trees, Lists, Grids can support single or multiple selection<br />Multiple selection must be keyboard accessible, for example: <br />Shift + arrow keys: contiguous selection<br />Ctrl + arrow keys: move focus without selection<br />Ctrl + space: Toggle focused item in selection (discontiguous selection)<br />Editable grids need to support switching to edit mode by keyboard<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />37<br />
    62. 62. Forms & ARIA<br /><ul><li>You can used ARIA to make your form validation easier to manage.</li></ul>aria-required & aria-invalid states<br />Role="alert" to flag validation errors immediately<br /><ul><li>Use validation summaries with links to make invalid entries easier to find</li></ul>Role="alertdialog" to mark up the summary<br /><ul><li>Visual tooltips: Useful for validation messages and formatting instructions</li></ul>Tooltips must be keyboard accessible <br />Tooltip text must be associated with the form control using aria-describedby<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />38<br />
    63. 63. Advanced ARIA Implementation Techniques<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />39<br />
    64. 64. Labeling And Describing Widgets<br /><ul><li>Every widget need some kind of ‘identity’, or ‘label’ that AT can use to announce it to the user:
    65. 65. Singular interactive widgets, e.g. button, checkbox
    66. 66. Composite widgets, such as trees or toolbars:
    67. 67. Requires both a label for the widget as a whole and its individual parts
    68. 68. Container widgets:
    69. 69. A window or Pane requires a title
    70. 70. To label ARIA widgets:
    71. 71. You could use standard HTML labeling techniques:
    72. 72. Label element and title attributes.
    73. 73. Or: Aria-labelledby, aria-label, & aria-describedby</li></ul>03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />40<br />
    74. 74. Labeling And Describing Widgets (2)<br /><ul><li>Aria-labelledby=“IDREFS”
    75. 75. Value is one or more IDs of elements that identifiy the widget.
    76. 76. The elements ‘aria-labelledby’ targets can be any kind of text based element, anywhere in the document.
    77. 77. Add multiple Ids to concatinate label text:
    78. 78. Multiple elements can label one widget, and one element can label multiple widgets. (example)
    79. 79. Aria-describedby=“IDREFS”
    80. 80. Similar to labelledby, except used for additional description, e.g. Form hints, instructions, etc.
    81. 81. Aria-label
    82. 82. Simply takes a string to be used as label.
    83. 83. Quick and dirty way of making the screen reader say what you want.
    84. 84. Very easy to use, but only supported in Firefox at the moment. </li></ul><h2 id=“treeLbl”>My Folders</h2><br /><p class=“hidden”>Each tree item has a context menu with more options</p><br /><div role=“tree” aria-labelledby=“treeLbl” aria-describedby=“treeDesc”><br />...<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />41<br />
    85. 85. Labeling containers<br />Containers such as toolbars, dialogs, and regions provide context for their contents<br />When the user moves focus into the container, the screen reader should first announce the container before announcing the focused control<br /><div role="dialog" aria-labelledby="dialogTitle" aria-describedby="dialogDescription"><br /> <h2 id="dialogTitle">Confirm</h2><br /> <p id="dialogDescription"><br /> Are you sure you want to do that?<br /> </p><br /> <button>Yes</button> <br /> <button>No</button><br /></div><br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />42<br />
    86. 86. ARIA Live Regions<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />43<br />
    87. 87. What are Live Regions?<br />Live regions <br />Parts of a Web page that the author expects to change and where new information maybe added updated or removed.<br />Examples of live regions: <br />Status updates <br />Changing stock information<br />Chat windows<br />Log windows (chat transcript logs), <br />notification areas (status, alerts)<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />44<br />
    88. 88. What are Live Regions? (2)<br /><ul><li>Live regions enable assistive technologies (such as screen readers) to inform users of updates.
    89. 89. Without live regions, AT users may not be aware that content elsewhere on the page has changed.</li></ul>Users miss out on relevant info<br />Users have to ‘search’ for updated page content<br /><ul><li>With live regions, updated information is announced automatically.
    90. 90. Example: stock updater</li></ul>03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />45<br />
    91. 91. Live Region Properties and How to Use Them<br />To identify a live region, add the aria-live attribute.<br />One of the most important concepts behind live regions is politeness. <br />Politeness indicates how much priority a live region has. <br />The following politeness values are available for aria-live: off, polite, and assertive.<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />46<br />
    92. 92. Live Regions: Politeness Levels<br /><ul><li>Aria-live="off"</li></ul>Default value, identical to not setting aria-live. Examples:<br /><ul><li>A DHTML clock
    93. 93. Number of users currently online
    94. 94. Aria-live=“polite” </li></ul>Updates are announced but won’t interrupt the user<br />Should be used in most situations involving live regions that present new information to users:<br /><ul><li>Updates to news headlines, twitter alerts, monitored stocks, etc.
    95. 95. Aria-live=“assertive”</li></ul>Updates are announced and interrupt what the user is doing<br /><ul><li>Only use for important updates that require immediate attention.
    96. 96. Warnings & error notifications.
    97. 97. Session timeout notifications</li></ul>03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />47<br />
    98. 98. Live Regions: Other important attributes<br /><ul><li>aria-atomic="true | false" </li></ul>Optional. Indicates if assistive technology should present all or part of the changed region to the user.<br /><ul><li>aria-atomic=“true”: assistive technology should announce the entire region when part of it changes;
    99. 99. aria-atomic=“false”: only the part of the region that changed should be announced on its own.
    100. 100. aria-busy="true | false" </li></ul>Optional. Indicates whether region has finished updating, or whether certain parts are still expected to change. <br /><ul><li>aria-busy=“true”: region not fully updated yet, AT should wait.
    101. 101. aria-busy=“false”: region update is complete, AT can start announcing the update.</li></ul>03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />48<br />
    102. 102. Useful Roles with ‘Built In’ Live Regions<br /><ul><li>Role=“alert” </li></ul>Used for one-time, high priority notifications.<br />Should be shown for a period of time, or until the cause of the alert is solved.<br />Should contain a basic message, no complex content.<br />The element with the alert role does not need to be focused to be announced.<br /><ul><li>Elements with role=“alert” receive aria-live=“assertive” and aria-atomic=“true” as default values.
    103. 103. Screen reader automatically announces the alert text, after saying ‘alert’</li></ul>Example: Form validation sample<br /><ul><li>Role=“alertdialog”</li></ul>Similar to Alert, but meant for actual (DHTML ) dialog windows .<br />May contain other widgets, such as buttons or other form fields. <br />Does require a sub element (such as a ‘confirm’ button) to receive focus.<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />49<br />
    104. 104. Useful Roles with ‘Built In’ Live Regions (2)<br /><ul><li>Role=“status”</li></ul>Contains advisory information for the user but is not important enough to justify an alert.<br />Automatically receives aria-live=“polite”<br />Should not receive focus<br /><ul><li>Role=“timer”</li></ul>A numerical counter which indicates an amount of elapsed time from a start point, or the time remaining until an end point.<br />Should be updated at regular intervals <br /><ul><li>Role=“marquee”</li></ul>A type of live region where non-essential information changes frequently<br /><ul><li>E.g. stock tickers, banners
    105. 105. Role=“log”</li></ul>Like marquee, but information is added in meaningful order and old information may disappear.<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />50<br />
    106. 106. Fallback solutions / Hacks<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />51<br />
    107. 107. Fall back solution for dialogs<br /><ul><li>In IE, JAWS currently does not properly announce dialogs when moving focus into them
    108. 108. It's possible to provide a fallback solution for IE to fix this, using hidden fieldsets to apply the ARIA dialog markup to </li></ul>Hide fieldset's padding, margin, and border<br />Move legend off-screen <br /><fieldset role="dialog" aria-labelledby="dialogTitle" aria-describedby="dialogDescription"><br /> <legend id="dialogTitle">Confirm</legend><br /> <p id="dialogDescription"><br /> Are you sure you want to do that?<br /> </p><br /> <button>Yes</button> <br /> <button>No</button><br /></fieldset><br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />52<br />
    109. 109. Fallback solutions for link buttons<br /><ul><li>Developers often use links as (icon) buttons</li></ul>Side effect: screen reader will announce them as a link, not a button<br /><ul><li>This can be made accessible by setting role="button"</li></ul>Screen reader announces link as button now, but also provides hint for using a button ("press" space to activate)<br /><ul><li>You lie! Links work through the Enter key, Space will scroll down the page </li></ul>To make sure JAWS is not lying, you'll have to manually add a key event handler for the Space key.<br /><a role="button" onkeypress="handleKeyPress(event);">refresh</a><br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />53<br />
    110. 110. Fixing Structure: Aria-owns<br /><ul><li>Sometimes a widget structure is not explicit via the DOM and logical structure of a page.
    111. 111. Aria-owns=“IDREFS”
    112. 112. Indicates that the element(s) referenced by the IDs should be considered a child of the element that has this attribute.</li></ul><h3 id="header">Vegetables</h3> <br /><ul role="list" aria-labelledby="header" aria-owns="external_listitem"> <br /> <li role="listitem">Carrot</li> <br /> <li role="listitem">Tomato</li> <br /> <li role="listitem">Lettuce</li> <br /></ul> <br />… <br /><div role="listitem" id="external_listitem">Asparagus</div><br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />54<br />
    113. 113. Fixing Incorrect Grid Structure (1)<br /><ul><li>Some developers will use multiple HTML <table> elements to create one single grid. For example:</li></ul>One <table> for the header row, one <table> for the body rows<br />One <table> for every single row<br /><ul><li>Why? Because this is easier to manage, style, position, drag & drop, etc.
    114. 114. Screen reader does not perceive one single table, but it sees two ore more separate tables</li></ul>Association between column headers and cells is broken<br />Screen reader's table navigation is broken<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />55<br />
    115. 115. Fixing Incorrect Grid Structure (2)<br />If using a single table is not feasible, use ARIA to fix the grid structure as perceived by the screen reader <br />Use role="presentation" to hide the original table elements form the screen readers<br />Use a combination of "grid", "row", "gridcell", "columnheader" roles to make the screen reader see one big grid.<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />56<br />
    116. 116. Fixing Incorrect Grid Structure (3)<br />Using ARIA to create a correct grid structure <br /> <div role="grid"><br /> <table role="presentation"><br /> <tr role="row"><br /> <th role="columnheader">Dog Names</th><br /> <th role="columnheader">Cat Names</th><br /> <th role="columnheader">Cow names</th><br /> </tr><br /> </table><br /> <table role="presentation"><br /> <tr role="row"><br /> <td role="gridcell">Fido</td><br /> <td role="gridcell">Whiskers</td><br /> <td role="gridcell">Clarabella</td><br /> </tr><br /> </table><br /> </div><br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />57<br />
    117. 117. Color and Contrast <br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />58<br />
    118. 118. Sufficient Contrast for colors<br /><ul><li>To be WCAG 2 compliant, background and foreground colors for text needs to have sufficient contrast
    119. 119. If that's not possible, it's an option to design a high(er) contrast theme that the user can enable</li></ul>03 / 15 / 11<br />59<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />
    120. 120. Windows high contrast mode support<br /><ul><li>High Contrast Mode:</li></ul>Windows OS specific feature, inherited by browser<br />Background & foreground colors are overridden<br />Background images are stripped out<br /><ul><li>Problematic for widgets:</li></ul>They often use background color and images to indicate information (e.g. icons & selection highlights)<br /><ul><li>Solution:</li></ul>Detect whether high contrast mode is active <br />If so, provide workarounds:<br /><ul><li>Inject html images or text to DOM
    121. 121. Add additional visual indications, e.g. font weight, decoration & style</li></ul>03 / 15 / 11<br />60<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />
    122. 122. high contrast mode example <br />03 / 15 / 11<br />61<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />
    123. 123. Wrapping Up<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />62<br />
    124. 124. Testing ARIA: approaches<br /><ul><li>To test if your ARIA works:
    125. 125. Use a screen reader to try out your aria widgets and roles.
    126. 126. JAWS 10 has decent support, but misses certain things
    127. 127. NVDA has better ARIA support, is free and has a ‘silent’ mode
    128. 128. Compare with widgets in Desktop to know what to expect.
    129. 129. Using MSAA Tools
    130. 130. Inspect32
    131. 131. quick and effective
    132. 132. Shows Focus role, states, name and description
    133. 133. AccExplorer
    134. 134. Lets you have a look at your page’s underlying ‘accessible tree
    135. 135. Using Browser Tools
    136. 136. Firebug for firefox
    137. 137. Developer Tools for IE8</li></ul>03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />63<br />
    138. 138. Where to Find More<br />Get Started with ARIA:<br />http://www.w3.org/WAI/intro/aria<br />ARIA Best Practices:<br />http://www.w3.org/TR/wai-aria-practices/<br />DHTML Styleguide:<br />http://dev.aol.com/dhtml_style_guide<br />03 / 15 / 11<br />Accessibility of HTML5 and Rich Internet Applications - CSUN 2011<br />64<br />

    ×