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:
|
|
|
|
*/
|
|
|
|
/* ***** 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"
|
2010-12-01 00:53:17 -08:00
|
|
|
|
2007-06-05 08:41:07 -07:00
|
|
|
#include "nsIAccessibleRole.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
|
|
|
|
2010-12-01 00:53:17 -08:00
|
|
|
#include "nsIContent.h"
|
|
|
|
|
2011-07-27 05:43:01 -07:00
|
|
|
using namespace mozilla::a11y;
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* Definition of nsRoleMapEntry and nsStateMapEntry contains comments explaining this table.
|
|
|
|
*
|
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
|
|
|
|
|
|
|
nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
|
|
|
|
{
|
2008-10-08 05:54:58 -07:00
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2011-04-09 16:38:06 -07:00
|
|
|
states::READONLY
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAPressed
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableMixed,
|
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
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
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"combobox",
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::COMBOBOX,
|
2009-06-11 11:18:24 -07:00
|
|
|
kUseMapRole,
|
2008-10-08 05:54:58 -07:00
|
|
|
eHasValueMinMax,
|
|
|
|
eOpenCloseAction,
|
2009-02-18 22:56:19 -08:00
|
|
|
eNoLiveAttr,
|
2011-04-09 16:38:06 -07:00
|
|
|
states::COLLAPSED | states::HASPOPUP,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAAutoComplete,
|
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2010-01-12 18:18:24 -08:00
|
|
|
{
|
|
|
|
"directory",
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::LIST,
|
2010-01-12 18:18:24 -08:00
|
|
|
kUseMapRole,
|
|
|
|
eNoValue,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
|
|
|
kNoReqStates
|
|
|
|
},
|
2008-10-08 05:54:58 -07:00
|
|
|
{
|
|
|
|
"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,
|
2011-04-09 16:38:06 -07:00
|
|
|
states::READONLY
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2011-04-09 16:38:06 -07:00
|
|
|
states::FOCUSABLE,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAMultiSelectable,
|
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
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
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2011-04-09 16:38:06 -07:00
|
|
|
states::LINKED
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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-02-10 10:25:48 -08:00
|
|
|
states::READONLY
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAMultiSelectable,
|
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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-02-10 10:25:48 -08:00
|
|
|
states::READONLY
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2009-02-18 22:56:19 -08:00
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2009-02-18 22:56:19 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2009-02-18 22:56:19 -08:00
|
|
|
},
|
2008-10-08 05:54:58 -07:00
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableMixed
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableBool
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2011-04-09 16:38:06 -07:00
|
|
|
states::READONLY
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIACheckableBool
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
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
|
|
|
eARIAReadonly
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
2009-12-15 08:03:39 -08:00
|
|
|
{
|
|
|
|
"scrollbar",
|
2012-01-11 19:07:35 -08:00
|
|
|
roles::SCROLLBAR,
|
2009-12-15 08:03:39 -08:00
|
|
|
kUseMapRole,
|
|
|
|
eHasValueMinMax,
|
|
|
|
eNoAction,
|
|
|
|
eNoLiveAttr,
|
|
|
|
kNoReqStates,
|
|
|
|
eARIAOrientation,
|
|
|
|
eARIAReadonly
|
|
|
|
},
|
2008-10-08 05:54:58 -07:00
|
|
|
{
|
|
|
|
"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,
|
2011-11-17 05:18:54 -08:00
|
|
|
kNoReqStates,
|
|
|
|
eARIAOrientation
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
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
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2011-05-24 07:02:44 -07:00
|
|
|
kNoReqStates,
|
|
|
|
eARIASelectable
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-02-18 22:56:19 -08:00
|
|
|
ePoliteLiveAttr,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
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
|
|
|
},
|
2009-02-18 22:56:19 -08:00
|
|
|
{
|
|
|
|
"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
|
|
|
},
|
2008-10-08 05:54:58 -07:00
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAReadonly,
|
|
|
|
eARIAMultiSelectable
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
2008-10-08 05:54:58 -07:00
|
|
|
kNoReqStates,
|
2009-06-24 19:12:38 -07:00
|
|
|
eARIAReadonly,
|
|
|
|
eARIAMultiSelectable
|
2008-10-08 05:54:58 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"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,
|
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
|
|
|
};
|
|
|
|
|
|
|
|
PRUint32 nsARIAMap::gWAIRoleMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIRoleMap);
|
|
|
|
|
|
|
|
nsRoleMapEntry nsARIAMap::gLandmarkRoleMap = {
|
|
|
|
"",
|
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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
2007-06-05 08:41:07 -07:00
|
|
|
};
|
|
|
|
|
2008-02-06 20:14:59 -08:00
|
|
|
nsRoleMapEntry nsARIAMap::gEmptyRoleMap = {
|
|
|
|
"",
|
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,
|
2009-06-24 19:12:38 -07:00
|
|
|
kNoReqStates
|
|
|
|
};
|
|
|
|
|
|
|
|
nsStateMapEntry nsARIAMap::gWAIStateMap[] = {
|
|
|
|
// eARIANone
|
|
|
|
nsStateMapEntry(),
|
|
|
|
|
|
|
|
// eARIAAutoComplete
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_autocomplete,
|
2011-04-09 16:38:06 -07:00
|
|
|
"inline", states::SUPPORTS_AUTOCOMPLETION,
|
|
|
|
"list", states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION,
|
|
|
|
"both", states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIABusy
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_busy,
|
2011-04-09 16:38:06 -07:00
|
|
|
"true", states::BUSY,
|
|
|
|
"error", states::INVALID),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIACheckableBool
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_checked, kBoolType,
|
2011-10-17 07:59:28 -07:00
|
|
|
states::CHECKABLE, states::CHECKED, 0, true),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIACheckableMixed
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_checked, kMixedType,
|
2011-10-17 07:59:28 -07:00
|
|
|
states::CHECKABLE, states::CHECKED, 0, true),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIACheckedMixed
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_checked, kMixedType,
|
2011-04-09 16:38:06 -07:00
|
|
|
states::CHECKABLE, states::CHECKED, 0),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIADisabled
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_disabled, kBoolType,
|
2011-04-09 16:38:06 -07:00
|
|
|
0, states::UNAVAILABLE),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIAExpanded
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_expanded, kBoolType,
|
2011-04-09 16:38:06 -07:00
|
|
|
0, states::EXPANDED, states::COLLAPSED),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIAHasPopup
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_haspopup, kBoolType,
|
2011-04-09 16:38:06 -07:00
|
|
|
0, states::HASPOPUP),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIAInvalid
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_invalid, kBoolType,
|
2011-04-09 16:38:06 -07:00
|
|
|
0, states::INVALID),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIAMultiline
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_multiline, kBoolType,
|
2011-10-17 07:59:28 -07:00
|
|
|
0, states::MULTI_LINE, states::SINGLE_LINE, true),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIAMultiSelectable
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_multiselectable, kBoolType,
|
2011-04-09 16:38:06 -07:00
|
|
|
0, states::MULTISELECTABLE | states::EXTSELECTABLE),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
2009-12-15 08:03:39 -08:00
|
|
|
// eARIAOrientation
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_orientation, eUseFirstState,
|
2011-11-17 05:18:54 -08:00
|
|
|
"horizontal", states::HORIZONTAL,
|
|
|
|
"vertical", states::VERTICAL),
|
2009-12-15 08:03:39 -08:00
|
|
|
|
2009-06-24 19:12:38 -07:00
|
|
|
// eARIAPressed
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_pressed, kMixedType,
|
2011-04-09 16:38:06 -07:00
|
|
|
states::CHECKABLE, states::PRESSED),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIAReadonly
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_readonly, kBoolType,
|
2011-04-09 16:38:06 -07:00
|
|
|
0, states::READONLY),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIAReadonlyOrEditable
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_readonly, kBoolType,
|
2011-10-17 07:59:28 -07:00
|
|
|
0, states::READONLY, states::EDITABLE, true),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// eARIARequired
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_required, kBoolType,
|
2011-04-09 16:38:06 -07:00
|
|
|
0, states::REQUIRED),
|
2009-06-24 19:12:38 -07:00
|
|
|
|
2009-06-29 08:24:36 -07:00
|
|
|
// eARIASelectable
|
2011-06-03 14:35:17 -07:00
|
|
|
nsStateMapEntry(&nsGkAtoms::aria_selected, kBoolType,
|
2011-10-17 07:59:28 -07:00
|
|
|
states::SELECTABLE, states::SELECTED, 0, true)
|
2008-02-06 20:14:59 -08:00
|
|
|
};
|
|
|
|
|
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:
|
|
|
|
*/
|
2009-06-24 19:12:38 -07:00
|
|
|
eStateMapEntryID nsARIAMap::gWAIUnivStateMap[] = {
|
|
|
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
* ARIA attribute map for attribute characteristics
|
|
|
|
*
|
|
|
|
* @note ARIA attributes that don't have any flags are not included here
|
|
|
|
*/
|
|
|
|
nsAttributeCharacteristics nsARIAMap::gWAIUnivAttrMap[] = {
|
2011-06-03 14:35:17 -07:00
|
|
|
{&nsGkAtoms::aria_activedescendant, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_atomic, ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_busy, ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_checked, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, /* exposes checkable obj attr */
|
|
|
|
{&nsGkAtoms::aria_controls, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_describedby, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_disabled, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_dropeffect, ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_expanded, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_flowto, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_grabbed, ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_haspopup, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_hidden, ATTR_VALTOKEN },/* always expose obj attr */
|
|
|
|
{&nsGkAtoms::aria_invalid, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_label, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_labelledby, ATTR_BYPASSOBJ },
|
|
|
|
{&nsGkAtoms::aria_level, ATTR_BYPASSOBJ }, /* handled via groupPosition */
|
|
|
|
{&nsGkAtoms::aria_live, ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_multiline, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_multiselectable, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
|
|
|
|
{&nsGkAtoms::aria_owns, ATTR_BYPASSOBJ },
|
|
|
|
{&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 },
|
|
|
|
{&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
|
|
|
};
|
|
|
|
|
|
|
|
PRUint32 nsARIAMap::gWAIUnivAttrMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIUnivAttrMap);
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsStateMapEntry
|
|
|
|
|
2010-03-18 18:24:46 -07:00
|
|
|
nsStateMapEntry::nsStateMapEntry() :
|
|
|
|
mAttributeName(nsnull),
|
2011-10-17 07:59:28 -07:00
|
|
|
mIsToken(false),
|
2010-03-18 18:24:46 -07:00
|
|
|
mPermanentState(0),
|
|
|
|
mValue1(nsnull),
|
|
|
|
mState1(0),
|
|
|
|
mValue2(nsnull),
|
|
|
|
mState2(0),
|
|
|
|
mValue3(nsnull),
|
|
|
|
mState3(0),
|
|
|
|
mDefaultState(0),
|
2011-10-17 07:59:28 -07:00
|
|
|
mDefinedIfAbsent(false)
|
2010-03-18 18:24:46 -07:00
|
|
|
{}
|
|
|
|
|
2011-04-09 16:38:06 -07:00
|
|
|
nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName, eStateValueType aType,
|
|
|
|
PRUint64 aPermanentState,
|
|
|
|
PRUint64 aTrueState,
|
|
|
|
PRUint64 aFalseState,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool aDefinedIfAbsent) :
|
2010-03-18 18:24:46 -07:00
|
|
|
mAttributeName(aAttrName),
|
2011-10-17 07:59:28 -07:00
|
|
|
mIsToken(true),
|
2010-03-18 18:24:46 -07:00
|
|
|
mPermanentState(aPermanentState),
|
|
|
|
mValue1("false"),
|
|
|
|
mState1(aFalseState),
|
|
|
|
mValue2(nsnull),
|
|
|
|
mState2(0),
|
|
|
|
mValue3(nsnull),
|
|
|
|
mState3(0),
|
|
|
|
mDefaultState(aTrueState),
|
|
|
|
mDefinedIfAbsent(aDefinedIfAbsent)
|
2009-06-24 19:12:38 -07:00
|
|
|
{
|
|
|
|
if (aType == kMixedType) {
|
2010-03-18 18:24:46 -07:00
|
|
|
mValue2 = "mixed";
|
2011-04-09 16:38:06 -07:00
|
|
|
mState2 = states::MIXED;
|
2009-06-24 19:12:38 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-09 16:38:06 -07:00
|
|
|
nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName,
|
|
|
|
const char* aValue1, PRUint64 aState1,
|
|
|
|
const char* aValue2, PRUint64 aState2,
|
|
|
|
const char* aValue3, PRUint64 aState3) :
|
2011-10-17 07:59:28 -07:00
|
|
|
mAttributeName(aAttrName), mIsToken(false), mPermanentState(0),
|
2011-04-09 16:38:06 -07:00
|
|
|
mValue1(aValue1), mState1(aState1),
|
|
|
|
mValue2(aValue2), mState2(aState2),
|
|
|
|
mValue3(aValue3), mState3(aState3),
|
2011-10-17 07:59:28 -07:00
|
|
|
mDefaultState(0), mDefinedIfAbsent(false)
|
2009-06-24 19:12:38 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-04-09 16:38:06 -07:00
|
|
|
nsStateMapEntry::nsStateMapEntry(nsIAtom** aAttrName,
|
2009-12-15 08:03:39 -08:00
|
|
|
EDefaultStateRule aDefaultStateRule,
|
2011-04-09 16:38:06 -07:00
|
|
|
const char* aValue1, PRUint64 aState1,
|
|
|
|
const char* aValue2, PRUint64 aState2,
|
|
|
|
const char* aValue3, PRUint64 aState3) :
|
2011-10-17 07:59:28 -07:00
|
|
|
mAttributeName(aAttrName), mIsToken(true), mPermanentState(0),
|
2011-04-09 16:38:06 -07:00
|
|
|
mValue1(aValue1), mState1(aState1),
|
|
|
|
mValue2(aValue2), mState2(aState2),
|
|
|
|
mValue3(aValue3), mState3(aState3),
|
2011-10-17 07:59:28 -07:00
|
|
|
mDefaultState(0), mDefinedIfAbsent(true)
|
2009-12-15 08:03:39 -08:00
|
|
|
{
|
2011-04-09 16:38:06 -07:00
|
|
|
if (aDefaultStateRule == eUseFirstState)
|
2010-03-18 18:24:46 -07:00
|
|
|
mDefaultState = aState1;
|
2009-12-15 08:03:39 -08:00
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool
|
2011-04-09 16:38:06 -07:00
|
|
|
nsStateMapEntry::MapToStates(nsIContent* aContent, PRUint64* aState,
|
2009-06-24 19:12:38 -07:00
|
|
|
eStateMapEntryID aStateMapEntryID)
|
|
|
|
{
|
|
|
|
// Return true if we should continue.
|
|
|
|
if (aStateMapEntryID == eARIANone)
|
2011-10-17 07:59:28 -07:00
|
|
|
return false;
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
const nsStateMapEntry& entry = nsARIAMap::gWAIStateMap[aStateMapEntryID];
|
|
|
|
|
2010-03-18 18:24:46 -07:00
|
|
|
if (entry.mIsToken) {
|
2009-06-24 19:12:38 -07:00
|
|
|
// If attribute is considered as defined when it's absent then let's act
|
|
|
|
// attribute value is "false" supposedly.
|
2011-09-28 23:19:26 -07:00
|
|
|
bool hasAttr = aContent->HasAttr(kNameSpaceID_None, *entry.mAttributeName);
|
2010-03-18 18:24:46 -07:00
|
|
|
if (entry.mDefinedIfAbsent && !hasAttr) {
|
|
|
|
if (entry.mPermanentState)
|
|
|
|
*aState |= entry.mPermanentState;
|
|
|
|
if (entry.mState1)
|
|
|
|
*aState |= entry.mState1;
|
2011-10-17 07:59:28 -07:00
|
|
|
return true;
|
2009-06-24 19:12:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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 ||
|
2010-03-18 18:24:46 -07:00
|
|
|
aContent->AttrValueIs(kNameSpaceID_None, *entry.mAttributeName,
|
2011-06-03 14:35:17 -07:00
|
|
|
nsGkAtoms::_empty, eCaseMatters) ||
|
2010-03-18 18:24:46 -07:00
|
|
|
aContent->AttrValueIs(kNameSpaceID_None, *entry.mAttributeName,
|
2011-06-03 14:35:17 -07:00
|
|
|
nsGkAtoms::_undefined, eCaseMatters)) {
|
2009-06-24 19:12:38 -07:00
|
|
|
|
2010-03-18 18:24:46 -07:00
|
|
|
if (entry.mPermanentState)
|
|
|
|
*aState &= ~entry.mPermanentState;
|
2011-10-17 07:59:28 -07:00
|
|
|
return true;
|
2009-06-24 19:12:38 -07:00
|
|
|
}
|
|
|
|
|
2010-03-18 18:24:46 -07:00
|
|
|
if (entry.mPermanentState)
|
|
|
|
*aState |= entry.mPermanentState;
|
2009-06-24 19:12:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
nsAutoString attrValue;
|
2010-03-18 18:24:46 -07:00
|
|
|
if (!aContent->GetAttr(kNameSpaceID_None, *entry.mAttributeName, attrValue))
|
2011-10-17 07:59:28 -07:00
|
|
|
return true;
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
// Apply states for matched value. If no values was matched then apply default
|
|
|
|
// states.
|
2011-09-28 23:19:26 -07:00
|
|
|
bool applyDefaultStates = true;
|
2010-03-18 18:24:46 -07:00
|
|
|
if (entry.mValue1) {
|
|
|
|
if (attrValue.EqualsASCII(entry.mValue1)) {
|
2011-10-17 07:59:28 -07:00
|
|
|
applyDefaultStates = false;
|
2009-06-24 19:12:38 -07:00
|
|
|
|
2010-03-18 18:24:46 -07:00
|
|
|
if (entry.mState1)
|
|
|
|
*aState |= entry.mState1;
|
|
|
|
} else if (entry.mValue2) {
|
|
|
|
if (attrValue.EqualsASCII(entry.mValue2)) {
|
2011-10-17 07:59:28 -07:00
|
|
|
applyDefaultStates = false;
|
2009-06-24 19:12:38 -07:00
|
|
|
|
2010-03-18 18:24:46 -07:00
|
|
|
if (entry.mState2)
|
|
|
|
*aState |= entry.mState2;
|
2009-06-24 19:12:38 -07:00
|
|
|
|
2010-03-18 18:24:46 -07:00
|
|
|
} else if (entry.mValue3) {
|
|
|
|
if (attrValue.EqualsASCII(entry.mValue3)) {
|
2011-10-17 07:59:28 -07:00
|
|
|
applyDefaultStates = false;
|
2009-06-24 19:12:38 -07:00
|
|
|
|
2010-03-18 18:24:46 -07:00
|
|
|
if (entry.mState3)
|
|
|
|
*aState |= entry.mState3;
|
2009-06-24 19:12:38 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (applyDefaultStates) {
|
2010-03-18 18:24:46 -07:00
|
|
|
if (entry.mDefaultState)
|
|
|
|
*aState |= entry.mDefaultState;
|
2009-06-24 19:12:38 -07:00
|
|
|
}
|
|
|
|
|
2011-10-17 07:59:28 -07:00
|
|
|
return true;
|
2009-06-24 19:12:38 -07:00
|
|
|
}
|