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
|
2009-06-25 02:12:38 +00:00
|
|
|
*/
|
2007-06-05 15:41:07 +00:00
|
|
|
|
|
|
|
nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
|
|
|
|
{
|
2008-10-08 12:54:58 +00:00
|
|
|
{
|
|
|
|
"alert",
|
|
|
|
nsIAccessibleRole::ROLE_ALERT,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"alertdialog",
|
2009-02-02 09:35:36 +00:00
|
|
|
nsIAccessibleRole::ROLE_DIALOG,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"application",
|
|
|
|
nsIAccessibleRole::ROLE_APPLICATION,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"article",
|
|
|
|
nsIAccessibleRole::ROLE_DOCUMENT,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 07:34:40 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
nsIAccessibleStates::STATE_READONLY
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"button",
|
|
|
|
nsIAccessibleRole::ROLE_PUSHBUTTON,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAPressed
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"checkbox",
|
|
|
|
nsIAccessibleRole::ROLE_CHECKBUTTON,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eCheckUncheckAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableMixed,
|
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"columnheader",
|
|
|
|
nsIAccessibleRole::ROLE_COLUMNHEADER,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
2009-04-20 06:06:19 +00:00
|
|
|
eSortAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2009-06-29 15:24:36 +00:00
|
|
|
eARIASelectable,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"combobox",
|
|
|
|
nsIAccessibleRole::ROLE_COMBOBOX,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
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,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAAutoComplete,
|
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"dialog",
|
|
|
|
nsIAccessibleRole::ROLE_DIALOG,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"document",
|
|
|
|
nsIAccessibleRole::ROLE_DOCUMENT,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 07:34:40 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
nsIAccessibleStates::STATE_READONLY
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"grid",
|
|
|
|
nsIAccessibleRole::ROLE_TABLE,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
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
|
|
|
nsIAccessibleStates::STATE_FOCUSABLE,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAMultiSelectable,
|
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"gridcell",
|
2009-01-20 15:02:35 +00:00
|
|
|
nsIAccessibleRole::ROLE_GRID_CELL,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
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,
|
2009-06-29 15:24:36 +00:00
|
|
|
eARIASelectable,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"group",
|
|
|
|
nsIAccessibleRole::ROLE_GROUPING,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"heading",
|
|
|
|
nsIAccessibleRole::ROLE_HEADING,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"img",
|
|
|
|
nsIAccessibleRole::ROLE_GRAPHIC,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"label",
|
|
|
|
nsIAccessibleRole::ROLE_LABEL,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"link",
|
|
|
|
nsIAccessibleRole::ROLE_LINK,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eJumpAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
nsIAccessibleStates::STATE_LINKED
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"list",
|
|
|
|
nsIAccessibleRole::ROLE_LIST,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
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
|
|
|
nsIAccessibleStates::STATE_READONLY,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAMultiSelectable
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"listbox",
|
|
|
|
nsIAccessibleRole::ROLE_LISTBOX,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
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,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAMultiSelectable,
|
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"listitem",
|
|
|
|
nsIAccessibleRole::ROLE_LISTITEM,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
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,
|
2009-06-29 15:24:36 +00:00
|
|
|
eARIASelectable,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIACheckedMixed
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2009-02-19 06:56:19 +00:00
|
|
|
{
|
|
|
|
"log",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseNativeRole,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
ePoliteLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2009-02-19 06:56:19 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"marquee",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseNativeRole,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eOffLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2009-02-19 06:56:19 +00:00
|
|
|
},
|
2008-10-08 12:54:58 +00:00
|
|
|
{
|
|
|
|
"math",
|
|
|
|
nsIAccessibleRole::ROLE_FLAT_EQUATION,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"menu",
|
|
|
|
nsIAccessibleRole::ROLE_MENUPOPUP,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
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,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"menubar",
|
|
|
|
nsIAccessibleRole::ROLE_MENUBAR,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"menuitem",
|
|
|
|
nsIAccessibleRole::ROLE_MENUITEM,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIACheckedMixed
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"menuitemcheckbox",
|
|
|
|
nsIAccessibleRole::ROLE_CHECK_MENU_ITEM,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableMixed
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"menuitemradio",
|
|
|
|
nsIAccessibleRole::ROLE_RADIO_MENU_ITEM,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableBool
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"option",
|
|
|
|
nsIAccessibleRole::ROLE_OPTION,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eSelectAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2009-06-29 15:24:36 +00:00
|
|
|
eARIASelectable,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIACheckedMixed
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"presentation",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"progressbar",
|
|
|
|
nsIAccessibleRole::ROLE_PROGRESSBAR,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
nsIAccessibleStates::STATE_READONLY
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"radio",
|
|
|
|
nsIAccessibleRole::ROLE_RADIOBUTTON,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eSelectAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableBool
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"radiogroup",
|
|
|
|
nsIAccessibleRole::ROLE_GROUPING,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"region",
|
|
|
|
nsIAccessibleRole::ROLE_PANE,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"row",
|
|
|
|
nsIAccessibleRole::ROLE_ROW,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
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,
|
2009-06-29 15:24:36 +00:00
|
|
|
eARIASelectable
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"rowheader",
|
|
|
|
nsIAccessibleRole::ROLE_ROWHEADER,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
2009-04-20 06:06:19 +00:00
|
|
|
eSortAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2009-06-29 15:24:36 +00:00
|
|
|
eARIASelectable,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2009-12-15 16:03:39 +00:00
|
|
|
{
|
|
|
|
"scrollbar",
|
|
|
|
nsIAccessibleRole::ROLE_SCROLLBAR,
|
|
|
|
kUseMapRole,
|
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
|
|
|
kNoReqStates,
|
|
|
|
eARIAOrientation,
|
|
|
|
eARIAReadonly
|
|
|
|
},
|
2008-10-08 12:54:58 +00:00
|
|
|
{
|
|
|
|
"separator",
|
|
|
|
nsIAccessibleRole::ROLE_SEPARATOR,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"slider",
|
|
|
|
nsIAccessibleRole::ROLE_SLIDER,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"spinbutton",
|
|
|
|
nsIAccessibleRole::ROLE_SPINBUTTON,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"status",
|
|
|
|
nsIAccessibleRole::ROLE_STATUSBAR,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 08:10:45 +00:00
|
|
|
ePoliteLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"tab",
|
|
|
|
nsIAccessibleRole::ROLE_PAGETAB,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eSwitchAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"tablist",
|
|
|
|
nsIAccessibleRole::ROLE_PAGETABLIST,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
ePoliteLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"tabpanel",
|
|
|
|
nsIAccessibleRole::ROLE_PROPERTYPAGE,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"textbox",
|
|
|
|
nsIAccessibleRole::ROLE_ENTRY,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eActivateAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAAutoComplete,
|
|
|
|
eARIAMultiline,
|
|
|
|
eARIAReadonlyOrEditable
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2009-02-19 06:56:19 +00:00
|
|
|
{
|
|
|
|
"timer",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseNativeRole,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eOffLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2009-02-19 06:56:19 +00:00
|
|
|
},
|
2008-10-08 12:54:58 +00:00
|
|
|
{
|
|
|
|
"toolbar",
|
|
|
|
nsIAccessibleRole::ROLE_TOOLBAR,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"tooltip",
|
|
|
|
nsIAccessibleRole::ROLE_TOOLTIP,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"tree",
|
|
|
|
nsIAccessibleRole::ROLE_OUTLINE,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
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,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAReadonly,
|
|
|
|
eARIAMultiSelectable
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"treegrid",
|
|
|
|
nsIAccessibleRole::ROLE_TREE_TABLE,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
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,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAReadonly,
|
|
|
|
eARIAMultiSelectable
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"treeitem",
|
|
|
|
nsIAccessibleRole::ROLE_OUTLINEITEM,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
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,
|
2009-06-29 15:24:36 +00:00
|
|
|
eARIASelectable,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIACheckedMixed
|
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,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseNativeRole,
|
2007-11-12 01:05:37 +00:00
|
|
|
eNoValue,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2007-06-05 15:41:07 +00:00
|
|
|
};
|
|
|
|
|
2008-02-07 04:14:59 +00:00
|
|
|
nsRoleMapEntry nsARIAMap::gEmptyRoleMap = {
|
|
|
|
"",
|
|
|
|
nsIAccessibleRole::ROLE_NOTHING,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-02-07 04:14:59 +00:00
|
|
|
eNoValue,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
|
|
|
};
|
|
|
|
|
|
|
|
nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
|
|
|
|
// eARIANone
|
|
|
|
nsStateMapEntry(),
|
|
|
|
|
|
|
|
// eARIAAutoComplete
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_autocomplete,
|
|
|
|
"inline", 0, nsIAccessibleStates::EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
|
|
|
"list", nsIAccessibleStates::STATE_HASPOPUP, nsIAccessibleStates::EXT_STATE_SUPPORTS_AUTOCOMPLETION,
|
|
|
|
"both", nsIAccessibleStates::STATE_HASPOPUP, nsIAccessibleStates::EXT_STATE_SUPPORTS_AUTOCOMPLETION),
|
|
|
|
|
|
|
|
// eARIABusy
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_busy,
|
|
|
|
"true", nsIAccessibleStates::STATE_BUSY, 0,
|
|
|
|
"error", nsIAccessibleStates::STATE_INVALID, 0),
|
|
|
|
|
|
|
|
// eARIACheckableBool
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_checked, kBoolType,
|
|
|
|
nsIAccessibleStates::STATE_CHECKABLE,
|
|
|
|
nsIAccessibleStates::STATE_CHECKED, 0,
|
|
|
|
0, 0, PR_TRUE),
|
|
|
|
|
|
|
|
// eARIACheckableMixed
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_checked, kMixedType,
|
|
|
|
nsIAccessibleStates::STATE_CHECKABLE,
|
|
|
|
nsIAccessibleStates::STATE_CHECKED, 0,
|
|
|
|
0, 0, PR_TRUE),
|
|
|
|
|
|
|
|
// eARIACheckedMixed
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_checked, kMixedType,
|
|
|
|
nsIAccessibleStates::STATE_CHECKABLE,
|
|
|
|
nsIAccessibleStates::STATE_CHECKED, 0),
|
|
|
|
|
|
|
|
// eARIADisabled
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_disabled, kBoolType, 0,
|
|
|
|
nsIAccessibleStates::STATE_UNAVAILABLE, 0),
|
|
|
|
|
|
|
|
// eARIAExpanded
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_expanded, kBoolType, 0,
|
|
|
|
nsIAccessibleStates::STATE_EXPANDED, 0,
|
|
|
|
nsIAccessibleStates::STATE_COLLAPSED, 0),
|
|
|
|
|
|
|
|
// eARIAHasPopup
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_haspopup, kBoolType, 0,
|
|
|
|
nsIAccessibleStates::STATE_HASPOPUP, 0),
|
|
|
|
|
|
|
|
// eARIAInvalid
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_invalid, kBoolType, 0,
|
|
|
|
nsIAccessibleStates::STATE_INVALID, 0),
|
|
|
|
|
|
|
|
// eARIAMultiline
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_multiline, kBoolType, 0,
|
|
|
|
0, nsIAccessibleStates::EXT_STATE_MULTI_LINE,
|
|
|
|
0, nsIAccessibleStates::EXT_STATE_SINGLE_LINE, PR_TRUE),
|
|
|
|
|
|
|
|
// eARIAMultiSelectable
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_multiselectable, kBoolType, 0,
|
|
|
|
nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE, 0),
|
|
|
|
|
2009-12-15 16:03:39 +00:00
|
|
|
// eARIAOrientation
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_orientation, eUseFirstState,
|
|
|
|
"vertical", 0, nsIAccessibleStates::EXT_STATE_VERTICAL,
|
|
|
|
"horizontal", 0, nsIAccessibleStates::EXT_STATE_HORIZONTAL),
|
|
|
|
|
2009-06-25 02:12:38 +00:00
|
|
|
// eARIAPressed
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_pressed, kMixedType,
|
|
|
|
nsIAccessibleStates::STATE_CHECKABLE,
|
|
|
|
nsIAccessibleStates::STATE_PRESSED, 0),
|
|
|
|
|
|
|
|
// eARIAReadonly
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_readonly, kBoolType, 0,
|
|
|
|
nsIAccessibleStates::STATE_READONLY, 0),
|
|
|
|
|
|
|
|
// eARIAReadonlyOrEditable
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_readonly, kBoolType, 0,
|
|
|
|
nsIAccessibleStates::STATE_READONLY, 0,
|
|
|
|
0, nsIAccessibleStates::EXT_STATE_EDITABLE, PR_TRUE),
|
|
|
|
|
|
|
|
// eARIARequired
|
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_required, kBoolType, 0,
|
|
|
|
nsIAccessibleStates::STATE_REQUIRED, 0),
|
|
|
|
|
2009-06-29 15:24:36 +00:00
|
|
|
// eARIASelectable
|
2009-06-25 02:12:38 +00:00
|
|
|
nsStateMapEntry(&nsAccessibilityAtoms::aria_selected, kBoolType,
|
|
|
|
nsIAccessibleStates::STATE_SELECTABLE,
|
2009-06-29 15:24:36 +00:00
|
|
|
nsIAccessibleStates::STATE_SELECTED, 0,
|
|
|
|
0, 0, PR_TRUE)
|
2008-02-07 04:14:59 +00:00
|
|
|
};
|
|
|
|
|
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:
|
|
|
|
*/
|
2009-06-25 02:12:38 +00:00
|
|
|
eStateMapEntryID nsARIAMap::gWAIUnivStateMap[] = {
|
|
|
|
eARIARequired,
|
|
|
|
eARIAInvalid,
|
|
|
|
eARIAHasPopup,
|
|
|
|
eARIABusy,
|
|
|
|
eARIADisabled,
|
|
|
|
eARIAExpanded,
|
|
|
|
eARIANone
|
2007-06-05 15:41:07 +00:00
|
|
|
};
|
|
|
|
|
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 },
|
2010-01-06 10:36:50 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_level, ATTR_BYPASSOBJ }, /* handled via groupPosition */
|
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 },
|
2009-12-15 16:03:39 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_orientation, ATTR_VALTOKEN },
|
2010-01-06 10:36:50 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_posinset, ATTR_BYPASSOBJ }, /* handled via groupPosition */
|
2009-03-10 20:44:43 +00:00
|
|
|
{&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 },
|
2010-01-06 10:36:50 +00:00
|
|
|
{&nsAccessibilityAtoms::aria_setsize, ATTR_BYPASSOBJ }, /* handled via groupPosition */
|
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);
|
2009-06-25 02:12:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsStateMapEntry
|
|
|
|
|
|
|
|
nsStateMapEntry:: nsStateMapEntry(nsIAtom **aAttrName, eStateValueType aType,
|
|
|
|
PRUint32 aPermanentState,
|
|
|
|
PRUint32 aTrueState, PRUint32 aTrueExtraState,
|
|
|
|
PRUint32 aFalseState, PRUint32 aFalseExtraState,
|
|
|
|
PRBool aDefinedIfAbsent) :
|
|
|
|
attributeName(aAttrName), isToken(PR_TRUE), permanentState(aPermanentState)
|
|
|
|
{
|
|
|
|
value1 = "false";
|
|
|
|
state1 = aFalseState;
|
|
|
|
extraState1 = aFalseExtraState;
|
|
|
|
|
|
|
|
if (aType == kMixedType) {
|
|
|
|
value2 = "mixed";
|
|
|
|
state2 = nsIAccessibleStates::STATE_MIXED;
|
|
|
|
extraState2 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultState = aTrueState;
|
|
|
|
defaultExtraState = aTrueExtraState;
|
|
|
|
|
|
|
|
definedIfAbsent = aDefinedIfAbsent;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsStateMapEntry::nsStateMapEntry(nsIAtom **aAttrName,
|
|
|
|
const char *aValue1,
|
|
|
|
PRUint32 aState1, PRUint32 aExtraState1,
|
|
|
|
const char *aValue2,
|
|
|
|
PRUint32 aState2, PRUint32 aExtraState2,
|
|
|
|
const char *aValue3,
|
|
|
|
PRUint32 aState3, PRUint32 aExtraState3) :
|
|
|
|
attributeName(aAttrName), isToken(PR_FALSE), permanentState(0),
|
|
|
|
value1(aValue1), state1(aState1), extraState1(aExtraState1),
|
|
|
|
value2(aValue2), state2(aState2), extraState2(aExtraState2),
|
|
|
|
value3(aValue3), state3(aState3), extraState3(aExtraState3),
|
|
|
|
defaultState(0), defaultExtraState(0), definedIfAbsent(PR_FALSE)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-12-15 16:03:39 +00:00
|
|
|
nsStateMapEntry::nsStateMapEntry(nsIAtom **aAttrName,
|
|
|
|
EDefaultStateRule aDefaultStateRule,
|
|
|
|
const char *aValue1,
|
|
|
|
PRUint32 aState1, PRUint32 aExtraState1,
|
|
|
|
const char *aValue2,
|
|
|
|
PRUint32 aState2, PRUint32 aExtraState2,
|
|
|
|
const char *aValue3,
|
|
|
|
PRUint32 aState3, PRUint32 aExtraState3) :
|
|
|
|
attributeName(aAttrName), isToken(PR_TRUE), permanentState(0),
|
|
|
|
value1(aValue1), state1(aState1), extraState1(aExtraState1),
|
|
|
|
value2(aValue2), state2(aState2), extraState2(aExtraState2),
|
|
|
|
value3(aValue3), state3(aState3), extraState3(aExtraState3),
|
|
|
|
defaultState(0), defaultExtraState(0), definedIfAbsent(PR_TRUE)
|
|
|
|
{
|
|
|
|
if (aDefaultStateRule == eUseFirstState) {
|
|
|
|
defaultState = aState1;
|
|
|
|
defaultExtraState = aExtraState1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-25 02:12:38 +00:00
|
|
|
PRBool
|
|
|
|
nsStateMapEntry::MapToStates(nsIContent *aContent,
|
|
|
|
PRUint32 *aState, PRUint32 *aExtraState,
|
|
|
|
eStateMapEntryID aStateMapEntryID)
|
|
|
|
{
|
|
|
|
// Return true if we should continue.
|
|
|
|
if (aStateMapEntryID == eARIANone)
|
|
|
|
return PR_FALSE;
|
|
|
|
|
|
|
|
const nsStateMapEntry& entry = nsARIAMap::gWAIStateMap[aStateMapEntryID];
|
|
|
|
|
|
|
|
if (entry.isToken) {
|
|
|
|
// If attribute is considered as defined when it's absent then let's act
|
|
|
|
// attribute value is "false" supposedly.
|
|
|
|
PRBool hasAttr = aContent->HasAttr(kNameSpaceID_None, *entry.attributeName);
|
|
|
|
if (entry.definedIfAbsent && !hasAttr) {
|
|
|
|
if (entry.permanentState)
|
|
|
|
*aState |= entry.permanentState;
|
|
|
|
if (entry.state1)
|
|
|
|
*aState |= entry.state1;
|
|
|
|
if (aExtraState && entry.extraState1)
|
|
|
|
*aExtraState |= entry.extraState1;
|
|
|
|
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We only have attribute state mappings for NMTOKEN (and boolean) based
|
|
|
|
// ARIA attributes. According to spec, a value of "undefined" is to be
|
|
|
|
// treated equivalent to "", or the absence of the attribute. We bail out
|
|
|
|
// for this case here.
|
|
|
|
// Note: If this method happens to be called with a non-token based
|
|
|
|
// attribute, for example: aria-label="" or aria-label="undefined", we will
|
|
|
|
// bail out and not explore a state mapping, which is safe.
|
|
|
|
if (!hasAttr ||
|
|
|
|
aContent->AttrValueIs(kNameSpaceID_None, *entry.attributeName,
|
|
|
|
nsAccessibilityAtoms::_empty, eCaseMatters) ||
|
|
|
|
aContent->AttrValueIs(kNameSpaceID_None, *entry.attributeName,
|
|
|
|
nsAccessibilityAtoms::_undefined, eCaseMatters)) {
|
|
|
|
|
|
|
|
if (entry.permanentState)
|
|
|
|
*aState &= ~entry.permanentState;
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (entry.permanentState)
|
|
|
|
*aState |= entry.permanentState;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsAutoString attrValue;
|
|
|
|
if (!aContent->GetAttr(kNameSpaceID_None, *entry.attributeName, attrValue))
|
|
|
|
return PR_TRUE;
|
|
|
|
|
|
|
|
// Apply states for matched value. If no values was matched then apply default
|
|
|
|
// states.
|
|
|
|
PRBool applyDefaultStates = PR_TRUE;
|
|
|
|
if (entry.value1) {
|
|
|
|
if (attrValue.EqualsASCII(entry.value1)) {
|
|
|
|
applyDefaultStates = PR_FALSE;
|
|
|
|
|
|
|
|
if (entry.state1)
|
|
|
|
*aState |= entry.state1;
|
|
|
|
|
|
|
|
if (aExtraState && entry.extraState1)
|
|
|
|
*aExtraState |= entry.extraState1;
|
|
|
|
|
|
|
|
} else if (entry.value2) {
|
|
|
|
if (attrValue.EqualsASCII(entry.value2)) {
|
|
|
|
applyDefaultStates = PR_FALSE;
|
|
|
|
|
|
|
|
if (entry.state2)
|
|
|
|
*aState |= entry.state2;
|
|
|
|
|
|
|
|
if (aExtraState && entry.extraState2)
|
|
|
|
*aExtraState |= entry.extraState2;
|
|
|
|
|
|
|
|
} else if (entry.value3) {
|
|
|
|
if (attrValue.EqualsASCII(entry.value3)) {
|
|
|
|
applyDefaultStates = PR_FALSE;
|
|
|
|
|
|
|
|
if (entry.state3)
|
|
|
|
*aState |= entry.state3;
|
|
|
|
|
|
|
|
if (aExtraState && entry.extraState3)
|
|
|
|
*aExtraState |= entry.extraState3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (applyDefaultStates) {
|
|
|
|
if (entry.defaultState)
|
|
|
|
*aState |= entry.defaultState;
|
|
|
|
if (entry.defaultExtraState && aExtraState)
|
|
|
|
*aExtraState |= entry.defaultExtraState;
|
|
|
|
}
|
|
|
|
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|