Bug 398910. Remove support for namespaced ARIA properties since they are no longer official (we are pre-1.0). r=surkov, r=ginn, r=bienvenu, r=mano, r=mconnor, r+sr=neil

This commit is contained in:
aaronleventhal@moonset.net 2007-12-11 18:10:26 -08:00
Родитель 5e63bc8422
Коммит 754ec000fb
36 изменённых файлов: 407 добавлений и 849 удалений

Просмотреть файл

@ -58,7 +58,7 @@ interface nsIDOMWindow;
*
* @status UNDER_REVIEW
*/
[scriptable, uuid(81ddd75f-adbd-4a1c-b87c-6522bcea0596)]
[scriptable, uuid(b7ae45bd-21e9-4ed5-a67e-86448b25d56b)]
interface nsIAccessibleDocument : nsISupports
{
/**
@ -122,27 +122,4 @@ interface nsIAccessibleDocument : nsISupports
*/
nsIAccessible getAccessibleInParentChain(in nsIDOMNode aDOMNode,
in boolean aCanCreate);
/**
* A bit flag representing the type of ARIA properties which should be
* checked in this document:
* either eUnknownPropType, eCheckNamespaced, eCheckHyphenated or eCheckAny
*/
readonly attribute unsigned long ariaPropTypes;
/**
* Check attributes in the form of:
* [someprefix]:[propname] (e.g. aria:live) where ancestor defines:
* xmlns:[someprefix]="http://www.w3.org/2005/07/aaa"
*/
const unsigned long eCheckNamespaced = 1;
/**
* Check hyphenated attributes in the form of aria-[propname].
* This is the default in text/html documents.
* Can be combined with eCheckNamespaced flag. This may
* change during the life of the document, if setAttributeNS()
* is used to set an ARIA property.
*/
const unsigned long eCheckHyphenated = 2;
};

Просмотреть файл

@ -61,7 +61,7 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents the menu bar (positioned beneath the title bar of a window)
* from which menus are selected by the user. The role is used by
* xul:menubar or role="wairole:menubar".
* xul:menubar or role="menubar".
*/
const unsigned long ROLE_MENUBAR = 2;
@ -98,7 +98,7 @@ interface nsIAccessibleRole : nsISupports
* Assistive Technologies typically respond to the role by reading the entire
* onscreen contents of containers advertising this role. Should be used for
* warning dialogs, etc. The role is used by xul:browsermessage,
* role="wairole:alert", xforms:message.
* role="alert", xforms:message.
*/
const unsigned long ROLE_ALERT = 8;
@ -116,14 +116,14 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a menu, which presents a list of options from which the user can
* make a selection to perform an action. It is used for role="wairole:menu".
* make a selection to perform an action. It is used for role="menu".
*/
const unsigned long ROLE_MENUPOPUP = 11;
/**
* Represents a menu item, which is an entry in a menu that a user can choose
* to carry out a command, select an option. It is used for xul:menuitem,
* role="wairole:menuitem".
* role="menuitem".
*/
const unsigned long ROLE_MENUITEM = 12;
@ -134,13 +134,13 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a main window for an application. It is used for
* role="wairole:application". Also refer to ROLE_APP_ROOT
* role="application". Also refer to ROLE_APP_ROOT
*/
const unsigned long ROLE_APPLICATION = 14;
/**
* Represents a document window. A document window is always contained within
* an application window. It is used for role="wairole:document".
* an application window. It is used for role="document".
*/
const unsigned long ROLE_DOCUMENT = 15;
@ -160,7 +160,7 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a dialog box or message box. It is used for xul:dialog,
* role="wairole:dialog".
* role="dialog".
*/
const unsigned long ROLE_DIALOG = 18;
@ -172,21 +172,21 @@ interface nsIAccessibleRole : nsISupports
/**
* Logically groups other objects. There is not always a parent-child
* relationship between the grouping object and the objects it contains. It
* is used for html:textfield, xul:groupbox, role="wairole:group".
* is used for html:textfield, xul:groupbox, role="group".
*/
const unsigned long ROLE_GROUPING = 20;
/**
* Used to visually divide a space into two regions, such as a separator menu
* item or a bar that divides split panes within a window. It is used for
* xul:separator, html:hr, role="wairole:separator".
* xul:separator, html:hr, role="separator".
*/
const unsigned long ROLE_SEPARATOR = 21;
/**
* Represents a toolbar, which is a grouping of controls (push buttons or
* toggle buttons) that provides easy access to frequently used features. It
* is used for xul:toolbar, role="wairole:toolbar".
* is used for xul:toolbar, role="toolbar".
*/
const unsigned long ROLE_TOOLBAR = 22;
@ -201,7 +201,7 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a table that contains rows and columns of cells, and optionally,
* row headers and column headers. It is used for html:table,
* role="wairole:grid". Also refer to the following roles: ROLE_COLUMNHEADER,
* role="grid". Also refer to the following roles: ROLE_COLUMNHEADER,
* ROLE_ROWHEADER, ROLE_COLUMN, ROLE_ROW, ROLE_CELL.
*/
const unsigned long ROLE_TABLE = 24;
@ -209,13 +209,13 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a column header, providing a visual label for a column in
* a table. It is used for XUL tree column headers, html:th,
* role="wairole:colheader". Also refer to ROLE_TABLE.
* role="colheader". Also refer to ROLE_TABLE.
*/
const unsigned long ROLE_COLUMNHEADER = 25;
/**
* Represents a row header, which provides a visual label for a table row.
* It is used for role="wairole:rowheader". Also, see ROLE_TABLE.
* It is used for role="rowheader". Also, see ROLE_TABLE.
*/
const unsigned long ROLE_ROWHEADER = 26;
@ -231,7 +231,7 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a cell within a table. Is is used for html:td,
* role="wairole:gridcell". Also, see ROLE_TABLE.
* role="gridcell". Also, see ROLE_TABLE.
*/
const unsigned long ROLE_CELL = 29;
@ -256,7 +256,7 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a list box, allowing the user to select one or more items. It
* is used for xul:listbox, html:select@size, role="wairole:list". See also
* is used for xul:listbox, html:select@size, role="list". See also
* ROLE_LIST_ITEM.
*/
const unsigned long ROLE_LIST = 33;
@ -269,25 +269,25 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents an outline or tree structure, such as a tree view control,
* that displays a hierarchical list and allows the user to expand and
* collapse branches. Is is used for role="wairole:tree".
* collapse branches. Is is used for role="tree".
*/
const unsigned long ROLE_OUTLINE = 35;
/**
* Represents an item in an outline or tree structure. It is used for
* role="wairole:treeitem".
* role="treeitem".
*/
const unsigned long ROLE_OUTLINEITEM = 36;
/**
* Represents a page tab, it is a child of a page tab list. It is used for
* xul:tab, role="wairole:treeitem". Also refer to ROLE_PAGETABLIST.
* xul:tab, role="treeitem". Also refer to ROLE_PAGETABLIST.
*/
const unsigned long ROLE_PAGETAB = 37;
/**
* Represents a property sheet. It is used for xul:tabpanel,
* role="wairole:tabpanel".
* role="tabpanel".
*/
const unsigned long ROLE_PROPERTYPAGE = 38;
@ -306,7 +306,7 @@ interface nsIAccessibleRole : nsISupports
* Represents read-only text, such as labels for other controls or
* instructions in a dialog box. Static text cannot be modified or selected.
* Is is used for xul:label, xul:description, html:lablel,
* role="wairole:label" or role="wairole:description", xforms:output.
* role="label" or role="description", xforms:output.
*/
const unsigned long ROLE_STATICTEXT = 41;
@ -317,13 +317,13 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a push button control. It is used for xul:button, html:button,
* role="wairole:button", xforms:trigger, xforms:submit.
* role="button", xforms:trigger, xforms:submit.
*/
const unsigned long ROLE_PUSHBUTTON = 43;
/**
* Represents a check box control. It is used for xul:checkbox,
* html:input@type="checkbox", role="wairole:checkbox", boolean xforms:input.
* html:input@type="checkbox", role="checkbox", boolean xforms:input.
*/
const unsigned long ROLE_CHECKBUTTON = 44;
@ -332,14 +332,14 @@ interface nsIAccessibleRole : nsISupports
* group of mutually exclusive options. All objects sharing a single parent
* that have this attribute are assumed to be part of single mutually
* exclusive group. It is used for xul:radio, html:input@type="radio",
* role="wairole:radio".
* role="radio".
*/
const unsigned long ROLE_RADIOBUTTON = 45;
/**
* Represents a combo box; an edit control with an associated list box that
* provides a set of predefined choices. It is used for html:select,
* xul:menulist, role="wairole:combobox".
* xul:menulist, role="combobox".
*/
const unsigned long ROLE_COMBOBOX = 46;
@ -351,7 +351,7 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a progress bar, dynamically showing the user the percent
* complete of an operation in progress. It is used for xul:progressmeter,
* role="wairole:progressbar".
* role="progressbar".
*/
const unsigned long ROLE_PROGRESSBAR = 48;
@ -369,7 +369,7 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a slider, which allows the user to adjust a setting in given
* increments between minimum and maximum values. It is used by xul:scale,
* role="wairole:slider", xforms:range.
* role="slider", xforms:range.
*/
const unsigned long ROLE_SLIDER = 51;
@ -418,7 +418,7 @@ interface nsIAccessibleRole : nsISupports
/**
* Represents a container of page tab controls. Is it used for xul:tabs,
* DHTML: role="wairole:tabs". Also refer to ROLE_PAGETAB.
* DHTML: role="tabs". Also refer to ROLE_PAGETAB.
*/
const unsigned long ROLE_PAGETABLIST = 60;

Просмотреть файл

@ -41,18 +41,6 @@
#include "nsIAccessibleRole.h"
#include "nsIAccessibleStates.h"
#define ARIA_PROPERTY(atom) &nsAccessibilityAtoms::atom,
nsIAtom** nsARIAMap::gAriaAtomPtrsNS[eAria_none] = {
#include "nsARIAPropertyList.h"
};
#undef ARIA_PROPERTY
#define ARIA_PROPERTY(atom) &nsAccessibilityAtoms::aria_##atom,
nsIAtom** nsARIAMap::gAriaAtomPtrsHyphenated[eAria_none] = {
#include "nsARIAPropertyList.h"
};
#undef ARIA_PROPERTY
/**
* This list of WAI-defined roles are currently hardcoded.
* Eventually we will most likely be loading an RDF resource that contains this information
@ -68,7 +56,7 @@ nsIAtom** nsARIAMap::gAriaAtomPtrsHyphenated[eAria_none] = {
* banner, contentinfo, main, navigation, note, search, secondary, seealso, breadcrumbs
*/
static const nsStateMapEntry kEndEntry = {eAria_none, 0, 0}; // To fill in array of state mappings
static const nsStateMapEntry kEndEntry = {nsnull, 0, 0}; // To fill in array of state mappings
nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
{
@ -76,142 +64,142 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
{"alertdialog", nsIAccessibleRole::ROLE_ALERT, eNameOkFromChildren, eNoValue, kNoReqStates, kEndEntry},
{"application", nsIAccessibleRole::ROLE_APPLICATION, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"button", nsIAccessibleRole::ROLE_PUSHBUTTON, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_pressed, kBoolState, nsIAccessibleStates::STATE_PRESSED},
{eAria_pressed, "mixed", nsIAccessibleStates::STATE_MIXED}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_pressed, kBoolState, nsIAccessibleStates::STATE_PRESSED},
{&nsAccessibilityAtoms::aria_pressed, "mixed", nsIAccessibleStates::STATE_MIXED}, kEndEntry},
{"checkbox", nsIAccessibleRole::ROLE_CHECKBUTTON, eNameOkFromChildren, eNoValue, nsIAccessibleStates::STATE_CHECKABLE,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED},
{eAria_checked, "mixed", nsIAccessibleStates::STATE_MIXED},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED},
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{"columnheader", nsIAccessibleRole::ROLE_COLUMNHEADER, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{eAria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{"combobox", nsIAccessibleRole::ROLE_COMBOBOX, eNameLabelOrTitle, eHasValueMinMax,
nsIAccessibleStates::STATE_COLLAPSED | nsIAccessibleStates::STATE_HASPOPUP,
// Manually map EXT_STATE_SUPPORTS_AUTOCOMPLETION aaa:autocomplete
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{eAria_expanded, kBoolState, nsIAccessibleStates::STATE_EXPANDED}, kEndEntry},
// Manually map EXT_STATE_SUPPORTS_AUTOCOMPLETION aria-autocomplete
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{&nsAccessibilityAtoms::aria_expanded, kBoolState, nsIAccessibleStates::STATE_EXPANDED}, kEndEntry},
{"description", nsIAccessibleRole::ROLE_TEXT_CONTAINER, eNameOkFromChildren, eNoValue, kNoReqStates, kEndEntry},
{"dialog", nsIAccessibleRole::ROLE_DIALOG, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"document", nsIAccessibleRole::ROLE_DOCUMENT, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"grid", nsIAccessibleRole::ROLE_TABLE, eNameLabelOrTitle, eNoValue, nsIAccessibleStates::STATE_FOCUSABLE,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{"gridcell", nsIAccessibleRole::ROLE_CELL, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_expanded, kBoolState, nsIAccessibleStates::STATE_EXPANDED},
{eAria_expanded, "false", nsIAccessibleStates::STATE_COLLAPSED},
{eAria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{eAria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_expanded, kBoolState, nsIAccessibleStates::STATE_EXPANDED},
{&nsAccessibilityAtoms::aria_expanded, "false", nsIAccessibleStates::STATE_COLLAPSED},
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{"group", nsIAccessibleRole::ROLE_GROUPING, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"heading", nsIAccessibleRole::ROLE_HEADING, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"img", nsIAccessibleRole::ROLE_GRAPHIC, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"label", nsIAccessibleRole::ROLE_LABEL, eNameOkFromChildren, eNoValue, kNoReqStates, kEndEntry},
{"link", nsIAccessibleRole::ROLE_LINK, eNameOkFromChildren, eNoValue, nsIAccessibleStates::STATE_LINKED,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{"list", nsIAccessibleRole::ROLE_LIST, eNameLabelOrTitle, eNoValue, kNoReqStates,
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{eAria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE}, kEndEntry},
{"listbox", nsIAccessibleRole::ROLE_LISTBOX, eNameLabelOrTitle, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{eAria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE}, kEndEntry},
{"listitem", nsIAccessibleRole::ROLE_LISTITEM, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{eAria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{eAria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
{eAria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
{eAria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
{&nsAccessibilityAtoms::aria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE}, kEndEntry},
{"menu", nsIAccessibleRole::ROLE_MENUPOPUP, eNameLabelOrTitle, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{"menubar", nsIAccessibleRole::ROLE_MENUBAR, eNameLabelOrTitle, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{"menuitem", nsIAccessibleRole::ROLE_MENUITEM, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
{eAria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
{eAria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
{&nsAccessibilityAtoms::aria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE}, kEndEntry},
{"menuitemcheckbox", nsIAccessibleRole::ROLE_CHECK_MENU_ITEM, eNameOkFromChildren, eNoValue, nsIAccessibleStates::STATE_CHECKABLE,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED },
{eAria_checked, "mixed", nsIAccessibleStates::STATE_MIXED}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED },
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED}, kEndEntry},
{"menuitemradio", nsIAccessibleRole::ROLE_RADIO_MENU_ITEM, eNameOkFromChildren, eNoValue, nsIAccessibleStates::STATE_CHECKABLE,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED }, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED }, kEndEntry},
{"option", nsIAccessibleRole::ROLE_OPTION, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{eAria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{eAria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
{eAria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
{eAria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
{&nsAccessibilityAtoms::aria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE}, kEndEntry},
{"presentation", nsIAccessibleRole::ROLE_NOTHING, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"progressbar", nsIAccessibleRole::ROLE_PROGRESSBAR, eNameLabelOrTitle, eHasValueMinMax, nsIAccessibleStates::STATE_READONLY,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{"radio", nsIAccessibleRole::ROLE_RADIOBUTTON, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED}, kEndEntry},
{"radiogroup", nsIAccessibleRole::ROLE_GROUPING, eNameLabelOrTitle, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{"region", nsIAccessibleRole::ROLE_PANE, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"row", nsIAccessibleRole::ROLE_ROW, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{eAria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{eAria_expanded, kBoolState, nsIAccessibleStates::STATE_EXPANDED},
{eAria_expanded, "false", nsIAccessibleStates::STATE_COLLAPSED}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_expanded, kBoolState, nsIAccessibleStates::STATE_EXPANDED},
{&nsAccessibilityAtoms::aria_expanded, "false", nsIAccessibleStates::STATE_COLLAPSED}, kEndEntry},
{"rowheader", nsIAccessibleRole::ROLE_ROWHEADER, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{eAria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{"section", nsIAccessibleRole::ROLE_SECTION, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"separator", nsIAccessibleRole::ROLE_SEPARATOR, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"slider", nsIAccessibleRole::ROLE_SLIDER, eNameLabelOrTitle, eHasValueMinMax, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{"spinbutton", nsIAccessibleRole::ROLE_SPINBUTTON, eNameLabelOrTitle, eHasValueMinMax, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{"status", nsIAccessibleRole::ROLE_STATUSBAR, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"tab", nsIAccessibleRole::ROLE_PAGETAB, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{"tablist", nsIAccessibleRole::ROLE_PAGETABLIST, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"tabpanel", nsIAccessibleRole::ROLE_PROPERTYPAGE, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"textbox", nsIAccessibleRole::ROLE_ENTRY, eNameLabelOrTitle, eNoValue, kNoReqStates,
// Manually map EXT_STATE_SINGLE_LINE and EXT_STATE_MULTI_LINE FROM aaa:multiline
// Manually map EXT_STATE_SUPPORTS_AUTOCOMPLETION aaa:autocomplete
{eAria_autocomplete, "list", nsIAccessibleStates::STATE_HASPOPUP},
{eAria_autocomplete, "both", nsIAccessibleStates::STATE_HASPOPUP},
{eAria_secret, kBoolState, nsIAccessibleStates::STATE_PROTECTED},
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
// Manually map EXT_STATE_SINGLE_LINE and EXT_STATE_MULTI_LINE FROM aria-multiline
// Manually map EXT_STATE_SUPPORTS_AUTOCOMPLETION aria-autocomplete
{&nsAccessibilityAtoms::aria_autocomplete, "list", nsIAccessibleStates::STATE_HASPOPUP},
{&nsAccessibilityAtoms::aria_autocomplete, "both", nsIAccessibleStates::STATE_HASPOPUP},
{&nsAccessibilityAtoms::aria_secret, kBoolState, nsIAccessibleStates::STATE_PROTECTED},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY}, kEndEntry},
{"toolbar", nsIAccessibleRole::ROLE_TOOLBAR, eNameLabelOrTitle, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE}, kEndEntry},
{"tooltip", nsIAccessibleRole::ROLE_TOOLTIP, eNameOkFromChildren, eNoValue, kNoReqStates, kEndEntry},
{"tree", nsIAccessibleRole::ROLE_OUTLINE, eNameLabelOrTitle, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{eAria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE}, kEndEntry},
{"treegrid", nsIAccessibleRole::ROLE_TREE_TABLE, eNameLabelOrTitle, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{eAria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE}, kEndEntry},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_readonly, kBoolState, nsIAccessibleStates::STATE_READONLY},
{&nsAccessibilityAtoms::aria_multiselectable, kBoolState, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE}, kEndEntry},
{"treeitem", nsIAccessibleRole::ROLE_OUTLINEITEM, eNameOkFromChildren, eNoValue, kNoReqStates,
{eAria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{eAria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{eAria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{eAria_expanded, kBoolState, nsIAccessibleStates::STATE_EXPANDED},
{eAria_expanded, "false", nsIAccessibleStates::STATE_COLLAPSED},
{eAria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
{eAria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
{eAria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE},},
{&nsAccessibilityAtoms::aria_disabled, kBoolState, nsIAccessibleStates::STATE_UNAVAILABLE},
{&nsAccessibilityAtoms::aria_selected, kBoolState, nsIAccessibleStates::STATE_SELECTED | nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_selected, "false", nsIAccessibleStates::STATE_SELECTABLE},
{&nsAccessibilityAtoms::aria_expanded, kBoolState, nsIAccessibleStates::STATE_EXPANDED},
{&nsAccessibilityAtoms::aria_expanded, "false", nsIAccessibleStates::STATE_COLLAPSED},
{&nsAccessibilityAtoms::aria_checked, kBoolState, nsIAccessibleStates::STATE_CHECKED | nsIAccessibleStates::STATE_CHECKABLE},
{&nsAccessibilityAtoms::aria_checked, "mixed", nsIAccessibleStates::STATE_MIXED | nsIAccessibleStates::STATE_CHECKABLE},
{&nsAccessibilityAtoms::aria_checked, "false", nsIAccessibleStates::STATE_CHECKABLE},},
};
PRUint32 nsARIAMap::gWAIRoleMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIRoleMap);
@ -231,11 +219,11 @@ nsRoleMapEntry nsARIAMap::gLandmarkRoleMap = {
* whether there is an ARIA role or not:
*/
nsStateMapEntry nsARIAMap::gWAIUnivStateMap[] = {
{eAria_required, kBoolState, nsIAccessibleStates::STATE_REQUIRED},
{eAria_invalid, kBoolState, nsIAccessibleStates::STATE_INVALID},
{eAria_haspopup, kBoolState, nsIAccessibleStates::STATE_HASPOPUP},
{eAria_busy, "true", nsIAccessibleStates::STATE_BUSY},
{eAria_busy, "error", nsIAccessibleStates::STATE_INVALID},
{&nsAccessibilityAtoms::aria_required, kBoolState, nsIAccessibleStates::STATE_REQUIRED},
{&nsAccessibilityAtoms::aria_invalid, kBoolState, nsIAccessibleStates::STATE_INVALID},
{&nsAccessibilityAtoms::aria_haspopup, kBoolState, nsIAccessibleStates::STATE_HASPOPUP},
{&nsAccessibilityAtoms::aria_busy, "true", nsIAccessibleStates::STATE_BUSY},
{&nsAccessibilityAtoms::aria_busy, "error", nsIAccessibleStates::STATE_INVALID},
kEndEntry
};

Просмотреть файл

@ -43,12 +43,6 @@
#include "prtypes.h"
#include "nsAccessibilityAtoms.h"
#define ARIA_PROPERTY(atom) eAria_##atom,
enum EAriaProperty {
#include "nsARIAPropertyList.h"
eAria_none };
#undef ARIA_PROPERTY
// Name mapping rule: can the name be computed from descendants?
enum ENameRule
{
@ -73,7 +67,7 @@ enum ENameRule
enum EValueRule
{
eNoValue,
eHasValueMinMax // Supports value, min and max from aaa:valuenow, valuemin and valuemax
eHasValueMinMax // Supports value, min and max from aria-valuenow, aria-valuemin and aria-valuemax
};
// Used for an nsStateMapEntry if a given state attribute supports "true" and "false"
@ -86,7 +80,7 @@ enum EValueRule
// nsStateMapEntry.state
struct nsStateMapEntry
{
EAriaProperty attributeName; // eARIA_none indicates last entry in map
nsIAtom** attributeName; // nsnull indicates last entry in map
const char* attributeValue; // magic value of kBoolState (0) means supports "true" and "false"
PRUint32 state; // If match, this is the nsIAccessibleStates to map to
};
@ -110,7 +104,7 @@ struct nsRoleMapEntry
PRUint32 state; // or kNoReqStates if no nsIAccessibleStates are automatic for this role.
// ARIA properties supported for this role
// (in other words, the aaa:foo attribute to nsIAccessibleStates mapping rules)
// (in other words, the aria-foo attribute to nsIAccessibleStates mapping rules)
// Currently you cannot have unlimited mappings, because
// a variable sized array would not allow the use of
// C++'s struct initialization feature.
@ -131,8 +125,6 @@ struct nsRoleMapEntry
*/
struct nsARIAMap
{
static nsIAtom** gAriaAtomPtrsNS[eAria_none];
static nsIAtom** gAriaAtomPtrsHyphenated[eAria_none];
static nsRoleMapEntry gWAIRoleMap[];
static PRUint32 gWAIRoleMapLength;
static nsRoleMapEntry gLandmarkRoleMap;

Просмотреть файл

@ -1,74 +0,0 @@
/* -*- 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 ***** */
// ARIA properties
ARIA_PROPERTY(activedescendant)
ARIA_PROPERTY(atomic)
ARIA_PROPERTY(autocomplete)
ARIA_PROPERTY(busy)
ARIA_PROPERTY(channel)
ARIA_PROPERTY(checked)
ARIA_PROPERTY(controls)
ARIA_PROPERTY(datatype)
ARIA_PROPERTY(describedby)
ARIA_PROPERTY(disabled)
ARIA_PROPERTY(dropeffect)
ARIA_PROPERTY(expanded)
ARIA_PROPERTY(flowto)
ARIA_PROPERTY(grab)
ARIA_PROPERTY(haspopup)
ARIA_PROPERTY(invalid)
ARIA_PROPERTY(labelledby)
ARIA_PROPERTY(level)
ARIA_PROPERTY(live)
ARIA_PROPERTY(multiline)
ARIA_PROPERTY(multiselectable)
ARIA_PROPERTY(owns)
ARIA_PROPERTY(posinset)
ARIA_PROPERTY(pressed)
ARIA_PROPERTY(readonly)
ARIA_PROPERTY(relevant)
ARIA_PROPERTY(required)
ARIA_PROPERTY(secret)
ARIA_PROPERTY(selected)
ARIA_PROPERTY(setsize)
ARIA_PROPERTY(sort)
ARIA_PROPERTY(valuenow)
ARIA_PROPERTY(valuemin)
ARIA_PROPERTY(valuemax)

Просмотреть файл

@ -879,15 +879,3 @@ nsAccessNode::GetLanguage(nsAString& aLanguage)
return NS_OK;
}
PRBool
nsAccessNode::GetARIARole(nsIContent *aContent, nsString& aRole)
{
aRole.Truncate();
if (aContent->IsNodeOfType(nsINode::eHTML)) {
// Allow non-namespaced role attribute in HTML
return aContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::role, aRole);
}
// In non-HTML content, use XHTML namespaced-role attribute
return aContent->GetAttr(kNameSpaceID_XHTML, nsAccessibilityAtoms::role, aRole);
}

Просмотреть файл

@ -72,16 +72,6 @@ class nsIDocShellTreeItem;
typedef nsInterfaceHashtable<nsVoidPtrHashKey, nsIAccessNode>
nsAccessNodeHashtable;
/**
* Does the current content have this ARIA role?
* Implemented as a compiler macro so that length can be computed at compile time.
* @param aContent Node to get role string from
* @param aRoleName Role string to compare with -- literal const char*
* @return PR_TRUE if there is a match
*/
#define ARIARoleEquals(aContent, aRoleName) \
nsAccessNode::ARIARoleEqualsImpl(aContent, aRoleName, NS_ARRAY_LENGTH(aRoleName) - 1)
class nsAccessNode: public nsIAccessNode, public nsPIAccessNode
{
public: // construction, destruction
@ -118,25 +108,6 @@ class nsAccessNode: public nsIAccessNode, public nsPIAccessNode
static already_AddRefed<nsIDOMNode> GetDOMNodeForContainer(nsISupports *aContainer);
static already_AddRefed<nsIPresShell> GetPresShellFor(nsIDOMNode *aStartNode);
// Return PR_TRUE if there is a role attribute
static PRBool HasRoleAttribute(nsIContent *aContent)
{
return (aContent->IsNodeOfType(nsINode::eHTML) && aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::role)) ||
aContent->HasAttr(kNameSpaceID_XHTML, nsAccessibilityAtoms::role) ||
aContent->HasAttr(kNameSpaceID_XHTML2_Unofficial, nsAccessibilityAtoms::role);
}
/**
* Provide the role string if there is one
* @param aContent Node to get role string from
* @param aRole String to fill role into
* @return PR_TRUE if there is a role attribute, and fill it into aRole
*/
static PRBool GetARIARole(nsIContent *aContent, nsString& aRole);
static PRBool ARIARoleEqualsImpl(nsIContent* aContent, const char* aRoleName, PRUint32 aLen)
{ nsAutoString role; return GetARIARole(aContent, role) && role.EqualsASCII(aRoleName, aLen); }
static void GetComputedStyleDeclaration(const nsAString& aPseudoElt,
nsIDOMElement *aElement,
nsIDOMCSSStyleDeclaration **aCssDecl);

Просмотреть файл

@ -88,6 +88,7 @@ ACCESSIBILITY_ATOM(a, "a")
ACCESSIBILITY_ATOM(abbr, "abbr")
ACCESSIBILITY_ATOM(acronym, "acronym")
ACCESSIBILITY_ATOM(area, "area")
ACCESSIBILITY_ATOM(autocomplete, "autocomplete")
ACCESSIBILITY_ATOM(blockquote, "blockquote")
ACCESSIBILITY_ATOM(br, "br")
ACCESSIBILITY_ATOM(body, "body")
@ -149,6 +150,7 @@ ACCESSIBILITY_ATOM(alt, "alt")
ACCESSIBILITY_ATOM(anonid, "anonid") // Used for ID's in XBL
ACCESSIBILITY_ATOM(contenteditable, "contenteditable")
ACCESSIBILITY_ATOM(control, "control")
ACCESSIBILITY_ATOM(disabled, "disabled")
ACCESSIBILITY_ATOM(cycles, "cycles") // used for XUL cycler attribute
ACCESSIBILITY_ATOM(curpos, "curpos") // XUL
ACCESSIBILITY_ATOM(data, "data")
@ -162,9 +164,12 @@ ACCESSIBILITY_ATOM(lang, "lang")
ACCESSIBILITY_ATOM(linkedPanel, "linkedpanel") // XUL
ACCESSIBILITY_ATOM(maxpos, "maxpos") // XUL
ACCESSIBILITY_ATOM(minpos, "minpos") // XUL
ACCESSIBILITY_ATOM(multiline, "multiline") // XUL
ACCESSIBILITY_ATOM(name, "name")
ACCESSIBILITY_ATOM(onclick, "onclick")
ACCESSIBILITY_ATOM(readonly, "readonly")
ACCESSIBILITY_ATOM(src, "src")
ACCESSIBILITY_ATOM(selected, "selected")
ACCESSIBILITY_ATOM(summary, "summary")
ACCESSIBILITY_ATOM(tabindex, "tabindex")
ACCESSIBILITY_ATOM(title, "title")
@ -176,20 +181,49 @@ ACCESSIBILITY_ATOM(value, "value")
// Also add to nsARIAMap.cpp and nsARIAMap.h
// ARIA role attribute
ACCESSIBILITY_ATOM(role, "role")
// ARIA properties
#define ARIA_PROPERTY(atom) ACCESSIBILITY_ATOM(atom, #atom)
#include "nsARIAPropertyList.h"
#undef ARIA_PROPERTY
#define ARIA_PROPERTY(atom) ACCESSIBILITY_ATOM(aria_##atom, "aria-"#atom)
#include "nsARIAPropertyList.h"
#undef ARIA_PROPERTY
ACCESSIBILITY_ATOM(aria_activedescendant, "aria-activedescendant")
ACCESSIBILITY_ATOM(aria_atomic, "aria-atomic")
ACCESSIBILITY_ATOM(aria_autocomplete, "aria-autocomplete")
ACCESSIBILITY_ATOM(aria_busy, "aria-busy")
ACCESSIBILITY_ATOM(aria_channel, "aria-channel")
ACCESSIBILITY_ATOM(aria_checked, "aria-checked")
ACCESSIBILITY_ATOM(aria_controls, "aria-controls")
ACCESSIBILITY_ATOM(aria_datatype, "aria-datatype")
ACCESSIBILITY_ATOM(aria_describedby, "aria-describedby")
ACCESSIBILITY_ATOM(aria_droppable, "aria-droppable")
ACCESSIBILITY_ATOM(aria_disabled, "aria-disabled")
ACCESSIBILITY_ATOM(aria_dropeffect, "aria-dropeffect")
ACCESSIBILITY_ATOM(aria_expanded, "aria-expanded")
ACCESSIBILITY_ATOM(aria_flowto, "aria-flowto")
ACCESSIBILITY_ATOM(aria_grab, "aria-grab")
ACCESSIBILITY_ATOM(aria_haspopup, "aria-haspopup")
ACCESSIBILITY_ATOM(aria_invalid, "aria-invalid")
ACCESSIBILITY_ATOM(aria_labelledby, "aria-labelledby")
ACCESSIBILITY_ATOM(aria_level, "aria-level")
ACCESSIBILITY_ATOM(aria_live, "aria-live")
ACCESSIBILITY_ATOM(aria_multiline, "aria-multiline")
ACCESSIBILITY_ATOM(aria_multiselectable, "aria-multiselectable")
ACCESSIBILITY_ATOM(aria_owns, "aria-owns")
ACCESSIBILITY_ATOM(aria_posinset, "aria-posinset")
ACCESSIBILITY_ATOM(aria_pressed, "aria-pressed")
ACCESSIBILITY_ATOM(aria_readonly, "aria-readonly")
ACCESSIBILITY_ATOM(aria_relevant, "aria-relevant")
ACCESSIBILITY_ATOM(aria_required, "aria-required")
ACCESSIBILITY_ATOM(aria_secret, "aria-secret")
ACCESSIBILITY_ATOM(aria_selected, "aria-selected")
ACCESSIBILITY_ATOM(aria_setsize, "aria-setsize")
ACCESSIBILITY_ATOM(aria_sort, "aria-sort")
ACCESSIBILITY_ATOM(aria_valuenow, "aria-valuenow")
ACCESSIBILITY_ATOM(aria_valuemin, "aria-valuemin")
ACCESSIBILITY_ATOM(aria_valuemax, "aria-valuemax")
// misc atoms
// a form property used to obtain the default label
// of an HTML button from the button frame
ACCESSIBILITY_ATOM(defaultLabel, "defaultLabel")
// An atom used to set the line-number object attribute
// Object attributes
ACCESSIBILITY_ATOM(level, "level")
ACCESSIBILITY_ATOM(posinset, "posinset")
ACCESSIBILITY_ATOM(setsize, "setsize")
ACCESSIBILITY_ATOM(lineNumber, "line-number")

Просмотреть файл

@ -1489,33 +1489,23 @@ PRBool
nsAccessibilityService::HasUniversalAriaProperty(nsIContent *aContent,
nsIWeakReference *aWeakShell)
{
nsCOMPtr<nsIAccessibleDocument> docAccessible =
nsAccessNode::GetDocAccessibleFor(aWeakShell);
if (!docAccessible) {
return PR_FALSE;
}
// Precalculate |ariaPropTypes| so that HasAriaProperty() doesn't have to do that each time
PRUint32 ariaPropTypes;
docAccessible->GetAriaPropTypes(&ariaPropTypes);
return nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_atomic, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_busy, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_channel, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_controls, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_datatype, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_describedby, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_dropeffect, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_flowto, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_grab, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_haspopup, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_invalid, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_labelledby, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_live, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_owns, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_relevant, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_required, ariaPropTypes) ||
nsAccUtils::HasAriaProperty(aContent, aWeakShell, eAria_sort, ariaPropTypes);
return aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_atomic) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_busy) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_channel) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_controls) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_datatype) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_describedby) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_dropeffect) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_flowto) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_grab) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_haspopup) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_invalid) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_labelledby) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_live) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_owns) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_relevant) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_required) ||
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_sort);
}
NS_IMETHODIMP

Просмотреть файл

@ -581,78 +581,12 @@ nsAccUtils::GetID(nsIContent *aContent, nsAString& aID)
return idAttribute ? aContent->GetAttr(kNameSpaceID_None, idAttribute, aID) : PR_FALSE;
}
PRUint32
nsAccUtils::GetAriaPropTypes(nsIContent *aContent, nsIWeakReference *aWeakShell)
{
NS_ENSURE_ARG_POINTER(aContent);
PRUint32 ariaPropTypes = 0;
// Get the doc accessible using the optimsal methodology
nsCOMPtr<nsIAccessibleDocument> docAccessible;
if (aWeakShell) {
docAccessible = nsAccessNode::GetDocAccessibleFor(aWeakShell);
}
else {
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(aContent);
if (node) {
docAccessible = nsAccessNode::GetDocAccessibleFor(node);
}
}
if (docAccessible) {
docAccessible->GetAriaPropTypes(&ariaPropTypes);
}
return ariaPropTypes;
}
PRBool
nsAccUtils::HasAriaProperty(nsIContent *aContent, nsIWeakReference *aWeakShell,
EAriaProperty aProperty, PRUint32 aAriaPropTypes)
{
if (!aAriaPropTypes) {
// The property types to check for is unknown, get it from the doc accessible
aAriaPropTypes = GetAriaPropTypes(aContent, aWeakShell);
}
return ((aAriaPropTypes & nsIAccessibleDocument::eCheckNamespaced) &&
aContent->HasAttr(kNameSpaceID_WAIProperties,
*nsARIAMap::gAriaAtomPtrsNS[aProperty])) ||
((aAriaPropTypes & nsIAccessibleDocument::eCheckHyphenated) &&
aContent->HasAttr(kNameSpaceID_None,
*nsARIAMap::gAriaAtomPtrsHyphenated[aProperty]));
}
PRBool
nsAccUtils::GetAriaProperty(nsIContent *aContent, nsIWeakReference *aWeakShell,
EAriaProperty aProperty, nsAString& aValue,
PRUint32 aAriaPropTypes)
{
aValue.Truncate();
if (!aAriaPropTypes) {
// The property types to check for is unknown, get it from the doc accessible
aAriaPropTypes = GetAriaPropTypes(aContent, aWeakShell);
}
return ((aAriaPropTypes & nsIAccessibleDocument::eCheckNamespaced) &&
aContent->GetAttr(kNameSpaceID_WAIProperties,
*nsARIAMap::gAriaAtomPtrsNS[aProperty],
aValue)) ||
((aAriaPropTypes & nsIAccessibleDocument::eCheckHyphenated) &&
aContent->GetAttr(kNameSpaceID_None,
*nsARIAMap::gAriaAtomPtrsHyphenated[aProperty],
aValue));
}
nsIContent*
nsAccUtils::FindNeighbourPointingToNode(nsIContent *aForNode,
EAriaProperty aAriaProperty,
nsIAtom *aTagName,
nsIAtom *aRelationAttr,
nsIAtom *aTagName,
PRUint32 aAncestorLevelsToSearch)
{
NS_ASSERTION(aAriaProperty == eAria_none || !aRelationAttr,
"Cannot pass in both an ARIA relation property and an atom relation. Choose one");
NS_ASSERTION(aAriaProperty == eAria_none || !aTagName,
"Cannot use aTagName with ARIA relation property, because ARIA relations apply to any tag");
nsCOMPtr<nsIContent> binding;
nsAutoString controlID;
if (!nsAccUtils::GetID(aForNode, controlID)) {
@ -703,14 +637,14 @@ nsAccUtils::FindNeighbourPointingToNode(nsIContent *aForNode,
return nsnull;
if (content != prevSearched) {
labelContent = FindDescendantPointingToID(&controlID, content, aAriaProperty,
labelContent = FindDescendantPointingToID(&controlID, content,
aRelationAttr, nsnull, aTagName);
}
}
break;
}
labelContent = FindDescendantPointingToID(&controlID, aForNode, aAriaProperty,
labelContent = FindDescendantPointingToID(&controlID, aForNode,
aRelationAttr, prevSearched, aTagName);
prevSearched = aForNode;
}
@ -722,7 +656,6 @@ nsAccUtils::FindNeighbourPointingToNode(nsIContent *aForNode,
nsIContent*
nsAccUtils::FindDescendantPointingToID(const nsString *aId,
nsIContent *aLookContent,
EAriaProperty aAriaProperty,
nsIAtom *aRelationAttr,
nsIContent *aExcludeContent,
nsIAtom *aTagType)
@ -731,39 +664,22 @@ nsAccUtils::FindDescendantPointingToID(const nsString *aId,
nsCAutoString idWithSpaces(' ');
LossyAppendUTF16toASCII(*aId, idWithSpaces);
idWithSpaces += ' ';
PRUint32 ariaPropTypes = (aAriaProperty == eAria_none) ? 0 :
nsAccUtils::GetAriaPropTypes(aLookContent);
return FindDescendantPointingToIDImpl(idWithSpaces, aLookContent,
aAriaProperty, ariaPropTypes,
aRelationAttr, aExcludeContent, aTagType);
}
nsIContent*
nsAccUtils::FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces,
nsIContent *aLookContent,
EAriaProperty aAriaProperty,
PRUint32 aAriaPropTypes,
nsIAtom *aRelationAttr,
nsIContent *aExcludeContent,
nsIAtom *aTagType)
{
if (aAriaProperty != eAria_none) { // Tag ignored for ARIA properties, which can apply to anything
nsAutoString idList;
if (nsAccUtils::GetAriaProperty(aLookContent, nsnull, aAriaProperty,
idList, aAriaPropTypes)) {
idList.Insert(' ', 0); // Surround idlist with spaces for search
idList.Append(' ');
// idList is now a set of id's with spaces around each,
// and id also has spaces around it.
// If id is a substring of idList then we have a match
if (idList.Find(aIdWithSpaces) != -1) {
return aLookContent;
}
}
}
else if (!aTagType || aLookContent->Tag() == aTagType) {
NS_ENSURE_TRUE(aLookContent, nsnull);
NS_ENSURE_TRUE(aRelationAttr, nsnull);
if (!aTagType || aLookContent->Tag() == aTagType) {
// Tag matches
if (aRelationAttr) {
// Check for ID in the attribute aRelationAttr, which can be a list
nsAutoString idList;
if (aLookContent->GetAttr(kNameSpaceID_None, aRelationAttr, idList)) {
@ -776,7 +692,6 @@ nsAccUtils::FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces,
return aLookContent;
}
}
}
if (aTagType) {
// Don't bother to search descendants of an element with matching tag.
// That would be like looking for a nested <label> or <description>
@ -792,7 +707,6 @@ nsAccUtils::FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces,
while ((child = aLookContent->GetChildAt(count++)) != nsnull) {
if (child != aExcludeContent) {
labelContent = FindDescendantPointingToIDImpl(aIdWithSpaces, child,
aAriaProperty, aAriaPropTypes,
aRelationAttr, aExcludeContent, aTagType);
if (labelContent) {
return labelContent;
@ -802,62 +716,24 @@ nsAccUtils::FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces,
return nsnull;
}
const char *
nsAccUtils::TrimmedRole(const char *aRole, nsIContent *aContent)
{
const char kWaiRolePrefix[] = "wairole:";
const PRUint32 kWaiRolePrefixLen = NS_ARRAY_LENGTH(kWaiRolePrefix) - 1;
if (!PL_strncmp(aRole, kWaiRolePrefix, kWaiRolePrefixLen)) {
return aRole + kWaiRolePrefixLen;
}
//#ifdef ALLOW_PREFIX_LOOKUP
// Check if prefix was mapped via xmlns:[prefix] to the official WAI role namespace
char *colon = PL_strchr(aRole, ':');
if (colon) {
nsCOMPtr<nsIDOM3Node> dom3Node = do_QueryInterface(aContent);
if (dom3Node) {
// Look up exact prefix name for WAI Roles
nsAutoString prefix;
NS_NAMED_LITERAL_STRING(kWAIRoles_Namespace, "http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#");
dom3Node->LookupPrefix(kWAIRoles_Namespace, prefix);
prefix += ':';
PRUint32 prefixLength = colon - aRole + 1;
if (!PL_strncmp(aRole, NS_LossyConvertUTF16toASCII(prefix).get(), prefixLength)) {
// Is a QName (role="prefix:rolename"), and prefix is mapped to WAI Role namespace
// Trim the prefix off
return aRole + prefixLength;
}
}
}
return aRole;
}
nsRoleMapEntry*
nsAccUtils::GetRoleMapEntry(nsIDOMNode *aNode)
{
nsIContent *content = nsAccessible::GetRoleContent(aNode);
if (!content) {
return nsnull;
}
nsAutoString roleString;
if (!nsAccessNode::GetARIARole(content, roleString)) {
if (!content || !content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::role, roleString)) {
return nsnull;
}
nsWhitespaceTokenizer tokenizer(roleString);
while (tokenizer.hasMoreTokens()) {
// Do a binary search through table for the next role in role list
const char *rawRole = NS_LossyConvertUTF16toASCII(tokenizer.nextToken()).get();
const char *trimmedRole = TrimmedRole(rawRole, content);
//#endif
const char *role = NS_LossyConvertUTF16toASCII(tokenizer.nextToken()).get();
PRInt32 low = 0;
PRInt32 high = nsARIAMap::gWAIRoleMapLength;
while (low <= high) {
PRInt32 index = low + ((high - low) / 2);
PRInt32 compare = PL_strcmp(trimmedRole, nsARIAMap::gWAIRoleMap[index].roleString);
PRInt32 compare = PL_strcmp(role, nsARIAMap::gWAIRoleMap[index].roleString);
if (compare == 0) {
// The role attribute maps to an entry in the role table
return &nsARIAMap::gWAIRoleMap[index];

Просмотреть файл

@ -264,52 +264,6 @@ public:
*/
static PRBool GetID(nsIContent *aContent, nsAString& aID);
/**
* Find out what kinds of properties are checked for this content node's document
* @param aContent The content node we're going to look for ARIA properties on
* @param aWeakShell The presshell for the document we're looking for ARIA properties on (optional optimization)
* @return The types of properties checked
*/
static PRUint32 GetAriaPropTypes(nsIContent *aContent, nsIWeakReference *aWeakShell = nsnull);
/**
* Check for the relevant ARIA property. Can check either for a properly namespaced property,
* or a fake hyphenated namespace using "aria-" as a prefix in HTML. Is optimized to only
* check for each type when it is possible to exist on a given node.
* @param aContent Node to check for property on
* @param aWeakShell The current pres shell if known (as an optimization), or nsnull if not known by caller
* @param aProperty An enumeration indicating which ARIA property we are checking
* @param aAriaPropTypes A bitflag for the property types to check for (namespaced, hyphenated or both), if known by caller
* @return PR_TRUE if the property is defined
*/
static PRBool HasAriaProperty(nsIContent *aContent, nsIWeakReference *aWeakShell,
EAriaProperty aProperty,
PRUint32 aCheckFlags = 0);
/**
* Get the relevant ARIA property. Can check either for a properly namespaced property,
* or a fake hyphenated namespace using "aria-" as a prefix in HTML. Is optimized to only
* check for each type when it is possible to exist on a given node.
* @param aContent Node to check for property on
* @param aWeakShell The current pres shell if known (as an optimization), or nsnull if not known by caller
* @param aProperty An enumeration indicating which ARIA property we are checking
* @param aValue Where to store the property value
* @param aAriaPropTypes A bitflag for the property types to check for (namespaced, hyphenated or both), if known by caller
* @return PR_TRUE if the property is defined
*/
static PRBool GetAriaProperty(nsIContent *aContent, nsIWeakReference *aWeakShell,
EAriaProperty aProperty, nsAString& aValue,
PRUint32 aCheckFlags = 0);
/**
* Given a role string, return the role with any WAI role prefix trimmed off
* @param aRole The role to start with
* @param aContent What content nodes the role is set on
* @return The entire role if there is no prefix that is a WAI role prefix,
* or the role without the prefix, if it was mapped to WAI roles
*/
static const char *TrimmedRole(const char *aRole, nsIContent *aContent);
/**
* Get the role map entry for a given DOM node. This will use the first
* ARIA role if the role attribute provides a space delimited list of roles.
@ -324,17 +278,15 @@ public:
* ID attribute can be either 'id' attribute or 'anonid' if the element is
* anonymous.
*
* @param aAriaProperty - the ARIA property to search for or eAria_none, if aRelationAttr is passed in
* @param aForNode - the given element the search is performed for
* @param aTagName - tag name of searched element, or nsnull for any -- ignored if aAriaProperty passed in
* @param aRelationAttr - attribute name of searched element, ignored if aAriaProperty passed in
* @param aTagName - tag name of searched element, or nsnull for any -- ignored if aAriaProperty passed in
* @param aAncestorLevelsToSearch - points how is the neighborhood of the
* given element big.
*/
static nsIContent *FindNeighbourPointingToNode(nsIContent *aForNode,
EAriaProperty aAriaProperty,
nsIAtom *aRelationAttr,
nsIAtom *aTagName = nsnull,
nsIAtom *aRelationAttr = nsnull,
PRUint32 aAncestorLevelsToSearch = 5);
/**
@ -344,8 +296,7 @@ public:
*
* @param aId - value of searched attribute
* @param aLookContent - element that search is performed inside
* @param aAriaProperty - the ARIA property to search for or eAria_none, if aRelationAttr is passed in
* @param aRelationAttr - searched attribute-- ignored if aAriaProperty passed in
* @param aRelationAttr - searched attribute
* @param if both aAriaProperty and aRelationAttr are null, then any element with aTagType will do
* @param aExcludeContent - element that is skiped for search
* @param aTagType - tag name of searched element, by default it is 'label' --
@ -353,17 +304,14 @@ public:
*/
static nsIContent *FindDescendantPointingToID(const nsString *aId,
nsIContent *aLookContent,
EAriaProperty aAriaProperty,
nsIAtom *aRelationAttr = nsnull,
nsIAtom *aRelationAttr,
nsIContent *aExcludeContent = nsnull,
nsIAtom *aTagType = nsAccessibilityAtoms::label);
// Helper for FindDescendantPointingToID(), same args
static nsIContent *FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces,
nsIContent *aLookContent,
EAriaProperty aAriaProperty,
PRUint32 aAriaPropTypes,
nsIAtom *aRelationAttr = nsnull,
nsIAtom *aRelationAttrs,
nsIContent *aExcludeContent = nsnull,
nsIAtom *aTagType = nsAccessibilityAtoms::label);
};

Просмотреть файл

@ -183,7 +183,7 @@ PRBool nsAccessible::IsTextInterfaceSupportCorrect(nsIAccessible *aAccessible)
nsresult nsAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
// Custom-built QueryInterface() knows when we support nsIAccessibleSelectable
// based on role attribute and waistate:multiselectable
// based on role attribute and aria-multiselectable
*aInstancePtr = nsnull;
if (aIID.Equals(NS_GET_IID(nsIAccessible))) {
@ -203,15 +203,15 @@ nsresult nsAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
if (!content) {
return NS_ERROR_FAILURE; // This accessible has been shut down
}
if (HasRoleAttribute(content)) {
if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::role)) {
// If we have an XHTML role attribute present and the
// waistate multiselectable attribute is true, then we need
// aria-multiselectable attribute is true, then we need
// to support nsIAccessibleSelectable
// If either attribute (role or multiselectable) change, then we'll
// destroy this accessible so that we can follow COM identity rules.
nsAutoString multiselectable;
if (nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_multiselectable, multiselectable) &&
multiselectable.EqualsLiteral("true")) {
if (content->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::aria_multiselectable,
nsAccessibilityAtoms::_true, eCaseMatters)) {
*aInstancePtr = static_cast<nsIAccessibleSelectable*>(this);
NS_ADDREF_THIS();
return NS_OK;
@ -314,15 +314,14 @@ NS_IMETHODIMP nsAccessible::GetDescription(nsAString& aDescription)
}
if (!content->IsNodeOfType(nsINode::eTEXT)) {
nsAutoString description;
nsresult rv = GetTextFromRelationID(eAria_describedby, description);
nsresult rv = GetTextFromRelationID(nsAccessibilityAtoms::aria_describedby, description);
if (NS_FAILED(rv)) {
PRBool isXUL = content->IsNodeOfType(nsINode::eXUL);
if (isXUL) {
// Try XUL <description control="[id]">description text</description>
nsIContent *descriptionContent =
nsAccUtils::FindNeighbourPointingToNode(content, eAria_none,
nsAccessibilityAtoms::description,
nsAccessibilityAtoms::control);
nsAccUtils::FindNeighbourPointingToNode(content, nsAccessibilityAtoms::control,
nsAccessibilityAtoms::description);
if (descriptionContent) {
// We have a description content node
@ -1395,26 +1394,13 @@ NS_IMETHODIMP nsAccessible::SetSelected(PRBool aSelect)
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
NS_ASSERTION(content, "Called for dead accessible");
// For ARIA widgets use WAI namespace or hyphenated property, depending on what doc accepts
PRUint32 nameSpaceID = kNameSpaceID_None; // Default
if (mRoleMapEntry) {
if (0 == (nsAccUtils::GetAriaPropTypes(content, mWeakShell) &
nsIAccessibleDocument::eCheckNamespaced)) {
// No WAI namespaced properties used in this doc, use hyphenated property
if (aSelect) {
return content->SetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_selected,
NS_LITERAL_STRING("true"), PR_TRUE);
}
return content->UnsetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_selected, PR_TRUE);
}
nameSpaceID = kNameSpaceID_WAIProperties;
}
// Use normal property
if (aSelect) {
return content->SetAttr(nameSpaceID, nsAccessibilityAtoms::selected,
NS_LITERAL_STRING("true"), PR_TRUE);
}
return content->UnsetAttr(nameSpaceID, nsAccessibilityAtoms::selected, PR_TRUE);
}
return NS_ERROR_FAILURE;
@ -1676,9 +1662,8 @@ nsresult nsAccessible::AppendFlatStringFromSubtreeRecurse(nsIContent *aContent,
nsIContent *nsAccessible::GetLabelContent(nsIContent *aForNode)
{
if (aForNode->IsNodeOfType(nsINode::eXUL))
return nsAccUtils::FindNeighbourPointingToNode(aForNode, eAria_none,
nsAccessibilityAtoms::label,
nsAccessibilityAtoms::control);
return nsAccUtils::FindNeighbourPointingToNode(aForNode, nsAccessibilityAtoms::control,
nsAccessibilityAtoms::label);
return GetHTMLLabelContent(aForNode);
}
@ -1706,7 +1691,7 @@ nsIContent* nsAccessible::GetHTMLLabelContent(nsIContent *aForNode)
break;
}
// Actually we'll be walking down the content this time, with a depth first search
return nsAccUtils::FindDescendantPointingToID(&forId, walkUpContent, eAria_none,
return nsAccUtils::FindDescendantPointingToID(&forId, walkUpContent,
nsAccessibilityAtoms::_for);
}
}
@ -1714,7 +1699,7 @@ nsIContent* nsAccessible::GetHTMLLabelContent(nsIContent *aForNode)
return nsnull;
}
nsresult nsAccessible::GetTextFromRelationID(EAriaProperty aIDProperty, nsString &aName)
nsresult nsAccessible::GetTextFromRelationID(nsIAtom *aIDProperty, nsString &aName)
{
// Get DHTML name from content subtree pointed to by ID attribute
aName.Truncate();
@ -1722,7 +1707,7 @@ nsresult nsAccessible::GetTextFromRelationID(EAriaProperty aIDProperty, nsString
NS_ASSERTION(content, "Called from shutdown accessible");
nsAutoString ids;
if (!nsAccUtils::GetAriaProperty(content, mWeakShell, aIDProperty, ids)) {
if (!content->GetAttr(kNameSpaceID_None, aIDProperty, ids)) {
return NS_ERROR_FAILURE;
}
ids.CompressWhitespace(PR_TRUE, PR_TRUE);
@ -1732,7 +1717,7 @@ nsresult nsAccessible::GetTextFromRelationID(EAriaProperty aIDProperty, nsString
nsresult rv = NS_ERROR_FAILURE;
// Support idlist as in aaa::labelledby="id1 id2 id3"
// Support idlist as in aria-labelledby="id1 id2 id3"
while (!ids.IsEmpty()) {
nsAutoString id;
PRInt32 idLength = ids.FindChar(' ');
@ -1778,7 +1763,7 @@ nsresult nsAccessible::GetHTMLName(nsAString& aLabel, PRBool aCanAggregateSubtre
// Check for DHTML accessibility labelledby relationship property
nsAutoString label;
nsresult rv = GetTextFromRelationID(eAria_labelledby, label);
nsresult rv = GetTextFromRelationID(nsAccessibilityAtoms::aria_labelledby, label);
if (NS_SUCCEEDED(rv)) {
aLabel = label;
return rv;
@ -1829,7 +1814,7 @@ nsresult nsAccessible::GetXULName(nsAString& aLabel, PRBool aCanAggregateSubtree
// First check for label override via accessibility labelledby relationship
nsAutoString label;
nsresult rv = GetTextFromRelationID(eAria_labelledby, label);
nsresult rv = GetTextFromRelationID(nsAccessibilityAtoms::aria_labelledby, label);
if (NS_SUCCEEDED(rv)) {
aLabel = label;
return rv;
@ -1862,9 +1847,8 @@ nsresult nsAccessible::GetXULName(nsAString& aLabel, PRBool aCanAggregateSubtree
if (NS_FAILED(rv) || label.IsEmpty()) {
label.Truncate();
nsIContent *labelContent =
nsAccUtils::FindNeighbourPointingToNode(content, eAria_none,
nsAccessibilityAtoms::label,
nsAccessibilityAtoms::control);
nsAccUtils::FindNeighbourPointingToNode(content, nsAccessibilityAtoms::control,
nsAccessibilityAtoms::label);
nsCOMPtr<nsIDOMXULLabelElement> xulLabel(do_QueryInterface(labelContent));
// Check if label's value attribute is used
@ -1961,31 +1945,27 @@ NS_IMETHODIMP nsAccessible::GetFinalRole(PRUint32 *aRole)
// This is where the nsIAccessible role depends on both the role and ARIA state
if (*aRole == nsIAccessibleRole::ROLE_ENTRY) {
nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
nsAutoString secret;
if (content && nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_secret, secret) &&
secret.EqualsLiteral("true")) {
// For entry field with aaa:secret="true"
if (content && content->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::aria_secret,
nsAccessibilityAtoms::_true, eCaseMatters)) {
// For entry field with aria-secret="true"
*aRole = nsIAccessibleRole::ROLE_PASSWORD_TEXT;
}
}
else if (*aRole == nsIAccessibleRole::ROLE_PUSHBUTTON) {
nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
if (content) {
if (nsAccUtils::HasAriaProperty(content, mWeakShell, eAria_pressed)) {
// For aaa:pressed="false" or aaa:pressed="true"
if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_pressed)) {
// For aria-pressed="false" or aria-pressed="true"
// For simplicity, any pressed attribute indicates it's a toggle button
*aRole = nsIAccessibleRole::ROLE_TOGGLE_BUTTON;
}
else {
nsAutoString haspopup;
if (nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_haspopup, haspopup) &&
haspopup.EqualsLiteral("true")) {
// For button with aaa:haspopup="true"
else if (content->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::aria_secret,
nsAccessibilityAtoms::_true, eCaseMatters)) {
// For button with aria-haspopup="true"
*aRole = nsIAccessibleRole::ROLE_BUTTONMENU;
}
}
}
}
else if (*aRole == nsIAccessibleRole::ROLE_LISTBOX) {
// A listbox inside of a combo box needs a special role because of ATK mapping to menu
nsCOMPtr<nsIAccessible> parent;
@ -2013,9 +1993,12 @@ NS_IMETHODIMP
nsAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
{
NS_ENSURE_ARG_POINTER(aAttributes);
*aAttributes = nsnull;
if (!mDOMNode)
nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
if (!content) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
@ -2026,48 +2009,28 @@ nsAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
nsresult rv = GetAttributesInternal(attributes);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
nsAutoString id;
nsAutoString oldValueUnused;
if (content && nsAccUtils::GetID(content, id)) {
if (nsAccUtils::GetID(content, id)) {
attributes->SetStringProperty(NS_LITERAL_CSTRING("id"), id, oldValueUnused);
}
// XXX In the future we may need to expose the dynamic content role inheritance chain
// through this attribute
nsAutoString xmlRole;
if (GetARIARole(content, xmlRole)) {
nsWhitespaceTokenizer tokenizer(xmlRole);
nsAutoString trimmedRoles;
while (tokenizer.hasMoreTokens()) {
// Trim off prefixes for WAI roles so they are easier for ATs to recognize --
// they will always appear the same, and the AT need not understand prefixes
const char *rawRole = NS_LossyConvertUTF16toASCII(tokenizer.nextToken()).get();
const char *trimmedRole = nsAccUtils::TrimmedRole(rawRole, content);
if (*trimmedRole) {
if (!trimmedRoles.IsEmpty()) {
trimmedRoles.AppendLiteral(" ");
}
trimmedRoles.Append(NS_ConvertASCIItoUTF16(trimmedRole));
}
}
if (!trimmedRoles.IsEmpty()) {
attributes->SetStringProperty(NS_LITERAL_CSTRING("xml-roles"), trimmedRoles, oldValueUnused);
}
nsAutoString xmlRoles;
if (content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::role, xmlRoles)) {
attributes->SetStringProperty(NS_LITERAL_CSTRING("xml-roles"), xmlRoles, oldValueUnused);
}
// Make sure to keep these two arrays in sync
PRUint32 ariaPropTypes = nsAccUtils::GetAriaPropTypes(content, mWeakShell);
char *ariaPropertyString[] = { "live", "channel", "atomic", "relevant", "datatype", "level",
"posinset", "setsize", "sort", "grab", "dropeffect"};
EAriaProperty ariaPropertyEnum[] = { eAria_live, eAria_channel, eAria_atomic, eAria_relevant,
eAria_datatype, eAria_level, eAria_posinset, eAria_setsize,
eAria_sort, eAria_grab, eAria_dropeffect};
nsIAtom *ariaPropertyEnum[] = { nsAccessibilityAtoms::aria_live, nsAccessibilityAtoms::aria_channel, nsAccessibilityAtoms::aria_atomic, nsAccessibilityAtoms::aria_relevant,
nsAccessibilityAtoms::aria_datatype, nsAccessibilityAtoms::aria_level, nsAccessibilityAtoms::aria_posinset, nsAccessibilityAtoms::aria_setsize,
nsAccessibilityAtoms::aria_sort, nsAccessibilityAtoms::aria_grab, nsAccessibilityAtoms::aria_dropeffect};
NS_ASSERTION(NS_ARRAY_LENGTH(ariaPropertyString) == NS_ARRAY_LENGTH(ariaPropertyEnum),
"ARIA attributes and object property name arrays out of sync");
for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(ariaPropertyString); index ++) {
nsAutoString value;
if (nsAccUtils::GetAriaProperty(content, mWeakShell, ariaPropertyEnum[index], value, ariaPropTypes)) {
if (content->GetAttr(kNameSpaceID_None, ariaPropertyEnum[index], value)) {
ToLowerCase(value);
attributes->SetStringProperty(nsDependentCString(ariaPropertyString[index]), value, oldValueUnused);
}
@ -2078,19 +2041,19 @@ nsAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
nsAutoString atomic, live, relevant, channel, busy;
while (content) {
if (relevant.IsEmpty() &&
nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_relevant, relevant, ariaPropTypes))
content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_relevant, relevant))
attributes->SetStringProperty(NS_LITERAL_CSTRING("container-relevant"), relevant, oldValueUnused);
if (live.IsEmpty() &&
nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_live, live, ariaPropTypes))
content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_live, live))
attributes->SetStringProperty(NS_LITERAL_CSTRING("container-live"), live, oldValueUnused);
if (channel.IsEmpty() &&
nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_channel, channel, ariaPropTypes))
content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_channel, channel))
attributes->SetStringProperty(NS_LITERAL_CSTRING("container-channel"), channel, oldValueUnused);
if (atomic.IsEmpty() &&
nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_atomic, atomic, ariaPropTypes))
content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_atomic, atomic))
attributes->SetStringProperty(NS_LITERAL_CSTRING("container-atomic"), atomic, oldValueUnused);
if (busy.IsEmpty() &&
nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_busy, busy, ariaPropTypes))
content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_busy, busy))
attributes->SetStringProperty(NS_LITERAL_CSTRING("container-busy"), busy, oldValueUnused);
content = content->GetParent();
}
@ -2224,12 +2187,12 @@ PRBool nsAccessible::MappedAttrState(nsIContent *aContent, PRUint32 *aStateInOut
nsStateMapEntry *aStateMapEntry)
{
// Return true if we should continue
if (aStateMapEntry->attributeName == eAria_none) {
if (!aStateMapEntry->attributeName) {
return PR_FALSE; // Stop looking -- no more states
}
nsAutoString attribValue;
if (nsAccUtils::GetAriaProperty(aContent, mWeakShell, aStateMapEntry->attributeName, attribValue)) {
if (aContent->GetAttr(kNameSpaceID_None, *aStateMapEntry->attributeName, attribValue)) {
if (aStateMapEntry->attributeValue == kBoolState) {
// No attribute value map specified in state map entry indicates state cleared
if (attribValue.EqualsLiteral("false")) {
@ -2337,7 +2300,7 @@ nsAccessible::GetFinalState(PRUint32 *aState, PRUint32 *aExtraState)
NS_ENSURE_STATE(content);
nsAutoString autocomplete;
if (nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_autocomplete, autocomplete) &&
if (content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_autocomplete, autocomplete) &&
(autocomplete.EqualsIgnoreCase("inline") ||
autocomplete.EqualsIgnoreCase("list") ||
autocomplete.EqualsIgnoreCase("both"))) {
@ -2346,14 +2309,9 @@ nsAccessible::GetFinalState(PRUint32 *aState, PRUint32 *aExtraState)
// XXX We can remove this hack once we support RDF-based role & state maps
if (mRoleMapEntry && mRoleMapEntry->role == nsIAccessibleRole::ROLE_ENTRY) {
nsAutoString multiline;
if (nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_multiline, multiline) &&
multiline.EqualsLiteral("true")) {
*aExtraState |= nsIAccessibleStates::EXT_STATE_MULTI_LINE;
}
else {
*aExtraState |= nsIAccessibleStates::EXT_STATE_SINGLE_LINE;
}
PRBool isMultiLine = content->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::aria_multiline,
nsAccessibilityAtoms::_true, eCaseMatters);
*aExtraState |= isMultiLine ? nsIAccessibleStates::EXT_STATE_MULTI_LINE : nsIAccessibleStates::EXT_STATE_SINGLE_LINE;
}
}
@ -2404,13 +2362,6 @@ nsAccessible::GetARIAState()
// Once DHTML role is used, we're only readonly if DHTML readonly used
ariaState &= ~nsIAccessibleStates::STATE_READONLY;
if (ariaState & nsIAccessibleStates::STATE_UNAVAILABLE) {
// Disabled elements are not selectable or focusable, even if disabled
// via DHTML accessibility disabled property
ariaState &= ~(nsIAccessibleStates::STATE_SELECTABLE |
nsIAccessibleStates::STATE_FOCUSABLE);
}
ariaState |= mRoleMapEntry->state;
if (MappedAttrState(content, &ariaState, &mRoleMapEntry->attributeMap1) &&
MappedAttrState(content, &ariaState, &mRoleMapEntry->attributeMap2) &&
@ -2422,6 +2373,13 @@ nsAccessible::GetARIAState()
MappedAttrState(content, &ariaState, &mRoleMapEntry->attributeMap8);
}
if (ariaState & nsIAccessibleStates::STATE_UNAVAILABLE) {
// Disabled elements are not selectable or focusable, even if disabled
// via DHTML accessibility disabled property
ariaState &= ~(nsIAccessibleStates::STATE_SELECTABLE |
nsIAccessibleStates::STATE_FOCUSABLE);
}
return ariaState;
}
@ -2438,7 +2396,7 @@ NS_IMETHODIMP nsAccessible::GetValue(nsAString& aValue)
return NS_OK;
}
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
if (content && nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_valuenow, aValue)) {
if (content && content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_valuenow, aValue)) {
return NS_OK;
}
}
@ -2449,13 +2407,13 @@ NS_IMETHODIMP nsAccessible::GetValue(nsAString& aValue)
NS_IMETHODIMP
nsAccessible::GetMaximumValue(double *aMaximumValue)
{
return GetAttrValue(eAria_valuemax, aMaximumValue);
return GetAttrValue(nsAccessibilityAtoms::aria_valuemax, aMaximumValue);
}
NS_IMETHODIMP
nsAccessible::GetMinimumValue(double *aMinimumValue)
{
return GetAttrValue(eAria_valuemin, aMinimumValue);
return GetAttrValue(nsAccessibilityAtoms::aria_valuemin, aMinimumValue);
}
NS_IMETHODIMP
@ -2471,7 +2429,7 @@ nsAccessible::GetMinimumIncrement(double *aMinIncrement)
NS_IMETHODIMP
nsAccessible::GetCurrentValue(double *aValue)
{
return GetAttrValue(eAria_valuenow, aValue);
return GetAttrValue(nsAccessibilityAtoms::aria_valuenow, aValue);
}
NS_IMETHODIMP
@ -2502,15 +2460,9 @@ nsAccessible::SetCurrentValue(double aValue)
nsAutoString newValue;
newValue.AppendFloat(aValue);
if (0 == (nsAccUtils::GetAriaPropTypes(content, mWeakShell) &
nsIAccessibleDocument::eCheckNamespaced)) {
// No WAI namespaced properties used in this doc
return content->SetAttr(kNameSpaceID_None,
nsAccessibilityAtoms::aria_valuenow, newValue, PR_TRUE);
}
return content->SetAttr(kNameSpaceID_WAIProperties,
nsAccessibilityAtoms::valuenow, newValue, PR_TRUE);
}
/* void setName (in DOMString name); */
NS_IMETHODIMP nsAccessible::SetName(const nsAString& name)
@ -2619,11 +2571,7 @@ nsIDOMNode* nsAccessible::GetAtomicRegion()
nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
nsIContent *loopContent = content;
nsAutoString atomic;
PRUint32 ariaPropTypes = nsAccUtils::GetAriaPropTypes(content, mWeakShell);
while (loopContent && !nsAccUtils::GetAriaProperty(loopContent, mWeakShell,
eAria_atomic, atomic,
ariaPropTypes)) {
while (loopContent && !loopContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_atomic, atomic)) {
loopContent = loopContent->GetParent();
}
@ -2663,32 +2611,29 @@ NS_IMETHODIMP nsAccessible::GetAccessibleRelated(PRUint32 aRelationType, nsIAcce
}
if (relatedID.IsEmpty()) {
relatedNode =
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, eAria_labelledby));
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, nsAccessibilityAtoms::aria_labelledby));
}
break;
}
case nsIAccessibleRelation::RELATION_LABELLED_BY:
{
if (!nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_labelledby, relatedID)) {
if (!content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_labelledby, relatedID)) {
relatedNode = do_QueryInterface(GetLabelContent(content));
}
break;
}
case nsIAccessibleRelation::RELATION_DESCRIBED_BY:
{
if (!nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_describedby, relatedID)) {
if (!content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_describedby, relatedID)) {
relatedNode = do_QueryInterface(
nsAccUtils::FindNeighbourPointingToNode(content, eAria_none,
nsAccessibilityAtoms::description,
nsAccessibilityAtoms::control));
nsAccUtils::FindNeighbourPointingToNode(content, nsAccessibilityAtoms::control, nsAccessibilityAtoms::description));
}
break;
}
case nsIAccessibleRelation::RELATION_DESCRIPTION_FOR:
{
relatedNode =
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, eAria_describedby));
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, nsAccessibilityAtoms::aria_describedby));
if (!relatedNode && content->Tag() == nsAccessibilityAtoms::description &&
content->IsNodeOfType(nsINode::eXUL)) {
@ -2703,29 +2648,29 @@ NS_IMETHODIMP nsAccessible::GetAccessibleRelated(PRUint32 aRelationType, nsIAcce
case nsIAccessibleRelation::RELATION_NODE_CHILD_OF:
{
relatedNode =
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, eAria_owns));
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, nsAccessibilityAtoms::aria_owns));
break;
}
case nsIAccessibleRelation::RELATION_CONTROLLED_BY:
{
relatedNode =
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, eAria_controls));
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, nsAccessibilityAtoms::aria_controls));
break;
}
case nsIAccessibleRelation::RELATION_CONTROLLER_FOR:
{
nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_controls, relatedID);
content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_controls, relatedID);
break;
}
case nsIAccessibleRelation::RELATION_FLOWS_TO:
{
nsAccUtils::GetAriaProperty(content, mWeakShell, eAria_flowto, relatedID);
content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_flowto, relatedID);
break;
}
case nsIAccessibleRelation::RELATION_FLOWS_FROM:
{
relatedNode =
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, eAria_flowto));
do_QueryInterface(nsAccUtils::FindNeighbourPointingToNode(content, nsAccessibilityAtoms::aria_flowto));
break;
}
case nsIAccessibleRelation::RELATION_DEFAULT_BUTTON:
@ -3163,7 +3108,7 @@ NS_IMETHODIMP nsAccessible::IsValid(PRBool *aIsValid)
*aIsValid = (0 == (state & nsIAccessibleStates::STATE_INVALID));
// XXX In order to implement this we would need to follow every link
// Perhaps we can get information about invalid links from the cache
// In the mean time authors can use role="wairole:link" aaa:invalid="true"
// In the mean time authors can use role="link" aria_invalid="true"
// to force it for links they internally know to be invalid
return NS_OK;
}
@ -3316,7 +3261,7 @@ PRBool nsAccessible::CheckVisibilityInParentChain(nsIDocument* aDocument, nsIVie
}
nsresult
nsAccessible::GetAttrValue(EAriaProperty aProperty, double *aValue)
nsAccessible::GetAttrValue(nsIAtom *aProperty, double *aValue)
{
NS_ENSURE_ARG_POINTER(aValue);
*aValue = 0;
@ -3332,7 +3277,7 @@ nsAccessible::GetAttrValue(EAriaProperty aProperty, double *aValue)
PRInt32 result = NS_OK;
nsAutoString value;
if (nsAccUtils::GetAriaProperty(content, mWeakShell, aProperty, value))
if (content->GetAttr(kNameSpaceID_None, aProperty, value))
*aValue = value.ToFloat(&result);
return result;

Просмотреть файл

@ -185,7 +185,7 @@ protected:
* @param aName Where to put the text
* @return error or success code
*/
nsresult GetTextFromRelationID(EAriaProperty aIDProperty, nsString &aName);
nsresult GetTextFromRelationID(nsIAtom *aIDProperty, nsString &aName);
static nsIContent *GetHTMLLabelContent(nsIContent *aForNode);
static nsIContent *GetLabelContent(nsIContent *aForNode);
@ -238,7 +238,7 @@ protected:
PRBool CheckVisibilityInParentChain(nsIDocument* aDocument, nsIView* aView);
/**
* Get the container node for an atomic region, defined by aria:atomic="true"
* Get the container node for an atomic region, defined by aria-atomic="true"
* @return the container node
*/
nsIDOMNode* GetAtomicRegion();
@ -251,7 +251,7 @@ protected:
*
* @return - NS_OK_NO_ARIA_VALUE if there is no setted ARIA attribute
*/
nsresult GetAttrValue(EAriaProperty aAriaProperty, double *aValue);
nsresult GetAttrValue(nsIAtom *aAriaProperty, double *aValue);
// Data Members
nsCOMPtr<nsIAccessible> mParent;

Просмотреть файл

@ -84,8 +84,7 @@ PRUint32 nsDocAccessible::gLastFocusedAccessiblesState = 0;
//-----------------------------------------------------
nsDocAccessible::nsDocAccessible(nsIDOMNode *aDOMNode, nsIWeakReference* aShell):
nsHyperTextAccessibleWrap(aDOMNode, aShell), mWnd(nsnull),
mScrollPositionChangedTicks(0), mIsContentLoaded(PR_FALSE),
mAriaPropTypes(eCheckNamespaced)
mScrollPositionChangedTicks(0), mIsContentLoaded(PR_FALSE)
{
// For GTK+ native window, we do nothing here.
if (!mDOMNode)
@ -100,21 +99,7 @@ nsDocAccessible::nsDocAccessible(nsIDOMNode *aDOMNode, nsIWeakReference* aShell)
if (shell) {
// Find mDocument
mDocument = shell->GetDocument();
// Find mAriaPropTypes: the initial type of ARIA properties that should be checked for
if (!mDocument) {
NS_WARNING("No document!");
return;
}
nsCOMPtr<nsIDOMNSHTMLDocument> htmlDoc(do_QueryInterface(mDocument));
if (htmlDoc) {
nsAutoString mimeType;
GetMimeType(mimeType);
mAriaPropTypes = eCheckHyphenated;
if (! mimeType.EqualsLiteral("text/html")) {
mAriaPropTypes |= eCheckNamespaced;
}
}
// Find mWnd
nsIViewManager* vm = shell->GetViewManager();
if (vm) {
@ -225,7 +210,7 @@ NS_IMETHODIMP
nsDocAccessible::GetDescription(nsAString& aDescription)
{
nsAutoString description;
GetTextFromRelationID(eAria_describedby, description);
GetTextFromRelationID(nsAccessibilityAtoms::aria_describedby, description);
aDescription = description;
return NS_OK;
}
@ -909,13 +894,6 @@ NS_IMETHODIMP nsDocAccessible::Observe(nsISupports *aSubject, const char *aTopic
return NS_OK;
}
NS_IMETHODIMP
nsDocAccessible::GetAriaPropTypes(PRUint32 *aAriaPropTypes)
{
*aAriaPropTypes = mAriaPropTypes;
return NS_OK;
}
///////////////////////////////////////////////////////////////////////
// nsIDocumentObserver
@ -960,13 +938,6 @@ nsDocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID
if (!docShell) {
return;
}
if (aNameSpaceID == kNameSpaceID_WAIProperties) {
// Using setAttributeNS() in HTML to set namespaced ARIA properties.
// From this point forward, check namespaced properties, which
// take precedence over hyphenated properties, since in text/html
// that can only be set dynamically.
mAriaPropTypes |= eCheckNamespaced;
}
PRUint32 busyFlags;
docShell->GetBusyFlags(&busyFlags);
@ -992,13 +963,13 @@ nsDocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID
// Universal boolean properties that don't require a role.
if (aAttribute == nsAccessibilityAtoms::disabled ||
(aAttribute == nsAccessibilityAtoms::aria_disabled && (mAriaPropTypes & eCheckHyphenated))) {
aAttribute == nsAccessibilityAtoms::aria_disabled) {
// Fire the state change whether disabled attribute is
// set for XUL, HTML or ARIA namespace.
// Checking the namespace would not seem to gain us anything, because
// disabled really is going to mean the same thing in any namespace.
// We use the attribute instead of the disabled state bit because
// ARIA's aaa:disabled does not affect the disabled state bit
// ARIA's aria-disabled does not affect the disabled state bit
nsCOMPtr<nsIAccessibleStateChangeEvent> enabledChangeEvent =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::EXT_STATE_ENABLED,
@ -1013,28 +984,19 @@ nsDocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID
}
// Check for namespaced ARIA attribute
nsCOMPtr<nsIAtom> ariaAttribute;
if (aNameSpaceID == kNameSpaceID_WAIProperties) {
ariaAttribute = aAttribute;
}
else if (mAriaPropTypes & eCheckHyphenated && aNameSpaceID == kNameSpaceID_None) {
if (aNameSpaceID == kNameSpaceID_None) {
// Check for hyphenated aria-foo property?
const char* attributeName;
aAttribute->GetUTF8String(&attributeName);
if (!PL_strncmp("aria-", attributeName, 5)) {
// Convert to WAI property atom attribute
ariaAttribute = do_GetAtom(attributeName + 5);
ARIAAttributeChanged(aContent, aAttribute);
}
}
if (ariaAttribute) { // We have an ARIA attribute
ARIAAttributeChanged(aContent, ariaAttribute);
return;
}
if (aAttribute == nsAccessibilityAtoms::role ||
aAttribute == nsAccessibilityAtoms::href ||
aAttribute == nsAccessibilityAtoms::onclick ||
aAttribute == nsAccessibilityAtoms::droppable) {
aAttribute == nsAccessibilityAtoms::aria_droppable) {
// Not worth the expense to ensure which namespace these are in
// It doesn't kill use to recreate the accessible even if the attribute was used
// in the wrong namespace or an element that doesn't support it
@ -1042,8 +1004,9 @@ nsDocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID
return;
}
if (aAttribute == nsAccessibilityAtoms::selected) {
// DHTML or XUL selection
if (aAttribute == nsAccessibilityAtoms::selected ||
aAttribute == nsAccessibilityAtoms::aria_selected) {
// ARIA or XUL selection
nsCOMPtr<nsIAccessible> multiSelect = GetMultiSelectFor(targetNode);
// Multi selects use selection_add and selection_remove
// Single select widgets just mirror event_selection for
@ -1063,11 +1026,8 @@ nsDocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID
static nsIContent::AttrValuesArray strings[] =
{&nsAccessibilityAtoms::_empty, &nsAccessibilityAtoms::_false, nsnull};
if (aContent->FindAttrValueIn(kNameSpaceID_None,
nsAccessibilityAtoms::selected,
strings, eCaseMatters) !=
nsIContent::ATTR_VALUE_NO_MATCH) {
if (aContent->FindAttrValueIn(kNameSpaceID_None, aAttribute,
strings, eCaseMatters) >= 0) {
FireDelayedToolkitEvent(nsIAccessibleEvent::EVENT_SELECTION_REMOVE,
targetNode, nsnull);
return;
@ -1095,7 +1055,7 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
if (!targetNode)
return;
if (aAttribute == nsAccessibilityAtoms::required) {
if (aAttribute == nsAccessibilityAtoms::aria_required) {
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::STATE_REQUIRED,
@ -1104,7 +1064,7 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
return;
}
if (aAttribute == nsAccessibilityAtoms::invalid) {
if (aAttribute == nsAccessibilityAtoms::aria_invalid) {
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::STATE_INVALID,
@ -1113,7 +1073,7 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
return;
}
if (aAttribute == nsAccessibilityAtoms::activedescendant) {
if (aAttribute == nsAccessibilityAtoms::aria_activedescendant) {
// The activedescendant universal property redirects accessible focus events
// to the element with the id that activedescendant points to
nsCOMPtr<nsIDOMNode> currentFocus = GetCurrentFocus();
@ -1125,7 +1085,7 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
return;
}
if (!HasRoleAttribute(aContent)) {
if (!aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::role)) {
// We don't care about these other ARIA attribute changes unless there is
// an ARIA role set for the element
// XXX: we should check the role map to see if the changed property is
@ -1133,9 +1093,10 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
return;
}
if (aAttribute == nsAccessibilityAtoms::checked ||
aAttribute == nsAccessibilityAtoms::pressed) {
const PRUint32 kState = (aAttribute == nsAccessibilityAtoms::checked) ?
// The following ARIA attributes only take affect when dynamic content role is present
if (aAttribute == nsAccessibilityAtoms::aria_checked ||
aAttribute == nsAccessibilityAtoms::aria_pressed) {
const PRUint32 kState = (aAttribute == nsAccessibilityAtoms::aria_checked) ?
nsIAccessibleStates::STATE_CHECKED :
nsIAccessibleStates::STATE_PRESSED;
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
@ -1144,7 +1105,7 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
if (targetNode == gLastFocusedNode) {
// State changes for MIXED state currently only supported for focused item, because
// otherwise we would need access to the old attribute value in this listener.
// This is because we don't know if the previous value of aaa:checked or aaa:pressed was "mixed"
// This is because we don't know if the previous value of aria-checked or aria-pressed was "mixed"
// without caching that info.
nsCOMPtr<nsIAccessible> accessible;
event->GetAccessible(getter_AddRefs(accessible));
@ -1163,7 +1124,7 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
return;
}
if (aAttribute == nsAccessibilityAtoms::expanded) {
if (aAttribute == nsAccessibilityAtoms::aria_expanded) {
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::STATE_EXPANDED,
@ -1172,7 +1133,7 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
return;
}
if (aAttribute == nsAccessibilityAtoms::readonly) {
if (aAttribute == nsAccessibilityAtoms::aria_readonly) {
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::STATE_READONLY,
@ -1181,23 +1142,20 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
return;
}
if (aAttribute == nsAccessibilityAtoms::valuenow) {
if (aAttribute == nsAccessibilityAtoms::aria_valuenow) {
FireDelayedToolkitEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE,
targetNode, nsnull);
return;
}
if (aAttribute == nsAccessibilityAtoms::multiselectable) {
if (aAttribute == nsAccessibilityAtoms::aria_multiselectable &&
aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::role)) {
// This affects whether the accessible supports nsIAccessibleSelectable.
// COM says we cannot change what interfaces are supported on-the-fly,
// so invalidate this object. A new one will be created on demand.
if (HasRoleAttribute(aContent)) {
// The multiselectable and other waistate attributes only take affect
// when dynamic content role is present
InvalidateCacheSubtree(aContent, nsIAccessibleEvent::EVENT_DOM_SIGNIFICANT_CHANGE);
}
}
}
void nsDocAccessible::ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,

Просмотреть файл

@ -215,7 +215,6 @@ class nsDocAccessible : public nsHyperTextAccessibleWrap,
protected:
PRBool mIsAnchor;
PRBool mIsAnchorJumped;
PRUint32 mAriaPropTypes;
static PRUint32 gLastFocusedAccessiblesState;
private:

Просмотреть файл

@ -465,13 +465,13 @@ PRBool nsRootAccessible::FireAccessibleFocusEvent(nsIAccessible *aAccessible,
}
}
// Check for aaa:activedescendant, which changes which element has focus
// Check for aria-activedescendant, which changes which element has focus
nsCOMPtr<nsIDOMNode> finalFocusNode = aNode;
nsCOMPtr<nsIAccessible> finalFocusAccessible = aAccessible;
nsCOMPtr<nsIContent> finalFocusContent = do_QueryInterface(aNode);
if (finalFocusContent) {
nsAutoString id;
if (nsAccUtils::GetAriaProperty(finalFocusContent, nsnull, eAria_activedescendant, id)) {
if (finalFocusContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_activedescendant, id)) {
nsCOMPtr<nsIDOMDocument> domDoc;
aNode->GetOwnerDocument(getter_AddRefs(domDoc));
if (!domDoc) {

Просмотреть файл

@ -1106,7 +1106,7 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetDescription(nsAString& aDescription)
{
aDescription.Truncate();
// First check to see if combo box itself has a description, perhaps through
// tooltip (title attribute) or via aaa:describedby
// tooltip (title attribute) or via aria-describedby
nsAccessible::GetDescription(aDescription);
if (!aDescription.IsEmpty()) {
return NS_OK;

Просмотреть файл

@ -983,7 +983,7 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsProbablyForLayout(PRBool *aIsProbablyForL
RETURN_LAYOUT_ANSWER(PR_FALSE, "Has role attribute");
}
if (HasRoleAttribute(content)) {
if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::role)) {
RETURN_LAYOUT_ANSWER(PR_TRUE, "Has role attribute, and role is table");
}

Просмотреть файл

@ -476,7 +476,8 @@ STDMETHODIMP nsAccessibleWrap::get_accRole(
if (content->IsNodeOfType(nsINode::eELEMENT)) {
nsAutoString roleString;
if (msaaRole != ROLE_SYSTEM_CLIENT && !GetARIARole(content, roleString)) {
if (msaaRole != ROLE_SYSTEM_CLIENT &&
!content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::role, roleString)) {
nsINodeInfo *nodeInfo = content->NodeInfo();
nodeInfo->GetName(roleString);
nsAutoString nameSpaceURI;

Просмотреть файл

@ -225,7 +225,7 @@ NS_IMETHODIMP
nsXFormsAccessible::GetName(nsAString& aName)
{
nsAutoString name;
nsresult rv = GetTextFromRelationID(eAria_labelledby, name);
nsresult rv = GetTextFromRelationID(nsAccessibilityAtoms::aria_labelledby, name);
if (NS_SUCCEEDED(rv) && !name.IsEmpty()) {
aName = name;
return NS_OK;
@ -239,7 +239,7 @@ NS_IMETHODIMP
nsXFormsAccessible::GetDescription(nsAString& aDescription)
{
nsAutoString description;
nsresult rv = GetTextFromRelationID(eAria_describedby, description);
nsresult rv = GetTextFromRelationID(nsAccessibilityAtoms::aria_describedby, description);
if (NS_SUCCEEDED(rv) && !description.IsEmpty()) {
aDescription = description;

Просмотреть файл

@ -59,7 +59,7 @@ NS_IMETHODIMP
nsXFormsLabelAccessible::GetName(nsAString& aName)
{
nsAutoString name;
nsresult rv = GetTextFromRelationID(eAria_labelledby, name);
nsresult rv = GetTextFromRelationID(nsAccessibilityAtoms::aria_labelledby, name);
aName = name;
return rv;
}
@ -68,7 +68,7 @@ NS_IMETHODIMP
nsXFormsLabelAccessible::GetDescription(nsAString& aDescription)
{
nsAutoString description;
nsresult rv = GetTextFromRelationID(eAria_describedby, description);
nsresult rv = GetTextFromRelationID(nsAccessibilityAtoms::aria_describedby, description);
aDescription = description;
return rv;
}

Просмотреть файл

@ -59,7 +59,6 @@
windowtype="Browser:page-info"
onload="onLoadPageInfo()"
onunload="onUnloadPageInfo()"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
align="stretch"
screenX="10" screenY="10"
width="&pageInfoWindow.width;" height="&pageInfoWindow.height;"
@ -330,7 +329,7 @@
<vbox id="permList" flex="1">
<vbox>
<label value="&permImage;" control="permImageGroup imageRadioGroup"/>
<hbox id="permImageGroup" xhtml:role="group">
<hbox id="permImageGroup" role="group">
<checkbox id="imageDef" command="cmd_imageDef" label="&permUseDefault;"/>
<spacer flex="1"/>
<radiogroup id="imageRadioGroup" orient="horizontal">
@ -341,7 +340,7 @@
</vbox>
<vbox>
<label value="&permPopup;" control="permPopupGroup popupRadioGroup"/>
<hbox id="permPopupGroup" xhtml:role="group">
<hbox id="permPopupGroup" role="group">
<checkbox id="popupDef" command="cmd_popupDef" label="&permUseDefault;"/>
<spacer flex="1"/>
<radiogroup id="popupRadioGroup" orient="horizontal">
@ -352,7 +351,7 @@
</vbox>
<vbox>
<label value="&permCookie;" control="permCookieGroup cookieRadioGroup"/>
<hbox id="permCookieGroup" xhtml:role="group">
<hbox id="permCookieGroup" role="group">
<checkbox id="cookieDef" command="cmd_cookieDef" label="&permUseDefault;"/>
<spacer flex="1"/>
<radiogroup id="cookieRadioGroup" orient="horizontal">
@ -364,7 +363,7 @@
</vbox>
<vbox>
<label value="&permInstall;" control="permInstallGroup installRadioGroup"/>
<hbox id="permInstallGroup" xhtml:role="group">
<hbox id="permInstallGroup" role="group">
<checkbox id="installDef" command="cmd_installDef" label="&permUseDefault;"/>
<spacer flex="1"/>
<radiogroup id="installRadioGroup" orient="horizontal">

Просмотреть файл

@ -47,8 +47,7 @@
onunload="MigrationWizard.uninit()"
style="width: 40em;"
buttons="accept,cancel"
branded="true"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
branded="true">
<script type="application/x-javascript" src="chrome://browser/content/migration/migration.js"/>
@ -131,8 +130,7 @@
oncommand="MigrationWizard.onImportItemCommand();">
<description control="dataSources">&importItems.label;</description>
<vbox id="dataSources" style="overflow: auto; -moz-appearance: listbox" align="left" flex="1"
xhtml:role="group"/>
<vbox id="dataSources" style="overflow: auto; -moz-appearance: listbox" align="left" flex="1" role="group"/>
</wizardpage>
<wizardpage id="homePageImport" pageid="homePageImport"
@ -152,14 +150,14 @@
onpageshow="MigrationWizard.onMigratingPageShow();">
<description control="migratingItems">&migrating.label;</description>
<vbox id="migratingItems" style="overflow: auto;" align="left" xhtml:role="group"/>
<vbox id="migratingItems" style="overflow: auto;" align="left" role="group"/>
</wizardpage>
<wizardpage id="done" pageid="done" label="&done.title;"
onpageshow="MigrationWizard.onDonePageShow();">
<description control="doneItems">&done.label;</description>
<vbox id="doneItems" style="overflow: auto;" align="left" xhtml:role="group"/>
<vbox id="doneItems" style="overflow: auto;" align="left" role="group"/>
</wizardpage>
</wizard>

Просмотреть файл

@ -52,9 +52,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();"
helpURI="chrome://browser/locale/help/help.rdf"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:aaa="http://www.w3.org/2005/07/aaa">
helpURI="chrome://browser/locale/help/help.rdf">
<preferences id="advancedPreferences">
<preference id="browser.preferences.advanced.selectedTabIndex"
@ -227,7 +225,7 @@
preference="browser.cache.disk.capacity"
onsyncfrompreference="return gAdvancedPane.readCacheSize();"
onsynctopreference="return gAdvancedPane.writeCacheSize();"
aaa:labelledby="useCacheBefore cacheSize useCacheAfter"/>
aria-labelledby="useCacheBefore cacheSize useCacheAfter"/>
<label id="useCacheAfter" flex="1">&useCacheAfter.label;</label>
<button id="clearCacheButton" icon="clear"
label="&clearCacheNow.label;" accesskey="&clearCacheNow.accesskey;"
@ -239,7 +237,7 @@
<!-- Update -->
<tabpanel id="updatePanel" orient="vertical" align="start">
<label control="autoUpdateGroup">&autoCheck.label;</label>
<vbox class="indent" id="autoUpdateGroup" xhtml:role="group">
<vbox class="indent" id="autoUpdateGroup" role="group">
<checkbox id="enableAppUpdate"
label="&enableAppUpdate.label;"
accesskey="&enableAppUpdate.accesskey;"
@ -325,7 +323,7 @@
I KID YOU NOT.
-->
<radiogroup id="certSelection" orient="horizontal" preftype="string"
preference="security.default_personal_cert" aaa:labelledby="CertGroupCaption CertSelectionDesc">
preference="security.default_personal_cert" aria-abelledby="CertGroupCaption CertSelectionDesc">
<radio label="&certs.auto;" accesskey="&certs.auto.accesskey;"
value="Select Automatically"/>
<radio label="&certs.ask;" accesskey="&certs.ask.accesskey;"

Просмотреть файл

@ -34,8 +34,7 @@
<vbox id="safebrowsing-palm-message-content"
class="safebrowsing-palm-fixed-width"
style="-moz-user-focus: normal"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xhtml:role="alert">
role="alert">
<hbox id="safebrowsing-palm-close-container" align="center"
class="safebrowsing-palm-fixed-width">

Просмотреть файл

@ -59,10 +59,7 @@ static const PRInt32 kNameSpaceID_None = 0;
#define kNameSpaceID_XUL 9
#define kNameSpaceID_SVG 10
#define kNameSpaceID_XMLEvents 11
#define kNameSpaceID_XHTML2_Unofficial 12
#define kNameSpaceID_WAIRoles 13
#define kNameSpaceID_WAIProperties 14
#define kNameSpaceID_LastBuiltin 14 // last 'built-in' namespace
#define kNameSpaceID_LastBuiltin 11 // last 'built-in' namespace
#define NS_NAMESPACEMANAGER_CONTRACTID "@mozilla.org/content/namespacemanager;1"

Просмотреть файл

@ -71,9 +71,6 @@ PRBool NS_SVGEnabled();
#define kXULNameSpaceURI "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
#define kSVGNameSpaceURI "http://www.w3.org/2000/svg"
#define kXMLEventsNameSpaceURI "http://www.w3.org/2001/xml-events"
#define kXHTML2UnofficialNameSpaceURI "http://www.w3.org/TR/xhtml2" // Will eventually change
#define kWAIRolesNameSpaceURI "http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#"
#define kWAIPropertiesNameSpaceURI "http://www.w3.org/2005/07/aaa"
class nsNameSpaceKey : public PLDHashEntryHdr
{
@ -162,10 +159,6 @@ nsresult NameSpaceManagerImpl::Init()
REGISTER_NAMESPACE(kXULNameSpaceURI, kNameSpaceID_XUL);
REGISTER_NAMESPACE(kSVGNameSpaceURI, kNameSpaceID_SVG);
REGISTER_NAMESPACE(kXMLEventsNameSpaceURI, kNameSpaceID_XMLEvents);
REGISTER_NAMESPACE(kXHTML2UnofficialNameSpaceURI,
kNameSpaceID_XHTML2_Unofficial);
REGISTER_NAMESPACE(kWAIRolesNameSpaceURI, kNameSpaceID_WAIRoles);
REGISTER_NAMESPACE(kWAIPropertiesNameSpaceURI, kNameSpaceID_WAIProperties);
#undef REGISTER_NAMESPACE

Просмотреть файл

@ -677,13 +677,10 @@ nsXHTMLParanoidFragmentSink::HandleStartElement(const PRUnichar *aName,
NS_ENSURE_SUCCESS(rv, rv);
name = nodeInfo->NameAtom();
// Add if it's xmlns, xml:, aaa:, xhtml2:role, or on the HTML whitelist
// Add if it's xmlns, xml: or on the HTML whitelist
if (nameSpaceID == kNameSpaceID_XMLNS ||
nameSpaceID == kNameSpaceID_XML ||
nameSpaceID == kNameSpaceID_WAIProperties ||
(nameSpaceID == kNameSpaceID_XHTML2_Unofficial &&
name == nsGkAtoms::role) ||
sAllowedAttributes && sAllowedAttributes->GetEntry(name)) {
(sAllowedAttributes && sAllowedAttributes->GetEntry(name))) {
allowedAttrs.AppendElement(aAtts[i]);
allowedAttrs.AppendElement(aAtts[i + 1]);
}

Просмотреть файл

@ -114,12 +114,6 @@
<menuitem label="&namespaceTitle.XMLEvents.label;"
id="mi_XMLEventsNS"
value="http://www.w3.org/2001/xml-events"/>
<menuitem label="&namespaceTitle.WAIRoles.label;"
id="mi_WAIRolesNS"
value="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy"/>
<menuitem label="&namespaceTitle.WAIProperties.label;"
id="mi_WAIPropertiesNS"
value="http://www.w3.org/2005/07/aaa"/>
<!-- Value set onload -->
<menuitem label="&namespaceTitle.default.label;"
id="mi_namespace"/>

Просмотреть файл

@ -102,12 +102,6 @@
<menuitem label="&namespaceTitle.XMLEvents.label;"
id="mi_XMLEventsNS"
value="http://www.w3.org/2001/xml-events"/>
<menuitem label="&namespaceTitle.WAIRoles.label;"
id="mi_WAIRolesNS"
value="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy"/>
<menuitem label="&namespaceTitle.WAIProperties.label;"
id="mi_WAIPropertiesNS"
value="http://www.w3.org/2005/07/aaa"/>
<!-- Value set onload -->
<menuitem label="&namespaceTitle.default.label;"
id="mi_namespace"/>

Просмотреть файл

@ -7,8 +7,7 @@
<dialog id="commonDialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xhtml:role="alert"
role="alert"
onload="commonDialogOnLoad();"
ondialogaccept="return commonDialogOnAccept();"
ondialogextra1="return commonDialogOnExtra1();"

Просмотреть файл

@ -874,7 +874,7 @@
chromedir="&locale.dir;" xbl:inherits="disabled"
oncommand="document.getBindingParent(this)._increaseOrDecreaseMonth(1);"/>
</hbox>
<grid class="datepicker-grid" html:role="grid">
<grid class="datepicker-grid" role="grid">
<columns>
<column class="datepicker-gridrow" flex="1"/>
<column class="datepicker-gridrow" flex="1"/>
@ -886,67 +886,67 @@
</columns>
<rows anonid="datebox">
<row anonid="dayofweekbox">
<label class="datepicker-weeklabel" html:role="columnheader"/>
<label class="datepicker-weeklabel" html:role="columnheader"/>
<label class="datepicker-weeklabel" html:role="columnheader"/>
<label class="datepicker-weeklabel" html:role="columnheader"/>
<label class="datepicker-weeklabel" html:role="columnheader"/>
<label class="datepicker-weeklabel" html:role="columnheader"/>
<label class="datepicker-weeklabel" html:role="columnheader"/>
<label class="datepicker-weeklabel" role="columnheader"/>
<label class="datepicker-weeklabel" role="columnheader"/>
<label class="datepicker-weeklabel" role="columnheader"/>
<label class="datepicker-weeklabel" role="columnheader"/>
<label class="datepicker-weeklabel" role="columnheader"/>
<label class="datepicker-weeklabel" role="columnheader"/>
<label class="datepicker-weeklabel" role="columnheader"/>
</row>
<row>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
</row>
<row>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
</row>
<row>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
</row>
<row>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
</row>
<row>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
</row>
<row>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" html:role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
<label class="datepicker-gridlabel" role="gridcell"/>
</row>
</rows>
</grid>
@ -1204,24 +1204,24 @@
<xul:hbox class="textbox-input-box datetimepicker-input-box" align="center"
allowevents="true" xbl:inherits="context">
<xul:hbox class="datetimepicker-input-subbox" align="baseline">
<html:input class="datetimepicker-input textbox-input" anonid="input-one"
<input class="datetimepicker-input textbox-input" anonid="input-one"
size="2" maxlength="2" flex="1" chromedir="&locale.dir;"
xbl:inherits="disabled,readonly"/>
</xul:hbox>
<xul:label anonid="sep-first" class="datetimepicker-separator" value=":"/>
<xul:hbox class="datetimepicker-input-subbox" align="baseline">
<html:input class="datetimepicker-input textbox-input" anonid="input-two"
<input class="datetimepicker-input textbox-input" anonid="input-two"
size="2" maxlength="2" flex="1" chromedir="&locale.dir;"
xbl:inherits="disabled,readonly"/>
</xul:hbox>
<xul:label anonid="sep-second" class="datetimepicker-separator" value=":"/>
<xul:hbox class="datetimepicker-input-subbox" align="center">
<html:input class="datetimepicker-input textbox-input" anonid="input-three"
<input class="datetimepicker-input textbox-input" anonid="input-three"
size="2" maxlength="2" flex="1" chromedir="&locale.dir;"
xbl:inherits="disabled,readonly"/>
</xul:hbox>
<xul:hbox class="datetimepicker-input-subbox" align="center">
<html:input class="datetimepicker-input textbox-input" anonid="input-ampm"
<input class="datetimepicker-input textbox-input" anonid="input-ampm"
size="2" maxlength="2" flex="1" chromedir="&locale.dir;"
xbl:inherits="disabled,readonly"/>
</xul:hbox>

Просмотреть файл

@ -508,15 +508,14 @@
<content dlgbuttons="accept,cancel" persist="lastSelected screenX screenY"
closebuttonlabel="&preferencesCloseButton.label;"
closebuttonaccesskey="&preferencesCloseButton.accesskey;"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xhtml:role="dialog"
role="dialog"
#ifdef XP_WIN
title="&preferencesDefaultTitleWin.title;">
#else
title="&preferencesDefaultTitleMac.title;">
#endif
<xul:radiogroup anonid="selector" orient="horizontal" class="paneSelector chromeclass-toolbar"
xhtml:role="listbox"/> <!-- Expose to accessibility APIs as a listbox -->
role="listbox"/> <!-- Expose to accessibility APIs as a listbox -->
<xul:hbox flex="1" class="paneDeckContainer">
<xul:deck anonid="paneDeck" flex="1">
<children includes="prefpane"/>

Просмотреть файл

@ -13,8 +13,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 35em;"
ondialogaccept="gRemovePasswordDialog.removePassword();"
onload="gRemovePasswordDialog.init()"
xmlns:aaa="http://www.w3.org/2005/07/aaa">
onload="gRemovePasswordDialog.init()">
<script type="application/javascript" src="chrome://mozapps/content/preferences/removemp.js"/>
@ -34,7 +33,7 @@
<label control="password" value="&setPassword.oldPassword.label;"/>
<textbox id="password" type="password"
oninput="gRemovePasswordDialog.validateInput();"
aaa:describedby="warnings"/>
aria-describedby="warnings"/>
</hbox>
</groupbox>

Просмотреть файл

@ -4,7 +4,6 @@
<bindings id="globalBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="unifiedWindow">
@ -49,11 +48,11 @@
persist="lastSelected screenX screenY"
closebuttonlabel="&preferencesCloseButton.label;"
closebuttonaccesskey="&preferencesCloseButton.accesskey;"
xhtml:role="dialog"
role="dialog"
title="&preferencesDefaultTitleMac.title;"
titlebarcolor="#EBEBEB">
<xul:radiogroup anonid="selector" orient="horizontal" class="paneSelector chromeclass-toolbar"
xhtml:role="listbox"/> <!-- Expose to accessibility APIs as a listbox -->
role="listbox"/> <!-- Expose to accessibility APIs as a listbox -->
<xul:hbox flex="1" class="paneDeckContainer">
<xul:deck anonid="paneDeck" flex="1">
<children includes="prefpane"/>