37
Real JavaScript Ninja’s know how to role with WAI- ARIA

Real JavaScript Ninjas should know how to role with WAI-ARIA

Embed Size (px)

DESCRIPTION

ARIA provides a lot of really useful additional semantics to HTML 5 that , if used properly, can lead to awesome accessible UIs

Citation preview

Page 1: Real JavaScript Ninjas should know how to role with WAI-ARIA

Real

JavaScript

Ninja’s

know how

to role with

WAI-ARIA

Page 2: Real JavaScript Ninjas should know how to role with WAI-ARIA

Dylan BarrellTwitter: @dylanbarrell, @unobfuscatorGitHub: dylanbhttp://unobfuscated.blogspot.com/

Page 3: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 4: Real JavaScript Ninjas should know how to role with WAI-ARIA

8 trillion

Page 5: Real JavaScript Ninjas should know how to role with WAI-ARIA

$8 trillion

Page 6: Real JavaScript Ninjas should know how to role with WAI-ARIA

15%

Page 7: Real JavaScript Ninjas should know how to role with WAI-ARIA

1 billion

Page 8: Real JavaScript Ninjas should know how to role with WAI-ARIA

POUR

Page 9: Real JavaScript Ninjas should know how to role with WAI-ARIA

PerceivableOperableUnderstandableRobust

Page 10: Real JavaScript Ninjas should know how to role with WAI-ARIA

Call a Spade a Spade

RoleNameState(s)Value

Page 11: Real JavaScript Ninjas should know how to role with WAI-ARIA

Keyboard (and gestures) – add graphic of a Braille keyboard

Page 12: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 13: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 14: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 15: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 16: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 17: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 18: Real JavaScript Ninjas should know how to role with WAI-ARIA

Insert periodic table of ARIA roles

Page 19: Real JavaScript Ninjas should know how to role with WAI-ARIA

• ARIA roles:– Provide the ability to control the

transition between application (forms) mode and document mode

– Provide more native announcments for widgets like menus, tabs, sliders etc.

– Provide for the ability to control announcements when updates occur away from the focus

– Provide much more control over the structure of the document and how someone navigates around it

Page 20: Real JavaScript Ninjas should know how to role with WAI-ARIA

Insert periodic table of ARIA attributes

Page 21: Real JavaScript Ninjas should know how to role with WAI-ARIA

• ARIA attributes:– Solve the problem of multiple labels and

descriptions through the addition of finer-grained labeling attributes

– Enhance the ARIA roles through the addition of standard state, value and role-specifying attributes

– Add some attributes for better control of what is spoken by the screen reader versus what is simply there for presentational purposes

Page 22: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 23: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 24: Real JavaScript Ninjas should know how to role with WAI-ARIA

First rule of ARIA – If there is a native HTML element that does

the job, use that

Examples1. Use <button> and <input

type=“submit”> NOT <a role=“button”>

2. Use <ul>, <ol> and <li> NOT <span role=“list”> etc.

Page 25: Real JavaScript Ninjas should know how to role with WAI-ARIA

Compelling ARIA roles• Landmark Roles

– main, search, navigation, contentinfo, complementary, banner

– region in combination with aria-label

• Live Region Roles– log, status, alert

• Some Widget Roles– tabpanel and tab– slider– menu, menubar, menuitem and associated attributes– dialog – in combination with the document role to get it

to work in NVDA– tree and treeitem – a bit tricky to get to work reliably

• Some form roles– button, textbox, checkbox, radio, radiogroup

• presentation role

Page 26: Real JavaScript Ninjas should know how to role with WAI-ARIA

Second rule of ARIA – test it on all YOUR platforms with the

assistive technology YOU support

All platforms have problems, most have workarounds, iOS is the

most problematic and Android is not quite ready for prime time

yet

Page 27: Real JavaScript Ninjas should know how to role with WAI-ARIA

ARIA holes• Tables, tables, tables– Use the a11yfy library

• Arrow keys on iOS– Insert dynamic modal content in line– Use gestures

• Gestures– Think hard about your mapping to the

portable gestures– add on screen controls where possible

Page 28: Real JavaScript Ninjas should know how to role with WAI-ARIA

Accessible Gesture Calendar Examplehttps://github.com/dylanb/gestura11yhttp://dylanb.github.io/datepicker/datepicker.html

• Shows use of tabindex to control focus• Shows use of role=“application” to force

application mode• Shows use of aria-live regions to announce the

current date as the user moves around• Shows use of aria-hidden to hide presentation

markup from the screen reader• Shows use of keyboard handler and mapping to

gestures• Shows how to ensure that gestures are

consistent regardless of zoom level

Page 29: Real JavaScript Ninjas should know how to role with WAI-ARIA

Accessible Gesture Calendar Examplehttps://github.com/dylanb/gestura11y

Page 30: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 31: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 32: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 33: Real JavaScript Ninjas should know how to role with WAI-ARIA
Page 34: Real JavaScript Ninjas should know how to role with WAI-ARIA

Third rule of ARIA – Always attach your event handlers to

the same element that has the role and the focus

If you stick to this rule, you will avoid events not being delivered consistently

Page 35: Real JavaScript Ninjas should know how to role with WAI-ARIA

Fourth rule of ARIA – In complex widgets like menubars,

tabpanels etc. always make all interim structures

presentational

Page 36: Real JavaScript Ninjas should know how to role with WAI-ARIA

Fifth rule of ARIA – in a complex widget where you are

managing focus, disable all naturally focusable elements

with tabindex=“-1”

Example is the a11yfy menu examples where the anchors

are given tabindex=“-1”

Page 37: Real JavaScript Ninjas should know how to role with WAI-ARIA

FinallyThere is a wealth or resources including

The ARIA specification http://www.w3.org/TR/wai-aria/

The Authoring Practices http://www.w3.org/TR/wai-aria-practices/

The WAI Web Site http://www.w3.org/WAI/intro/aria

Mozilla Developer Network https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA