2007-06-05 15:41:07 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:expandtab:shiftwidth=2:tabstop=2:
|
|
|
|
*/
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is IBM Corporation
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2007
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Aaron Leventhal <aleventh@us.ibm.com>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsARIAMap.h"
|
|
|
|
#include "nsIAccessibleRole.h"
|
|
|
|
#include "nsIAccessibleStates.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This list of WAI-defined roles are currently hardcoded.
|
|
|
|
* Eventually we will most likely be loading an RDF resource that contains this information
|
|
|
|
* Using RDF will also allow for role extensibility. See bug 280138.
|
|
|
|
*
|
|
|
|
* Definition of nsRoleMapEntry and nsStateMapEntry contains comments explaining this table.
|
|
|
|
*
|
2007-09-25 01:19:03 +00:00
|
|
|
* When no nsIAccessibleRole enum mapping exists for an ARIA role, the
|
2007-06-05 15:41:07 +00:00
|
|
|
* role will be exposed via the object attribute "xml-roles".
|
|
|
|
* In addition, in MSAA, the unmapped role will also be exposed as a BSTR string role.
|
|
|
|
*
|
|
|
|
* There are no nsIAccessibleRole enums for the following landmark roles:
|
|
|
|
* banner, contentinfo, main, navigation, note, search, secondary, seealso, breadcrumbs
|
|
|
|
*/
|
|
|
|
|
2007-12-12 02:10:26 +00:00
|
|
|
static const nsStateMapEntry kEndEntry = {nsnull, 0, 0}; // To fill in array of state mappings
|
2007-06-05 15:41:07 +00:00
|
|
|
|
|
|
|
nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
|
|
|
|
{
|
2008-10-08 12:54:58 +00:00
|
|
|
{
|
|
|
|
"alert",
|
|
|
|
nsIAccessibleRole::ROLE_ALERT,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"alertdialog",
|
2009-02-02 09:35:36 +00:00
|
|
|
nsIAccessibleRole::ROLE_DIALOG,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"application",
|
|
|
|
nsIAccessibleRole::ROLE_APPLICATION,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"article",
|
|
|
|
nsIAccessibleRole::ROLE_DOCUMENT,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 07:34:40 +00:00
|
|
|
eNoLiveAttr,
|
2009-02-17 16:16:38 +00:00
|
|
|
nsIAccessibleStates::STATE_READONLY,
|
2008-10-08 12:54:58 +00:00
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"button",
|
|
|
|
nsIAccessibleRole::ROLE_PUSHBUTTON,
|
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2009-02-21 07:43:51 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_pressed, kBoolState, nsIAccessibleStates::STATE_PRESSED | nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_pressed, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
|
2008-10-08 12:54:58 +00:00
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"checkbox",
|
|
|
|
nsIAccessibleRole::ROLE_CHECKBUTTON,
|
|
|
|
eNoValue,
|
|
|
|
eCheckUncheckAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
nsIAccessibleStates::STATE_CHECKABLE,
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED},
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"columnheader",
|
|
|
|
nsIAccessibleRole::ROLE_COLUMNHEADER,
|
|
|
|
eNoValue,
|
2009-04-09 18:47:49 +00:00
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"combobox",
|
|
|
|
nsIAccessibleRole::ROLE_COMBOBOX,
|
|
|
|
eHasValueMinMax,
|
|
|
|
eOpenCloseAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
nsIAccessibleStates::STATE_COLLAPSED | nsIAccessibleStates::STATE_HASPOPUP,
|
|
|
|
// Manually map EXT_STATE_SUPPORTS_AUTOCOMPLETION aria-autocomplete
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"dialog",
|
|
|
|
nsIAccessibleRole::ROLE_DIALOG,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"document",
|
|
|
|
nsIAccessibleRole::ROLE_DOCUMENT,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 07:34:40 +00:00
|
|
|
eNoLiveAttr,
|
2009-02-17 16:16:38 +00:00
|
|
|
nsIAccessibleStates::STATE_READONLY,
|
2008-10-08 12:54:58 +00:00
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"grid",
|
|
|
|
nsIAccessibleRole::ROLE_TABLE,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
nsIAccessibleStates::STATE_FOCUSABLE,
|
|
|
|
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"gridcell",
|
2009-01-20 15:02:35 +00:00
|
|
|
nsIAccessibleRole::ROLE_GRID_CELL,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"group",
|
|
|
|
nsIAccessibleRole::ROLE_GROUPING,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"heading",
|
|
|
|
nsIAccessibleRole::ROLE_HEADING,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"img",
|
|
|
|
nsIAccessibleRole::ROLE_GRAPHIC,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"label",
|
|
|
|
nsIAccessibleRole::ROLE_LABEL,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"link",
|
|
|
|
nsIAccessibleRole::ROLE_LINK,
|
|
|
|
eNoValue,
|
|
|
|
eJumpAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
nsIAccessibleStates::STATE_LINKED,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"list",
|
|
|
|
nsIAccessibleRole::ROLE_LIST,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
nsIAccessibleStates::STATE_READONLY,
|
|
|
|
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"listbox",
|
|
|
|
nsIAccessibleRole::ROLE_LISTBOX,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"listitem",
|
|
|
|
nsIAccessibleRole::ROLE_LISTITEM,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction, // XXX: should depend on state, parent accessible
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
nsIAccessibleStates::STATE_READONLY,
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
kEndEntry
|
|
|
|
},
|
2009-02-19 06:56:19 +00:00
|
|
|
{
|
|
|
|
"log",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
ePoliteLiveAttr,
|
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"marquee",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eOffLiveAttr,
|
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
2008-10-08 12:54:58 +00:00
|
|
|
{
|
|
|
|
"math",
|
|
|
|
nsIAccessibleRole::ROLE_FLAT_EQUATION,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"menu",
|
|
|
|
nsIAccessibleRole::ROLE_MENUPOPUP,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction, // XXX: technically accessibles of menupopup role haven't
|
|
|
|
// any action, but menu can be open or close.
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"menubar",
|
|
|
|
nsIAccessibleRole::ROLE_MENUBAR,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"menuitem",
|
|
|
|
nsIAccessibleRole::ROLE_MENUITEM,
|
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"menuitemcheckbox",
|
|
|
|
nsIAccessibleRole::ROLE_CHECK_MENU_ITEM,
|
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
nsIAccessibleStates::STATE_CHECKABLE,
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED },
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"menuitemradio",
|
|
|
|
nsIAccessibleRole::ROLE_RADIO_MENU_ITEM,
|
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
nsIAccessibleStates::STATE_CHECKABLE,
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED },
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"option",
|
|
|
|
nsIAccessibleRole::ROLE_OPTION,
|
|
|
|
eNoValue,
|
|
|
|
eSelectAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"presentation",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"progressbar",
|
|
|
|
nsIAccessibleRole::ROLE_PROGRESSBAR,
|
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
nsIAccessibleStates::STATE_READONLY,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"radio",
|
|
|
|
nsIAccessibleRole::ROLE_RADIOBUTTON,
|
|
|
|
eNoValue,
|
|
|
|
eSelectAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-02-21 07:43:51 +00:00
|
|
|
nsIAccessibleStates::STATE_CHECKABLE,
|
2008-10-08 12:54:58 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"radiogroup",
|
|
|
|
nsIAccessibleRole::ROLE_GROUPING,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"region",
|
|
|
|
nsIAccessibleRole::ROLE_PANE,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"row",
|
|
|
|
nsIAccessibleRole::ROLE_ROW,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"rowheader",
|
|
|
|
nsIAccessibleRole::ROLE_ROWHEADER,
|
|
|
|
eNoValue,
|
2009-04-09 18:47:49 +00:00
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"section",
|
|
|
|
nsIAccessibleRole::ROLE_SECTION,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"separator",
|
|
|
|
nsIAccessibleRole::ROLE_SEPARATOR,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"slider",
|
|
|
|
nsIAccessibleRole::ROLE_SLIDER,
|
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spinbutton",
|
|
|
|
nsIAccessibleRole::ROLE_SPINBUTTON,
|
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"status",
|
|
|
|
nsIAccessibleRole::ROLE_STATUSBAR,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 08:10:45 +00:00
|
|
|
ePoliteLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tab",
|
|
|
|
nsIAccessibleRole::ROLE_PAGETAB,
|
|
|
|
eNoValue,
|
|
|
|
eSwitchAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tablist",
|
|
|
|
nsIAccessibleRole::ROLE_PAGETABLIST,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
ePoliteLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tabpanel",
|
|
|
|
nsIAccessibleRole::ROLE_PROPERTYPAGE,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"textbox",
|
|
|
|
nsIAccessibleRole::ROLE_ENTRY,
|
|
|
|
eNoValue,
|
|
|
|
eActivateAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
// Manually map EXT_STATE_SINGLE_LINE and EXT_STATE_MULTI_LINE FROM aria-multiline
|
|
|
|
// Manually map EXT_STATE_SUPPORTS_AUTOCOMPLETION aria-autocomplete
|
|
|
|
{&nsAccessibilityAtoms::aria_autocomplete, "list", nsIAccessibleStates::STATE_HASPOPUP},
|
|
|
|
{&nsAccessibilityAtoms::aria_autocomplete, "both", nsIAccessibleStates::STATE_HASPOPUP},
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
kEndEntry
|
|
|
|
},
|
2009-02-19 06:56:19 +00:00
|
|
|
{
|
|
|
|
"timer",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eOffLiveAttr,
|
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
2008-10-08 12:54:58 +00:00
|
|
|
{
|
|
|
|
"toolbar",
|
|
|
|
nsIAccessibleRole::ROLE_TOOLBAR,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tooltip",
|
|
|
|
nsIAccessibleRole::ROLE_TOOLTIP,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"tree",
|
|
|
|
nsIAccessibleRole::ROLE_OUTLINE,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"treegrid",
|
|
|
|
nsIAccessibleRole::ROLE_TREE_TABLE,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
|
|
|
|
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE},
|
|
|
|
kEndEntry
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"treeitem",
|
|
|
|
nsIAccessibleRole::ROLE_OUTLINEITEM,
|
|
|
|
eNoValue,
|
|
|
|
eActivateAction, // XXX: should expose second 'expand/collapse' action based
|
|
|
|
// on states
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
|
|
|
|
{&nsAccessibilityAtoms::aria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE},
|
2009-02-19 07:31:39 +00:00
|
|
|
kEndEntry
|
2009-02-19 07:23:44 +00:00
|
|
|
}
|
2007-11-12 01:05:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
PRUint32 nsARIAMap::gWAIRoleMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIRoleMap);
|
|
|
|
|
|
|
|
nsRoleMapEntry nsARIAMap::gLandmarkRoleMap = {
|
|
|
|
"",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
|
|
|
eNoValue,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2007-11-12 01:05:37 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
2007-06-05 15:41:07 +00:00
|
|
|
};
|
|
|
|
|
2008-02-07 04:14:59 +00:00
|
|
|
nsRoleMapEntry nsARIAMap::gEmptyRoleMap = {
|
|
|
|
"",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
|
|
|
eNoValue,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-02-07 04:14:59 +00:00
|
|
|
kNoReqStates,
|
|
|
|
kEndEntry
|
|
|
|
};
|
|
|
|
|
2007-06-05 15:41:07 +00:00
|
|
|
/**
|
|
|
|
* Universal states:
|
|
|
|
* The following state rules are applied to any accessible element,
|
|
|
|
* whether there is an ARIA role or not:
|
|
|
|
*/
|
|
|
|
nsStateMapEntry nsARIAMap::gWAIUnivStateMap[] = {
|
2007-12-12 02:10:26 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_required, kBoolState, nsIAccessibleStates::STATE_REQUIRED},
|
|
|
|
{&nsAccessibilityAtoms::aria_invalid, kBoolState, nsIAccessibleStates::STATE_INVALID},
|
|
|
|
{&nsAccessibilityAtoms::aria_haspopup, kBoolState, nsIAccessibleStates::STATE_HASPOPUP},
|
|
|
|
{&nsAccessibilityAtoms::aria_busy, "true", nsIAccessibleStates::STATE_BUSY},
|
|
|
|
{&nsAccessibilityAtoms::aria_busy, "error", nsIAccessibleStates::STATE_INVALID},
|
2008-02-25 09:08:37 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
|
2009-01-19 21:28:03 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_expanded, kBoolState, nsIAccessibleStates::STATE_EXPANDED},
|
|
|
|
{&nsAccessibilityAtoms::aria_expanded, "false", nsIAccessibleStates::STATE_COLLAPSED},
|
2007-06-05 15:41:07 +00:00
|
|
|
kEndEntry
|
|
|
|
};
|
|
|
|
|
2009-02-15 08:15:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ARIA attribute map for attribute characteristics
|
|
|
|
*
|
|
|
|
* @note ARIA attributes that don't have any flags are not included here
|
|
|
|
*/
|
|
|
|
nsAttributeCharacteristics nsARIAMap::gWAIUnivAttrMap[] = {
|
2009-03-10 20:44:43 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_activedescendant, ATTR_BYPASSOBJ },
|
2009-02-15 08:15:31 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_atomic, ATTR_VALTOKEN },
|
|
|
|
{&nsAccessibilityAtoms::aria_busy, ATTR_VALTOKEN },
|
2009-03-10 20:44:43 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_checked, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, /* exposes checkable obj attr */
|
|
|
|
{&nsAccessibilityAtoms::aria_controls, ATTR_BYPASSOBJ },
|
|
|
|
{&nsAccessibilityAtoms::aria_describedby, ATTR_BYPASSOBJ },
|
|
|
|
{&nsAccessibilityAtoms::aria_disabled, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
2009-02-15 08:15:31 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_dropeffect, ATTR_VALTOKEN },
|
2009-03-10 20:44:43 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_expanded, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsAccessibilityAtoms::aria_flowto, ATTR_BYPASSOBJ },
|
2009-02-15 08:15:31 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_grabbed, ATTR_VALTOKEN },
|
2009-03-10 20:44:43 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_haspopup, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsAccessibilityAtoms::aria_invalid, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsAccessibilityAtoms::aria_labelledby, ATTR_BYPASSOBJ },
|
2009-02-15 08:15:31 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_live, ATTR_VALTOKEN },
|
2009-03-10 20:44:43 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_multiline, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsAccessibilityAtoms::aria_multiselectable, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsAccessibilityAtoms::aria_owns, ATTR_BYPASSOBJ },
|
|
|
|
{&nsAccessibilityAtoms::aria_pressed, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsAccessibilityAtoms::aria_readonly, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsAccessibilityAtoms::aria_relevant, ATTR_BYPASSOBJ },
|
|
|
|
{&nsAccessibilityAtoms::aria_required, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsAccessibilityAtoms::aria_selected, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
2009-02-15 08:15:31 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_sort, ATTR_VALTOKEN },
|
2009-03-10 20:44:43 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_valuenow, ATTR_BYPASSOBJ },
|
|
|
|
{&nsAccessibilityAtoms::aria_valuemin, ATTR_BYPASSOBJ },
|
|
|
|
{&nsAccessibilityAtoms::aria_valuemax, ATTR_BYPASSOBJ },
|
|
|
|
{&nsAccessibilityAtoms::aria_valuetext, ATTR_BYPASSOBJ }
|
2009-02-15 08:15:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
PRUint32 nsARIAMap::gWAIUnivAttrMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIUnivAttrMap);
|