2007-06-05 08:41:07 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:expandtab:shiftwidth=2:tabstop=2:
|
|
|
|
*/
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-06-05 08:41:07 -07:00
|
|
|
|
2013-04-24 20:48:26 -07:00
|
|
|
#include "ARIAMap.h"
|
2010-12-01 00:53:17 -08:00
|
|
|
|
2012-08-10 13:10:18 -07:00
|
|
|
#include "nsAccUtils.h"
|
2012-04-16 02:24:23 -07:00
|
|
|
#include "nsCoreUtils.h"
|
2012-01-11 19:07:35 -08:00
|
|
|
#include "Role.h"
|
2011-04-09 16:38:06 -07:00
|
|
|
#include "States.h"
|
2007-06-05 08:41:07 -07:00
|
|
|
|
2012-08-10 13:10:18 -07:00
|
|
|
#include "nsAttrName.h"
|
2012-04-16 02:24:23 -07:00
|
|
|
#include "nsWhitespaceTokenizer.h"
|
2010-12-01 00:53:17 -08:00
|
|
|
|
2012-04-16 02:24:23 -07:00
|
|
|
using namespace mozilla;
|
2011-07-27 05:43:01 -07:00
|
|
|
using namespace mozilla::a11y;
|
2012-04-05 09:23:30 -07:00
|
|
|
using namespace mozilla::a11y::aria;
|
2011-07-27 05:43:01 -07:00
|
|
|
|
2012-11-10 18:16:17 -08:00
|
|
|
static const uint32_t kGenericAccType = 0;
|
|
|
|
|
2007-06-05 08:41:07 -07:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
2012-04-05 09:23:30 -07:00
|
|
|
* Definition of nsRoleMapEntry contains comments explaining this table.
|
2007-06-05 08:41:07 -07:00
|
|
|
*
|
2007-09-24 18:19:03 -07:00
|
|
|
* When no nsIAccessibleRole enum mapping exists for an ARIA role, the
|
2007-06-05 08:41:07 -07: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-24 19:12:38 -07:00
|
|
|
*/
|
2007-06-05 08:41:07 -07:00
|
|
|
|
2012-04-16 02:24:23 -07:00
|
|
|
static nsRoleMapEntry sWAIRoleMaps[] =
|
2007-06-05 08:41:07 -07:00
|
|
|
{
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // alert
|
|
|
|
&nsGkAtoms::alert,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::ALERT,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // alertdialog
|
|
|
|
&nsGkAtoms::alertdialog,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::DIALOG,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // application
|
|
|
|
&nsGkAtoms::application,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::APPLICATION,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // article
|
|
|
|
&nsGkAtoms::article,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::DOCUMENT,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 23:34:40 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2012-03-14 10:48:01 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eReadonlyUntilEditable
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // button
|
|
|
|
&nsGkAtoms::button,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::PUSHBUTTON,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
2012-02-01 17:13:09 -08:00
|
|
|
ePressAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2014-04-04 01:01:19 -07:00
|
|
|
eButton,
|
|
|
|
kNoReqStates
|
|
|
|
// eARIAPressed is auto applied on any button
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // checkbox
|
|
|
|
&nsGkAtoms::checkbox,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::CHECKBUTTON,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eCheckUncheckAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableMixed,
|
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // columnheader
|
|
|
|
&nsGkAtoms::columnheader,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::COLUMNHEADER,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
2009-04-19 23:06:19 -07:00
|
|
|
eSortAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eTableCell,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2013-07-19 08:20:51 -07:00
|
|
|
eARIASelectableIfDefined,
|
2013-04-04 19:10:17 -07:00
|
|
|
eARIAReadonlyOrEditableIfDefined
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // combobox
|
|
|
|
&nsGkAtoms::combobox,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::COMBOBOX,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2012-02-24 20:32:10 -08:00
|
|
|
eNoValue,
|
2008-10-08 05:54:58 -07:00
|
|
|
eOpenCloseAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::COLLAPSED | states::HASPOPUP | states::VERTICAL,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAAutoComplete,
|
2014-08-11 05:13:44 -07:00
|
|
|
eARIAReadonly,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // dialog
|
|
|
|
&nsGkAtoms::dialog,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::DIALOG,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // directory
|
|
|
|
&nsGkAtoms::directory,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::LIST,
|
2010-01-12 18:18:24 -08:00
|
|
|
kUseMapRole,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eList,
|
2010-01-12 18:18:24 -08:00
|
|
|
kNoReqStates
|
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // document
|
|
|
|
&nsGkAtoms::document,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::DOCUMENT,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 23:34:40 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2012-03-14 10:48:01 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eReadonlyUntilEditable
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // form
|
|
|
|
&nsGkAtoms::form,
|
2012-03-26 07:05:04 -07:00
|
|
|
roles::FORM,
|
|
|
|
kUseMapRole,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2012-03-26 07:05:04 -07:00
|
|
|
kNoReqStates
|
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // grid
|
|
|
|
&nsGkAtoms::grid,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::TABLE,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eSelect | eTable,
|
2013-07-26 03:26:44 -07:00
|
|
|
kNoReqStates,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAMultiSelectable,
|
2013-07-26 03:26:44 -07:00
|
|
|
eARIAReadonlyOrEditable,
|
|
|
|
eFocusableUntilDisabled
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // gridcell
|
|
|
|
&nsGkAtoms::gridcell,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::GRID_CELL,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eTableCell,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-29 08:24:36 -07:00
|
|
|
eARIASelectable,
|
2013-02-14 02:57:35 -08:00
|
|
|
eARIAReadonlyOrEditableIfDefined
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // group
|
|
|
|
&nsGkAtoms::group,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::GROUPING,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // heading
|
|
|
|
&nsGkAtoms::heading,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::HEADING,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // img
|
|
|
|
&nsGkAtoms::img,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::GRAPHIC,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2013-04-29 14:07:39 -07:00
|
|
|
{ // key
|
|
|
|
&nsGkAtoms::key,
|
|
|
|
roles::KEY,
|
|
|
|
kUseMapRole,
|
|
|
|
eNoValue,
|
|
|
|
ePressAction,
|
|
|
|
eNoLiveAttr,
|
|
|
|
kGenericAccType,
|
|
|
|
kNoReqStates,
|
|
|
|
eARIAPressed
|
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // link
|
|
|
|
&nsGkAtoms::link,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::LINK,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eJumpAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2011-04-09 16:38:06 -07:00
|
|
|
states::LINKED
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // list
|
|
|
|
&nsGkAtoms::list,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::LIST,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eList,
|
2012-02-10 10:25:48 -08:00
|
|
|
states::READONLY
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // listbox
|
|
|
|
&nsGkAtoms::listbox,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::LISTBOX,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-12-22 16:54:13 -08:00
|
|
|
eListControl | eSelect,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::VERTICAL,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAMultiSelectable,
|
2013-07-26 03:26:44 -07:00
|
|
|
eARIAReadonly,
|
2014-08-11 05:13:44 -07:00
|
|
|
eFocusableUntilDisabled,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // listitem
|
|
|
|
&nsGkAtoms::listitem,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::LISTITEM,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction, // XXX: should depend on state, parent accessible
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2012-02-10 10:25:48 -08:00
|
|
|
states::READONLY
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // log
|
|
|
|
&nsGkAtoms::log_,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::NOTHING,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseNativeRole,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
ePoliteLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2009-02-18 22:56:19 -08:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // marquee
|
|
|
|
&nsGkAtoms::marquee,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::ANIMATION,
|
2010-01-12 18:18:24 -08:00
|
|
|
kUseMapRole,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eOffLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2009-02-18 22:56:19 -08:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // math
|
|
|
|
&nsGkAtoms::math,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::FLAT_EQUATION,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // menu
|
|
|
|
&nsGkAtoms::menu,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::MENUPOPUP,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction, // XXX: technically accessibles of menupopup role haven't
|
|
|
|
// any action, but menu can be open or close.
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::VERTICAL,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // menubar
|
|
|
|
&nsGkAtoms::menubar,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::MENUBAR,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::HORIZONTAL,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // menuitem
|
|
|
|
&nsGkAtoms::menuitem,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::MENUITEM,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIACheckedMixed
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // menuitemcheckbox
|
|
|
|
&nsGkAtoms::menuitemcheckbox,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::CHECK_MENU_ITEM,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableMixed
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // menuitemradio
|
|
|
|
&nsGkAtoms::menuitemradio,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::RADIO_MENU_ITEM,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eClickAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableBool
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // note
|
|
|
|
&nsGkAtoms::note_,
|
2012-03-22 22:23:46 -07:00
|
|
|
roles::NOTE,
|
|
|
|
kUseMapRole,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2012-03-22 22:23:46 -07:00
|
|
|
kNoReqStates
|
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // option
|
|
|
|
&nsGkAtoms::option,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::OPTION,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eSelectAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-29 08:24:36 -07:00
|
|
|
eARIASelectable,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIACheckedMixed
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // presentation
|
|
|
|
&nsGkAtoms::presentation,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::NOTHING,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // progressbar
|
|
|
|
&nsGkAtoms::progressbar,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::PROGRESSBAR,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2012-04-12 15:44:16 -07:00
|
|
|
states::READONLY,
|
|
|
|
eIndeterminateIfNoValue
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // radio
|
|
|
|
&nsGkAtoms::radio,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::RADIOBUTTON,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eSelectAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableBool
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // radiogroup
|
|
|
|
&nsGkAtoms::radiogroup,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::GROUPING,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2014-08-11 05:13:44 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // region
|
|
|
|
&nsGkAtoms::region,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::PANE,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // row
|
|
|
|
&nsGkAtoms::row,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::ROW,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eTableRow,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-29 08:24:36 -07:00
|
|
|
eARIASelectable
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-11-16 23:59:55 -08:00
|
|
|
{ // rowgroup
|
|
|
|
&nsGkAtoms::rowgroup,
|
|
|
|
roles::GROUPING,
|
|
|
|
kUseMapRole,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
|
|
|
kGenericAccType,
|
|
|
|
kNoReqStates
|
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // rowheader
|
|
|
|
&nsGkAtoms::rowheader,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::ROWHEADER,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
2009-04-19 23:06:19 -07:00
|
|
|
eSortAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eTableCell,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2013-07-19 08:20:51 -07:00
|
|
|
eARIASelectableIfDefined,
|
2013-04-04 19:10:17 -07:00
|
|
|
eARIAReadonlyOrEditableIfDefined
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // scrollbar
|
|
|
|
&nsGkAtoms::scrollbar,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::SCROLLBAR,
|
2009-12-15 08:03:39 -08:00
|
|
|
kUseMapRole,
|
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::VERTICAL,
|
2009-12-15 08:03:39 -08:00
|
|
|
eARIAOrientation,
|
|
|
|
eARIAReadonly
|
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // separator
|
|
|
|
&nsGkAtoms::separator_,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::SEPARATOR,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::HORIZONTAL,
|
2011-11-17 05:18:54 -08:00
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // slider
|
|
|
|
&nsGkAtoms::slider,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::SLIDER,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::HORIZONTAL,
|
2011-11-17 05:18:54 -08:00
|
|
|
eARIAOrientation,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // spinbutton
|
|
|
|
&nsGkAtoms::spinbutton,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::SPINBUTTON,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // status
|
|
|
|
&nsGkAtoms::status,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::STATUSBAR,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-19 00:10:45 -08:00
|
|
|
ePoliteLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // tab
|
|
|
|
&nsGkAtoms::tab,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::PAGETAB,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eSwitchAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2011-05-24 07:02:44 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIASelectable
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // tablist
|
|
|
|
&nsGkAtoms::tablist,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::PAGETABLIST,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2013-07-24 00:04:49 -07:00
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eSelect,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::HORIZONTAL,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // tabpanel
|
|
|
|
&nsGkAtoms::tabpanel,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::PROPERTYPAGE,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // textbox
|
|
|
|
&nsGkAtoms::textbox,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::ENTRY,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eActivateAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAAutoComplete,
|
|
|
|
eARIAMultiline,
|
|
|
|
eARIAReadonlyOrEditable
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // timer
|
|
|
|
&nsGkAtoms::timer,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::NOTHING,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseNativeRole,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eOffLiveAttr,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2009-02-18 22:56:19 -08:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // toolbar
|
|
|
|
&nsGkAtoms::toolbar,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::TOOLBAR,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::HORIZONTAL,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // tooltip
|
|
|
|
&nsGkAtoms::tooltip,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::TOOLTIP,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // tree
|
|
|
|
&nsGkAtoms::tree,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::OUTLINE,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eSelect,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::VERTICAL,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAReadonly,
|
2013-07-26 03:26:44 -07:00
|
|
|
eARIAMultiSelectable,
|
2014-08-11 05:13:44 -07:00
|
|
|
eFocusableUntilDisabled,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // treegrid
|
|
|
|
&nsGkAtoms::treegrid,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::TREE_TABLE,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-12-17 21:22:26 -08:00
|
|
|
eSelect | eTable,
|
2014-08-11 05:13:44 -07:00
|
|
|
states::VERTICAL,
|
2013-07-30 08:43:00 -07:00
|
|
|
eARIAReadonlyOrEditable,
|
2013-07-26 03:26:44 -07:00
|
|
|
eARIAMultiSelectable,
|
2014-08-11 05:13:44 -07:00
|
|
|
eFocusableUntilDisabled,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2012-06-10 16:44:50 -07:00
|
|
|
{ // treeitem
|
|
|
|
&nsGkAtoms::treeitem,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::OUTLINEITEM,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoValue,
|
|
|
|
eActivateAction, // XXX: should expose second 'expand/collapse' action based
|
|
|
|
// on states
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-29 08:24:36 -07:00
|
|
|
eARIASelectable,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIACheckedMixed
|
2009-02-18 23:23:44 -08:00
|
|
|
}
|
2007-11-11 17:05:37 -08:00
|
|
|
};
|
|
|
|
|
2012-04-16 02:24:23 -07:00
|
|
|
static nsRoleMapEntry sLandmarkRoleMap = {
|
2012-06-10 16:44:50 -07:00
|
|
|
&nsGkAtoms::_empty,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::NOTHING,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseNativeRole,
|
2007-11-11 17:05:37 -08:00
|
|
|
eNoValue,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2007-06-05 08:41:07 -07:00
|
|
|
};
|
|
|
|
|
2013-04-24 20:48:26 -07:00
|
|
|
nsRoleMapEntry aria::gEmptyRoleMap = {
|
2012-06-10 16:44:50 -07:00
|
|
|
&nsGkAtoms::_empty,
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::NOTHING,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-02-06 20:14:59 -08:00
|
|
|
eNoValue,
|
2008-10-08 05:54:58 -07:00
|
|
|
eNoAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2012-11-10 18:16:17 -08:00
|
|
|
kGenericAccType,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
|
|
|
};
|
|
|
|
|
2007-06-05 08:41:07 -07:00
|
|
|
/**
|
2010-03-18 06:49:28 -07:00
|
|
|
* Universal (Global) states:
|
2007-06-05 08:41:07 -07:00
|
|
|
* The following state rules are applied to any accessible element,
|
|
|
|
* whether there is an ARIA role or not:
|
|
|
|
*/
|
2012-07-10 18:00:30 -07:00
|
|
|
static const EStateRule sWAIUnivStateMap[] = {
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIABusy,
|
|
|
|
eARIADisabled,
|
2010-03-18 06:49:28 -07:00
|
|
|
eARIAExpanded, // Currently under spec review but precedent exists
|
|
|
|
eARIAHasPopup, // Note this is technically a "property"
|
|
|
|
eARIAInvalid,
|
|
|
|
eARIARequired, // XXX not global, Bug 553117
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIANone
|
2007-06-05 08:41:07 -07:00
|
|
|
};
|
|
|
|
|
2009-02-15 00:15:31 -08:00
|
|
|
|
|
|
|
/**
|
2013-04-24 20:48:26 -07:00
|
|
|
* ARIA attribute map for attribute characteristics.
|
|
|
|
* @note ARIA attributes that don't have any flags are not included here.
|
2009-02-15 00:15:31 -08:00
|
|
|
*/
|
2013-04-24 20:48:26 -07:00
|
|
|
|
|
|
|
struct AttrCharacteristics
|
|
|
|
{
|
|
|
|
nsIAtom** attributeName;
|
|
|
|
const uint8_t characteristics;
|
|
|
|
};
|
|
|
|
|
|
|
|
static const AttrCharacteristics gWAIUnivAttrMap[] = {
|
2012-11-10 02:26:58 -08:00
|
|
|
{&nsGkAtoms::aria_activedescendant, ATTR_BYPASSOBJ },
|
2013-06-25 15:11:39 -07:00
|
|
|
{&nsGkAtoms::aria_atomic, ATTR_BYPASSOBJ_IF_FALSE | ATTR_VALTOKEN | ATTR_GLOBAL },
|
2012-11-10 02:26:58 -08:00
|
|
|
{&nsGkAtoms::aria_busy, ATTR_VALTOKEN | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_checked, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, /* exposes checkable obj attr */
|
|
|
|
{&nsGkAtoms::aria_controls, ATTR_BYPASSOBJ | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_describedby, ATTR_BYPASSOBJ | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_disabled, ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_dropeffect, ATTR_VALTOKEN | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_expanded, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_flowto, ATTR_BYPASSOBJ | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_grabbed, ATTR_VALTOKEN | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_haspopup, ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
|
2013-02-10 16:54:14 -08:00
|
|
|
{&nsGkAtoms::aria_hidden, ATTR_BYPASSOBJ_IF_FALSE | ATTR_VALTOKEN | ATTR_GLOBAL },
|
2012-11-10 02:26:58 -08:00
|
|
|
{&nsGkAtoms::aria_invalid, ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_label, ATTR_BYPASSOBJ | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_labelledby, ATTR_BYPASSOBJ | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_level, ATTR_BYPASSOBJ }, /* handled via groupPosition */
|
|
|
|
{&nsGkAtoms::aria_live, ATTR_VALTOKEN | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_multiline, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_multiselectable, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_owns, ATTR_BYPASSOBJ | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_orientation, ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_posinset, ATTR_BYPASSOBJ }, /* handled via groupPosition */
|
|
|
|
{&nsGkAtoms::aria_pressed, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_readonly, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_relevant, ATTR_BYPASSOBJ | ATTR_GLOBAL },
|
|
|
|
{&nsGkAtoms::aria_required, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_selected, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_setsize, ATTR_BYPASSOBJ }, /* handled via groupPosition */
|
|
|
|
{&nsGkAtoms::aria_sort, ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_valuenow, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_valuemin, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_valuemax, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_valuetext, ATTR_BYPASSOBJ }
|
2009-02-15 00:15:31 -08:00
|
|
|
};
|
|
|
|
|
2012-04-16 02:24:23 -07:00
|
|
|
nsRoleMapEntry*
|
|
|
|
aria::GetRoleMap(nsINode* aNode)
|
|
|
|
{
|
|
|
|
nsIContent* content = nsCoreUtils::GetRoleContent(aNode);
|
2012-06-10 16:44:50 -07:00
|
|
|
nsAutoString roles;
|
2012-04-16 02:24:23 -07:00
|
|
|
if (!content ||
|
2012-06-10 16:44:50 -07:00
|
|
|
!content->GetAttr(kNameSpaceID_None, nsGkAtoms::role, roles) ||
|
|
|
|
roles.IsEmpty()) {
|
2012-04-16 02:24:23 -07:00
|
|
|
// We treat role="" as if the role attribute is absent (per aria spec:8.1.1)
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2012-04-16 02:24:23 -07:00
|
|
|
}
|
|
|
|
|
2012-06-10 16:44:50 -07:00
|
|
|
nsWhitespaceTokenizer tokenizer(roles);
|
2012-04-16 02:24:23 -07:00
|
|
|
while (tokenizer.hasMoreTokens()) {
|
|
|
|
// Do a binary search through table for the next role in role list
|
2012-06-10 16:44:50 -07:00
|
|
|
const nsDependentSubstring role = tokenizer.nextToken();
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t low = 0;
|
|
|
|
uint32_t high = ArrayLength(sWAIRoleMaps);
|
2012-04-16 02:24:23 -07:00
|
|
|
while (low < high) {
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t idx = (low + high) / 2;
|
|
|
|
int32_t compare = Compare(role, sWAIRoleMaps[idx].ARIARoleString());
|
2012-06-10 16:44:50 -07:00
|
|
|
if (compare == 0)
|
2012-04-16 02:24:23 -07:00
|
|
|
return sWAIRoleMaps + idx;
|
|
|
|
|
|
|
|
if (compare < 0)
|
|
|
|
high = idx;
|
|
|
|
else
|
|
|
|
low = idx + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Always use some entry if there is a non-empty role string
|
|
|
|
// To ensure an accessible object is created
|
|
|
|
return &sLandmarkRoleMap;
|
|
|
|
}
|
2012-07-10 18:00:30 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint64_t
|
2012-07-10 18:00:30 -07:00
|
|
|
aria::UniversalStatesFor(mozilla::dom::Element* aElement)
|
|
|
|
{
|
2012-08-22 08:56:38 -07:00
|
|
|
uint64_t state = 0;
|
|
|
|
uint32_t index = 0;
|
2012-07-10 18:00:30 -07:00
|
|
|
while (MapToState(sWAIUnivStateMap[index], aElement, &state))
|
|
|
|
index++;
|
|
|
|
|
|
|
|
return state;
|
|
|
|
}
|
2012-08-10 13:10:18 -07:00
|
|
|
|
2013-04-24 20:48:26 -07:00
|
|
|
uint8_t
|
|
|
|
aria::AttrCharacteristicsFor(nsIAtom* aAtom)
|
|
|
|
{
|
|
|
|
for (uint32_t i = 0; i < ArrayLength(gWAIUnivAttrMap); i++)
|
|
|
|
if (*gWAIUnivAttrMap[i].attributeName == aAtom)
|
|
|
|
return gWAIUnivAttrMap[i].characteristics;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-08-10 13:10:18 -07:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// AttrIterator class
|
|
|
|
|
|
|
|
bool
|
|
|
|
AttrIterator::Next(nsAString& aAttrName, nsAString& aAttrValue)
|
|
|
|
{
|
|
|
|
while (mAttrIdx < mAttrCount) {
|
|
|
|
const nsAttrName* attr = mContent->GetAttrNameAt(mAttrIdx);
|
|
|
|
mAttrIdx++;
|
|
|
|
if (attr->NamespaceEquals(kNameSpaceID_None)) {
|
|
|
|
nsIAtom* attrAtom = attr->Atom();
|
|
|
|
nsDependentAtomString attrStr(attrAtom);
|
|
|
|
if (!StringBeginsWith(attrStr, NS_LITERAL_STRING("aria-")))
|
|
|
|
continue; // Not ARIA
|
|
|
|
|
2013-04-24 20:48:26 -07:00
|
|
|
uint8_t attrFlags = aria::AttrCharacteristicsFor(attrAtom);
|
2012-08-10 13:10:18 -07:00
|
|
|
if (attrFlags & ATTR_BYPASSOBJ)
|
|
|
|
continue; // No need to handle exposing as obj attribute here
|
|
|
|
|
|
|
|
if ((attrFlags & ATTR_VALTOKEN) &&
|
|
|
|
!nsAccUtils::HasDefinedARIAToken(mContent, attrAtom))
|
|
|
|
continue; // only expose token based attributes if they are defined
|
|
|
|
|
2013-02-10 16:54:14 -08:00
|
|
|
if ((attrFlags & ATTR_BYPASSOBJ_IF_FALSE) &&
|
|
|
|
mContent->AttrValueIs(kNameSpaceID_None, attrAtom,
|
|
|
|
nsGkAtoms::_false, eCaseMatters)) {
|
|
|
|
continue; // only expose token based attribute if value is not 'false'.
|
|
|
|
}
|
|
|
|
|
2012-08-10 13:10:18 -07:00
|
|
|
nsAutoString value;
|
|
|
|
if (mContent->GetAttr(kNameSpaceID_None, attrAtom, value)) {
|
|
|
|
aAttrName.Assign(Substring(attrStr, 5));
|
|
|
|
aAttrValue.Assign(value);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|