ARIA landmark and widget roles
Basically there are two ‘types’ of roles. ‘Landmark’ which allow assistive technology to provide context to a user, and what can generally be thought of as ‘widget’ roles, which help users of Assistive Technology (AT) navigate and utilise more specialised parts of a web page such as menu listings, tab navigation or alert popups.
The following is a list of WAI-ARIA landmark roles.
applicationA region declared as a web application, as opposed to a web document. On a practical level this tells AT to stay in ‘focus’ mode which works a little differently to its standard mode.bannerA region that contains the primary heading or web site title.complementaryA supporting section of the document that remains meaningful even when separated from the main content.contentinfoMetadata that applies to the parent document.mainThe main content of a document.navigationA collection of navigational elements (usually links) for navigating the document or related documents.searchThe search tool of a web document.
There’s a bit of overlap between some of the landmark roles and HTML5, but don’t worry about it. The Assistive Tech guys apparently haven’t even come to the table to discuss HTML5 yet but they are actively implementing landmark roles and providing users ways of navigating them so even if you’re using HTML5 now it’s probably a good idea to add the ARIA roles to them as well.
Landmark roles can be added straight to the HTML markup without any problems, in fact in a lot of cases the browser doesn’t even need to understand them (IE6-7 for example don’t have a clue about ARIA) as several AT readers are capable of using them anyway. (JAWS10 for example will provide landscape navigation in IE6 if the roles are available).
Widget roles are different though and should really only be added by javascript:
node.setAttribute("role", "value");
This is because you’re usually adding widget roles because you want to perform some kind of extra functionality and it would be confusing to an AT user if they encountered a block of markup assigned a certain role that didn’t function as expected because they had javascript off.
The following is a list of WAI-ARIA widget roles.
alertA message with important, and usually time-sensitive, information. Also see alertdialog and status.alertdialogA type of dialog that contains an alert message, where initial focus goes to the dialog or an element within it. Also see alert and dialog.articleA section of a page consisting of an independent part of a document, page, or site.buttonAn input that allows for user-triggered actions when clicked or pressed.checkboxAn checkable input that has three possible values: true, false, or mixed.columnheaderA cell containing header information for a column.comboboxA presentation of a select; usually similar to a textbox where users can type ahead to select an option, or type to enter arbitrary text as a new item in the list.composite(abstract role) A widget that may contain navigable descendants or owned children.definitionA definition of a term or concept.dialogA dialog is an application window that is designed to interrupt the current processing of an application in order to prompt the user to enter information or require a response. Also see alertdialog.directoryA list of references to members of a group, such as a static table of contents.documentA region containing related information that is declared as document content, as opposed to a web application.gridA grid contains cells of tabular data arranged in rows and columns, like a table.gridcellA cell in a grid or treegrid.groupA set of user interface objects which would not be included in a page summary or table of contents by an assistive technology.headingA heading for a section of the page.imgA container for a collection of elements that form an image.input(abstract role) A generic type of widget that allows user input.landmark(abstract role) A region of the page intended as a navigational landmark.linkAn interactive reference to an internal or external resource.listA group of non-interactive list items.listboxA widget that allows the user to select one or more items from a list of choices.listitemA single item in a list, listbox, or directory.logA type of live region where new information is added in meaningful order and old information may disappear. Also see marquee.marqueeA type of live region where non-essential information changes frequently. Also see log.mathAn element that represents a mathematical expression.menuA type of widget that offers a list of choices to the user.menubarA presentation of menu that usually remains visible and is usually presented horizontally.menuitemAn option in a group of choices contained by a menu or menubar.menuitemcheckboxA checkable menuitem that has three possible values: true, false, or mixed.menuitemradioA checkable menuitem in a group of menuitemradio roles, only one of which can be checked at a time.noteA section whose content is parenthetic or ancillary to the main content of the resource.optionA selectable item in a select list.presentationAn element whose role is presentational and does not need to be mapped to the accessibility API.progressbarAn element that displays the progress status for tasks that take a long time.radioA checkable input in a group of radio roles, only one of which can be checked at a time.radiogroupA group of radio buttons.range(abstract role) An input representing a range of values that can be set by the user.regionA large perceivable section of a web page or document, that the author feels should be included in a summary of page features.roletype(abstract role) The base role from which all other roles in this taxonomy inherit.rowA row of cells in a grid.rowheaderA cell containing header information for a row in a grid.section(abstract role) A renderable structural containment unit in a document or application.sectionhead(abstract role) A structure that labels or summarizes the topic of its related section.select(abstract role) A form widget that allows the user to make selections from a set of choices.separatorA divider that separates and distinguishes sections of content or groups of menuitems.sliderA user input where the user selects a value from within a given range.spinbuttonA form of range that expects a user to select from amongst discrete choices.statusA container whose content is advisory information for the user but is not important enough to justify an alert. Also see alert.structure(abstract role) A document structural element.tabA header for a tabpanel.tablistA list of tab elements, which are references to tabpanel elements.tabpanelA container for the resources associated with a tab.textboxInput that allows free-form text as their value.timerA numerical counter which indicates an amount of elapsed time from a start point, or the time remaining until an end point.toolbarA collection of commonly used function buttons represented in compact visual form.tooltipA contextual popup that displays a description for an element in a mouse hover or keyboard focused state. Supplement to the normal tooltip processing of the user agent.treeA type of list that may contain sub-level nested groups that can be collapsed and expanded.treegridA grid whose rows can be expanded and collapsed in the same manner as for a tree.treeitemAn option item of a tree. This is an element within a tree that may be expanded or collapsed if it contains a sub-level group of treeitems.widget(abstract role) An interactive component of a graphical user interface (GUI).window(abstract role) A browser or application window.
The ‘presentation’ role is a pretty interesting one as it basically allows for extra markup to be ignored by AT. For example consider the following markup:
<ul role="menu">
<li>< a href="page1" role="menuitem">Home</li>
<li>< a href="page2" role="menuitem">News</li>
<li>< a href="page3" role="menuitem">About us</li>
<li>< a href="page4" role="menuitem">Contact us</li>
</ul>
The li’s are between the menu container and its associated menu items which means AT wont know to group those items together. Changing the markup to:
<ul role="menu">
<li role="presentation">< a href="page1" role="menuitem">Home</li>
<li role="presentation">< a href="page2" role="menuitem">News</li>
<li role="presentation">< a href="page3" role="menuitem">About us</li>
<li role="presentation">< a href="page4" role="menuitem">Contact us</li>
</ul>
tells the AT to ignore the li’s which then allows the AT to find and group approriate menus and their items.
Category: Web Development | Tags: aria, we, Web Development Comment »