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:
|
|
|
|
*/
|
2012-05-21 11:12:37 +00: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 15:41:07 +00:00
|
|
|
|
|
|
|
#include "nsARIAMap.h"
|
2010-12-01 08:53:17 +00:00
|
|
|
|
2012-11-11 02:16:17 +00:00
|
|
|
#include "Accessible.h"
|
2012-08-10 20:10:18 +00:00
|
|
|
#include "nsAccUtils.h"
|
2012-04-16 09:24:23 +00:00
|
|
|
#include "nsCoreUtils.h"
|
2012-01-12 03:07:35 +00:00
|
|
|
#include "Role.h"
|
2011-04-09 23:38:06 +00:00
|
|
|
#include "States.h"
|
2007-06-05 15:41:07 +00:00
|
|
|
|
2012-08-10 20:10:18 +00:00
|
|
|
#include "nsAttrName.h"
|
2012-04-16 09:24:23 +00:00
|
|
|
#include "nsWhitespaceTokenizer.h"
|
2010-12-01 08:53:17 +00:00
|
|
|
|
2012-04-16 09:24:23 +00:00
|
|
|
using namespace mozilla;
|
2011-07-27 12:43:01 +00:00
|
|
|
using namespace mozilla::a11y;
|
2012-04-05 16:23:30 +00:00
|
|
|
using namespace mozilla::a11y::aria;
|
2011-07-27 12:43:01 +00:00
|
|
|
|
2012-11-11 02:16:17 +00:00
|
|
|
static const uint32_t kGenericAccType = 0;
|
|
|
|
|
2007-06-05 15:41:07 +00: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 16:23:30 +00:00
|
|
|
* Definition of nsRoleMapEntry contains comments explaining this table.
|
2007-06-05 15:41:07 +00:00
|
|
|
*
|
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
|
|
|
|
2012-04-16 09:24:23 +00:00
|
|
|
static nsRoleMapEntry sWAIRoleMaps[] =
|
2007-06-05 15:41:07 +00:00
|
|
|
{
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // alert
|
|
|
|
&nsGkAtoms::alert,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // alertdialog
|
|
|
|
&nsGkAtoms::alertdialog,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // application
|
|
|
|
&nsGkAtoms::application,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // article
|
|
|
|
&nsGkAtoms::article,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2012-03-14 17:48:01 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eReadonlyUntilEditable
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // button
|
|
|
|
&nsGkAtoms::button,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::PUSHBUTTON,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2008-10-08 12:54:58 +00:00
|
|
|
eNoValue,
|
2012-02-02 01:13:09 +00:00
|
|
|
ePressAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // checkbox
|
|
|
|
&nsGkAtoms::checkbox,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableMixed,
|
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // columnheader
|
|
|
|
&nsGkAtoms::columnheader,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // combobox
|
|
|
|
&nsGkAtoms::combobox,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::COMBOBOX,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseMapRole,
|
2012-02-25 04:32:10 +00:00
|
|
|
eNoValue,
|
2008-10-08 12:54:58 +00:00
|
|
|
eOpenCloseAction,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoLiveAttr,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2011-04-09 23:38:06 +00:00
|
|
|
states::COLLAPSED | states::HASPOPUP,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAAutoComplete,
|
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // dialog
|
|
|
|
&nsGkAtoms::dialog,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // directory
|
|
|
|
&nsGkAtoms::directory,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::LIST,
|
2010-01-13 02:18:24 +00:00
|
|
|
kUseMapRole,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2010-01-13 02:18:24 +00:00
|
|
|
kNoReqStates
|
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // document
|
|
|
|
&nsGkAtoms::document,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2012-03-14 17:48:01 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eReadonlyUntilEditable
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // form
|
|
|
|
&nsGkAtoms::form,
|
2012-03-26 14:05:04 +00:00
|
|
|
roles::FORM,
|
|
|
|
kUseMapRole,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2012-03-26 14:05:04 +00:00
|
|
|
kNoReqStates
|
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // grid
|
|
|
|
&nsGkAtoms::grid,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
Accessible::eSelectAccessible,
|
2011-04-09 23:38:06 +00:00
|
|
|
states::FOCUSABLE,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAMultiSelectable,
|
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // gridcell
|
|
|
|
&nsGkAtoms::gridcell,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // group
|
|
|
|
&nsGkAtoms::group,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // heading
|
|
|
|
&nsGkAtoms::heading,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // img
|
|
|
|
&nsGkAtoms::img,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // link
|
|
|
|
&nsGkAtoms::link,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2011-04-09 23:38:06 +00:00
|
|
|
states::LINKED
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // list
|
|
|
|
&nsGkAtoms::list,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2012-02-10 18:25:48 +00:00
|
|
|
states::READONLY
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // listbox
|
|
|
|
&nsGkAtoms::listbox,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
Accessible::eSelectAccessible,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // listitem
|
|
|
|
&nsGkAtoms::listitem,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2012-02-10 18:25:48 +00:00
|
|
|
states::READONLY
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // log
|
|
|
|
&nsGkAtoms::log_,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::NOTHING,
|
2009-06-11 18:18:24 +00:00
|
|
|
kUseNativeRole,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
ePoliteLiveAttr,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2009-02-19 06:56:19 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // marquee
|
|
|
|
&nsGkAtoms::marquee,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::ANIMATION,
|
2010-01-13 02:18:24 +00:00
|
|
|
kUseMapRole,
|
2009-02-19 06:56:19 +00:00
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eOffLiveAttr,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2009-02-19 06:56:19 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // math
|
|
|
|
&nsGkAtoms::math,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // menu
|
|
|
|
&nsGkAtoms::menu,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // menubar
|
|
|
|
&nsGkAtoms::menubar,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // menuitem
|
|
|
|
&nsGkAtoms::menuitem,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // menuitemcheckbox
|
|
|
|
&nsGkAtoms::menuitemcheckbox,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableMixed
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // menuitemradio
|
|
|
|
&nsGkAtoms::menuitemradio,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableBool
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // note
|
|
|
|
&nsGkAtoms::note_,
|
2012-03-23 05:23:46 +00:00
|
|
|
roles::NOTE,
|
|
|
|
kUseMapRole,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2012-03-23 05:23:46 +00:00
|
|
|
kNoReqStates
|
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // option
|
|
|
|
&nsGkAtoms::option,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // presentation
|
|
|
|
&nsGkAtoms::presentation,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // progressbar
|
|
|
|
&nsGkAtoms::progressbar,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2012-04-12 22:44:16 +00:00
|
|
|
states::READONLY,
|
|
|
|
eIndeterminateIfNoValue
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // radio
|
|
|
|
&nsGkAtoms::radio,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableBool
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // radiogroup
|
|
|
|
&nsGkAtoms::radiogroup,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // region
|
|
|
|
&nsGkAtoms::region,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // row
|
|
|
|
&nsGkAtoms::row,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // rowheader
|
|
|
|
&nsGkAtoms::rowheader,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // scrollbar
|
|
|
|
&nsGkAtoms::scrollbar,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::SCROLLBAR,
|
2009-12-15 16:03:39 +00:00
|
|
|
kUseMapRole,
|
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-12-15 16:03:39 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIAOrientation,
|
|
|
|
eARIAReadonly
|
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // separator
|
|
|
|
&nsGkAtoms::separator_,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2011-11-17 13:18:54 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIAOrientation
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // slider
|
|
|
|
&nsGkAtoms::slider,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2008-10-08 12:54:58 +00:00
|
|
|
kNoReqStates,
|
2011-11-17 13:18:54 +00:00
|
|
|
eARIAOrientation,
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIAReadonly
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // spinbutton
|
|
|
|
&nsGkAtoms::spinbutton,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // status
|
|
|
|
&nsGkAtoms::status,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // tab
|
|
|
|
&nsGkAtoms::tab,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2011-05-24 14:02:44 +00:00
|
|
|
kNoReqStates,
|
|
|
|
eARIASelectable
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // tablist
|
|
|
|
&nsGkAtoms::tablist,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
Accessible::eSelectAccessible,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // tabpanel
|
|
|
|
&nsGkAtoms::tabpanel,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // textbox
|
|
|
|
&nsGkAtoms::textbox,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // timer
|
|
|
|
&nsGkAtoms::timer,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // toolbar
|
|
|
|
&nsGkAtoms::toolbar,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // tooltip
|
|
|
|
&nsGkAtoms::tooltip,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
2008-10-08 12:54:58 +00:00
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // tree
|
|
|
|
&nsGkAtoms::tree,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
Accessible::eSelectAccessible,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // treegrid
|
|
|
|
&nsGkAtoms::treegrid,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
Accessible::eSelectAccessible,
|
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
|
|
|
},
|
2012-06-10 23:44:50 +00:00
|
|
|
{ // treeitem
|
|
|
|
&nsGkAtoms::treeitem,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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
|
|
|
};
|
|
|
|
|
2012-04-16 09:24:23 +00:00
|
|
|
static nsRoleMapEntry sLandmarkRoleMap = {
|
2012-06-10 23:44:50 +00:00
|
|
|
&nsGkAtoms::_empty,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
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 = {
|
2012-06-10 23:44:50 +00:00
|
|
|
&nsGkAtoms::_empty,
|
2012-01-12 03:07:35 +00:00
|
|
|
roles::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,
|
2012-11-11 02:16:17 +00:00
|
|
|
kGenericAccType,
|
2009-06-25 02:12:38 +00:00
|
|
|
kNoReqStates
|
|
|
|
};
|
|
|
|
|
2007-06-05 15:41:07 +00:00
|
|
|
/**
|
2010-03-18 13:49:28 +00:00
|
|
|
* Universal (Global) states:
|
2007-06-05 15:41:07 +00:00
|
|
|
* The following state rules are applied to any accessible element,
|
|
|
|
* whether there is an ARIA role or not:
|
|
|
|
*/
|
2012-07-11 01:00:30 +00:00
|
|
|
static const EStateRule sWAIUnivStateMap[] = {
|
2009-06-25 02:12:38 +00:00
|
|
|
eARIABusy,
|
|
|
|
eARIADisabled,
|
2010-03-18 13:49:28 +00: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-25 02:12:38 +00:00
|
|
|
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[] = {
|
2012-11-10 10:26:58 +00:00
|
|
|
{&nsGkAtoms::aria_activedescendant, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_atomic, ATTR_VALTOKEN | ATTR_GLOBAL },
|
|
|
|
{&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 },
|
|
|
|
{&nsGkAtoms::aria_hidden, ATTR_VALTOKEN | ATTR_GLOBAL },/* always expose obj attr */
|
|
|
|
{&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 08:15:31 +00:00
|
|
|
};
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t
|
2012-07-11 01:00:30 +00:00
|
|
|
nsARIAMap::gWAIUnivAttrMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIUnivAttrMap);
|
2012-04-16 09:24:23 +00:00
|
|
|
|
|
|
|
nsRoleMapEntry*
|
|
|
|
aria::GetRoleMap(nsINode* aNode)
|
|
|
|
{
|
|
|
|
nsIContent* content = nsCoreUtils::GetRoleContent(aNode);
|
2012-06-10 23:44:50 +00:00
|
|
|
nsAutoString roles;
|
2012-04-16 09:24:23 +00:00
|
|
|
if (!content ||
|
2012-06-10 23:44:50 +00:00
|
|
|
!content->GetAttr(kNameSpaceID_None, nsGkAtoms::role, roles) ||
|
|
|
|
roles.IsEmpty()) {
|
2012-04-16 09:24:23 +00:00
|
|
|
// We treat role="" as if the role attribute is absent (per aria spec:8.1.1)
|
2012-07-30 14:20:58 +00:00
|
|
|
return nullptr;
|
2012-04-16 09:24:23 +00:00
|
|
|
}
|
|
|
|
|
2012-06-10 23:44:50 +00:00
|
|
|
nsWhitespaceTokenizer tokenizer(roles);
|
2012-04-16 09:24:23 +00:00
|
|
|
while (tokenizer.hasMoreTokens()) {
|
|
|
|
// Do a binary search through table for the next role in role list
|
2012-06-10 23:44:50 +00:00
|
|
|
const nsDependentSubstring role = tokenizer.nextToken();
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t low = 0;
|
|
|
|
uint32_t high = ArrayLength(sWAIRoleMaps);
|
2012-04-16 09:24:23 +00:00
|
|
|
while (low < high) {
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t idx = (low + high) / 2;
|
|
|
|
int32_t compare = Compare(role, sWAIRoleMaps[idx].ARIARoleString());
|
2012-06-10 23:44:50 +00:00
|
|
|
if (compare == 0)
|
2012-04-16 09:24:23 +00: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-11 01:00:30 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint64_t
|
2012-07-11 01:00:30 +00:00
|
|
|
aria::UniversalStatesFor(mozilla::dom::Element* aElement)
|
|
|
|
{
|
2012-08-22 15:56:38 +00:00
|
|
|
uint64_t state = 0;
|
|
|
|
uint32_t index = 0;
|
2012-07-11 01:00:30 +00:00
|
|
|
while (MapToState(sWAIUnivStateMap[index], aElement, &state))
|
|
|
|
index++;
|
|
|
|
|
|
|
|
return state;
|
|
|
|
}
|
2012-08-10 20:10:18 +00: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
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t attrFlags = nsAccUtils::GetAttributeCharacteristics(attrAtom);
|
2012-08-10 20:10:18 +00: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
|
|
|
|
|
|
|
|
nsAutoString value;
|
|
|
|
if (mContent->GetAttr(kNameSpaceID_None, attrAtom, value)) {
|
|
|
|
aAttrName.Assign(Substring(attrStr, 5));
|
|
|
|
aAttrValue.Assign(value);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|