diff --git a/accessible/public/nsIAccessibleDocument.idl b/accessible/public/nsIAccessibleDocument.idl index 80ef42fdcf31..fdbd4b6360af 100644 --- a/accessible/public/nsIAccessibleDocument.idl +++ b/accessible/public/nsIAccessibleDocument.idl @@ -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; }; diff --git a/accessible/public/nsIAccessibleRole.idl b/accessible/public/nsIAccessibleRole.idl index d0b922d1bb35..8ccbdf191b69 100755 --- a/accessible/public/nsIAccessibleRole.idl +++ b/accessible/public/nsIAccessibleRole.idl @@ -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; diff --git a/accessible/src/base/nsARIAMap.cpp b/accessible/src/base/nsARIAMap.cpp index 5ab294d2a798..4ab11a1be2da 100644 --- a/accessible/src/base/nsARIAMap.cpp +++ b/accessible/src/base/nsARIAMap.cpp @@ -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 }; diff --git a/accessible/src/base/nsARIAMap.h b/accessible/src/base/nsARIAMap.h index 91755917b4ab..7b9440f7e378 100644 --- a/accessible/src/base/nsARIAMap.h +++ b/accessible/src/base/nsARIAMap.h @@ -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; diff --git a/accessible/src/base/nsARIAPropertyList.h b/accessible/src/base/nsARIAPropertyList.h deleted file mode 100644 index e5391f123520..000000000000 --- a/accessible/src/base/nsARIAPropertyList.h +++ /dev/null @@ -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 - * - * 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) diff --git a/accessible/src/base/nsAccessNode.cpp b/accessible/src/base/nsAccessNode.cpp index 8f87a3357c65..b0b30ccb043c 100755 --- a/accessible/src/base/nsAccessNode.cpp +++ b/accessible/src/base/nsAccessNode.cpp @@ -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); -} diff --git a/accessible/src/base/nsAccessNode.h b/accessible/src/base/nsAccessNode.h index 50b7e75e0a9b..75e2c5446277 100755 --- a/accessible/src/base/nsAccessNode.h +++ b/accessible/src/base/nsAccessNode.h @@ -72,16 +72,6 @@ class nsIDocShellTreeItem; typedef nsInterfaceHashtable 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 GetDOMNodeForContainer(nsISupports *aContainer); static already_AddRefed 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); diff --git a/accessible/src/base/nsAccessibilityAtomList.h b/accessible/src/base/nsAccessibilityAtomList.h index 4eda1a7d7308..583f264958cc 100755 --- a/accessible/src/base/nsAccessibilityAtomList.h +++ b/accessible/src/base/nsAccessibilityAtomList.h @@ -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") diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp index 0b12b06dfff5..130e57997fab 100644 --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -1489,33 +1489,23 @@ PRBool nsAccessibilityService::HasUniversalAriaProperty(nsIContent *aContent, nsIWeakReference *aWeakShell) { - nsCOMPtr 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 diff --git a/accessible/src/base/nsAccessibilityUtils.cpp b/accessible/src/base/nsAccessibilityUtils.cpp index 69ac4785e625..1333f1012c27 100755 --- a/accessible/src/base/nsAccessibilityUtils.cpp +++ b/accessible/src/base/nsAccessibilityUtils.cpp @@ -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 docAccessible; - if (aWeakShell) { - docAccessible = nsAccessNode::GetDocAccessibleFor(aWeakShell); - } - else { - nsCOMPtr 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 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,26 +664,25 @@ 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 + NS_ENSURE_TRUE(aLookContent, nsnull); + NS_ENSURE_TRUE(aRelationAttr, nsnull); + + if (!aTagType || aLookContent->Tag() == aTagType) { + // Tag matches + // Check for ID in the attribute aRelationAttr, which can be a list nsAutoString idList; - if (nsAccUtils::GetAriaProperty(aLookContent, nsnull, aAriaProperty, - idList, aAriaPropTypes)) { + if (aLookContent->GetAttr(kNameSpaceID_None, aRelationAttr, idList)) { idList.Insert(' ', 0); // Surround idlist with spaces for search idList.Append(' '); // idList is now a set of id's with spaces around each, @@ -760,23 +692,6 @@ nsAccUtils::FindDescendantPointingToIDImpl(nsCString& aIdWithSpaces, return aLookContent; } } - } - else 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)) { - 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; - } - } - } if (aTagType) { // Don't bother to search descendants of an element with matching tag. // That would be like looking for a nested