aria_with_kissy

45
ARIA with KISSY 承玉 [email protected] Draft 26 May 2011

Post on 12-Sep-2014

1.636 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: aria_with_kissy

ARIA with KISSY

承玉[email protected]

Draft 26 May 2011

Page 2: aria_with_kissy

• WAI ARIA Introduction

• ARIA Essentials

• ARIA with KISSY

Page 3: aria_with_kissy

• WAI ARIA Introduction

Page 4: aria_with_kissy

• W

• A

• I

• A

• R

• I

• A

WAI ARIA Intro

Page 5: aria_with_kissy

• Web

• Accessibility

• Initiative

• Accessible

• Rich

• Internet

• Application

WAI ARIA Intro

Page 6: aria_with_kissy

• Web >= 2.0 is fancy !

Problem

Page 7: aria_with_kissy

What can we do for the disabled especially blind men ?

Page 8: aria_with_kissy

• MSAA : Microsoft Active Accessibility

MS already does

Page 9: aria_with_kissy

• Accessibility Programming Guidelines for Cocoa

Mac also does

Page 10: aria_with_kissy

• Map ARIA attributes to MSAA properties.

• Now in draft , but de facto standard , largely supported

ARIA comes for web

Page 11: aria_with_kissy

• Semantic tag with meaning content

• But not enough for complex app

How

html

Page 12: aria_with_kissy

• Enhance usability for common people

• But not so useful for disabled

How

html

css

Page 13: aria_with_kissy

• Fancy thing comes

• But it does not tell disabled

How

html

css

javascript

Page 14: aria_with_kissy

• Aria for rescue

• More semantics by providing attribute to bridge the gap between App and AT.

How

html

css

javascript

ARIA

Page 15: aria_with_kissy

• Aria essentials

Page 16: aria_with_kissy

• Role : type of ui component ,add semantics

• State/Property : decribe about specific role’s attribute

• Tabindex : focus management , control user’s navigation

• Keydown/press : event needed to be listened for activate actions

ARIA essentials

Page 17: aria_with_kissy

• Document structure

• Landmarks

• Widget role

Role category

Page 18: aria_with_kissy

• Organize content in a page ,not usually interactive. Similar to html5 tags .

• Contains :

article columnheader definition directory document group heading img list listitem math note presentation region row rowheader separator toolbar

Document structure Roles

Page 19: aria_with_kissy

• Document structure roles in taobao

Role=‘list’

role=‘listitem’

Page 20: aria_with_kissy

• Managing content and presentation changes

• Relation:

– aria-controls

• Properties

– aria-live aria-busy aria-atomic aria-relevent

• Special live region

– alert status timer marquee log

Live region

Page 21: aria_with_kissy

In taobao

• word count notification

id=‘counter’ aria-live=‘polite’

aria-controls=‘counter’

Page 22: aria_with_kissy

• Navigational regions , need AT’s navigation function.

• Contains :

application banner complementary contentinfo form main navigation search

Landmark roles

Page 23: aria_with_kissy

Landmark roles in taobao

Page 24: aria_with_kissy

Landmark in taobao

role=‘contentinfo’

Page 25: aria_with_kissy

• Type of a standalone widget or ui control like on desktop.

• Contains :

alert button dialog gridcell marquee menuitem menuitemcheckbox menuitemradio option progressbar scrollbar slider spinbutton tab tabpanel timer tooltip treeitem combobox grid listbox menu menubar radiogroup tablist tree …

Widget roles

Page 26: aria_with_kissy

Widget roles in taobao

Page 27: aria_with_kissy

• hint:

– Keydown on Roles other an ‘application’ or widget role will be intercepted by AT.

– Keydown event fired on element with widget role should call stopPropagation and preventDefault in order to let web application to handle it.

Role and keydown

Page 28: aria_with_kissy

• Belongs to specific roles ,name starts with “aria-”

• For example :

aria-label aria-labelledby aria-live aria-hidden aria-activedescendant aria-haspopup aria-controls …

States/property

Page 29: aria_with_kissy

In taobao

aria-activedescendant

aria-hidden

Now : aria-label aria-haspopup @ etao

Lack : aria-activedescendant aria-hidden

Page 30: aria_with_kissy

• Manage focus among dom node

tabindex

Attribute Tabindex Focusable with mouse or JavaScript via element.focus()

Tab Navigation

not present Follows default behavior of element (only form controls and anchors can receive focus.)

Follows default behavior of element

zero - tabindex="0" yes In tab order relative to element's position in document

Positive - tabindex="X" (where X is a positive integer between 1 and 32768)

yes Tabindex value directly specifies where this element is positioned in the tab order.

Negative - tabindex="-1" yes No, author must focus it with element.focus() as a result of arrow or other key press

Page 31: aria_with_kissy

• Aria with KISSY

Page 33: aria_with_kissy

• role=‘dialog’

• aria-labelledby

• aria-hidden

• Trapping Focus

KISSY.Overlay

Page 34: aria_with_kissy

• role = ‘button’

• aria-haspopup aria-expanded

• aria-pressed aria-disabled

• aria-activedescendant

• aria-labelledby

KISSY.MenuButton

Page 35: aria_with_kissy

• role = ‘menu’ / ‘menuitem’

• aria-haspopup

• aria-activedescendant

• aria-disabled aria-pressed

KISSY.Menu

Page 36: aria_with_kissy

• Aria in KISSY.Tabs

Tabs Transform

Page 37: aria_with_kissy

• 1. Pick role

– Role=‘tablist’

– Role=‘tab’

– Role=‘tabpanel’

KISSY.Tabs practice

Page 38: aria_with_kissy

• 2. set state/property and tabindex

– Tabpanel

• aria-hidden

• aria-labelledby

– Tab

• tabindex , current active = 0 , others = -1

Page 39: aria_with_kissy

• 3.establish keyboard

navigation

– Keyboard accessible tab

by listening keydown/press

Page 40: aria_with_kissy

• 4.sync states with

widget logic

5.tabindex and

focus management

– AOP Event-Driven

Page 41: aria_with_kissy

• Waiting ….

More

Page 44: aria_with_kissy

• Mozilla -http://developer.mozilla.org/en/docs/Accessible_DHTML

• UIUC tests - http://test.cita.uiuc.edu/aria

• Live regions - http://accessibleajax.clcworld.net

• A List Apart - http://alistapart.com/articles/waiaria

• IBM -http://www.csun.edu/cod/conf/2005/proceedings/2524.htm

• Webaim - http://webaim.org/

refer

Page 45: aria_with_kissy

Thanks to WAI