--- a/accessible/public/nsIAccessibleDocument.idl
+++ b/accessible/public/nsIAccessibleDocument.idl
@@ -53,17 +53,17 @@ interface nsIDOMWindow;
* You can QueryInterface to nsIAccessibleDocument from
* the nsIAccessible or nsIAccessNode for the root node
* of a document. You can also get one from
* nsIAccessNode::GetAccessibleDocument() or
* nsIAccessibleEvent::GetAccessibleDocument()
*
* @status UNDER_REVIEW
*/
-[scriptable, uuid(81ddd75f-adbd-4a1c-b87c-6522bcea0596)]
+[scriptable, uuid(b7ae45bd-21e9-4ed5-a67e-86448b25d56b)]
interface nsIAccessibleDocument : nsISupports
{
/**
* The URL of the document
*/
readonly attribute AString URL;
/**
@@ -117,32 +117,9 @@ interface nsIAccessibleDocument : nsISup
* @param aDOMNode The DOM node we need an accessible for.
* @param aCanCreate Can accessibles be created or must it be the first
* cached accessible in the parent chain?
* @return An first nsIAccessible found by crawling up the DOM node
* to the document root.
*/
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;
};
--- a/accessible/public/nsIAccessibleRole.idl
+++ b/accessible/public/nsIAccessibleRole.idl
@@ -56,17 +56,17 @@ interface nsIAccessibleRole : nsISupport
* Represents a title or caption bar for a window. It is used by MSAA only,
* supported automatically by MS Windows.
*/
const unsigned long ROLE_TITLEBAR = 1;
/**
* 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;
/**
* Represents a vertical or horizontal scroll bar, which is part of the client
* area or used in a control.
*/
const unsigned long ROLE_SCROLLBAR = 3;
@@ -93,17 +93,17 @@ interface nsIAccessibleRole : nsISupport
*/
const unsigned long ROLE_CARET = 7;
/**
* Represents an alert or a condition that a user should be notified about.
* 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;
/**
* Represents the window frame, which contains child objects such as
* a title bar, client, and other objects contained in a window. The role
* is supported automatically by MS Windows.
*/
@@ -111,41 +111,41 @@ interface nsIAccessibleRole : nsISupport
/**
* XXX: document this.
*/
const unsigned long ROLE_CLIENT = 10;
/**
* 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;
/**
* Represents a ToolTip that provides helpful hints.
*/
const unsigned long ROLE_TOOLTIP = 13;
/**
* 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;
/**
* Represents a pane within a frame or document window. Users can navigate
* between panes and within the contents of the current pane, but cannot
* navigate between items in different panes. Thus, panes represent a level
* of grouping lower than frame windows or documents, but above individual
@@ -155,88 +155,88 @@ interface nsIAccessibleRole : nsISupport
/**
* Represents a graphical image used to represent data.
*/
const unsigned long ROLE_CHART = 17;
/**
* Represents a dialog box or message box. It is used for xul:dialog,
- * role="wairole:dialog".
+ * role="dialog".
*/
const unsigned long ROLE_DIALOG = 18;
/**
* Represents a window border.
*/
const unsigned long ROLE_BORDER = 19;
/**
* 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;
/**
* Represents a status bar, which is an area at the bottom of a window that
* displays information about the current operation, state of the application,
* or selected object. The status bar has multiple fields, which display
* different kinds of information. It is used for xul:statusbar.
*/
const unsigned long ROLE_STATUSBAR = 23;
/**
* 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;
/**
* 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;
/**
* Represents a column of cells within a table. Also, see ROLE_TABLE.
*/
const unsigned long ROLE_COLUMN = 27;
/**
* Represents a row of cells within a table. Also, see ROLE_TABLE.
*/
const unsigned long ROLE_ROW = 28;
/**
* 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;
/**
* Represents a link to something else. This object might look like text or
* a graphic, but it acts like a button. It is used for
* xul:label@class="text-link", html:a, html:area,
* xforms:trigger@appearance="minimal".
@@ -251,48 +251,48 @@ interface nsIAccessibleRole : nsISupport
/**
* Represents a cartoon-like graphic object, such as Microsoft Office
* Assistant, which is displayed to provide help to users of an application.
*/
const unsigned long ROLE_CHARACTER = 32;
/**
* 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;
/**
* Represents an item in a list. See also ROLE_LIST.
*/
const unsigned long ROLE_LISTITEM = 34;
/**
* 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;
/**
* Represents an indicator, such as a pointer graphic, that points to the
* current item.
*/
const unsigned long ROLE_INDICATOR = 39;
@@ -301,62 +301,62 @@ interface nsIAccessibleRole : nsISupport
* Represents a picture. Is is used for xul:image, html:img.
*/
const unsigned long ROLE_GRAPHIC = 40;
/**
* 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;
/**
* Represents selectable text that allows edits or is designated read-only.
*/
const unsigned long ROLE_TEXT_LEAF = 42;
/**
* 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;
/**
* Represents an option button, also called a radio button. It is one of a
* 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;
/**
* Represents the calendar control. It is used for date xforms:input.
*/
const unsigned long ROLE_DROPLIST = 47;
/**
* 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;
/**
* Represents a dial or knob whose purpose is to allow a user to set a value.
*/
const unsigned long ROLE_DIAL = 49;
@@ -364,17 +364,17 @@ interface nsIAccessibleRole : nsISupport
* Represents a hot-key field that allows the user to enter a combination or
* sequence of keystrokes.
*/
const unsigned long ROLE_HOTKEYFIELD = 50;
/**
* 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;
/**
* Represents a spin box, which is a control that allows the user to increment
* or decrement the value displayed in a separate "buddy" control associated
* with the spin box. It is used for xul:spinbuttons.
*/
@@ -413,17 +413,17 @@ interface nsIAccessibleRole : nsISupport
/**
* Represents blank space between other objects.
*/
const unsigned long ROLE_WHITESPACE = 59;
/**
* 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;
/**
* Represents a control that displays time.
*/
const unsigned long ROLE_CLOCK = 61;
--- a/accessible/src/base/nsARIAMap.cpp
+++ b/accessible/src/base/nsARIAMap.cpp
@@ -36,187 +36,175 @@
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsARIAMap.h"
#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
* Using RDF will also allow for role extensibility. See bug 280138.
*
* Definition of nsRoleMapEntry and nsStateMapEntry contains comments explaining this table.
*
* When no nsIAccessibleRole enum mapping exists for an ARIA role, the
* role will be exposed via the object attribute "xml-roles".
* In addition, in MSAA, the unmapped role will also be exposed as a BSTR string role.
*
* There are no nsIAccessibleRole enums for the following landmark roles:
* banner, contentinfo, main, navigation, note, search, secondary, seealso, breadcrumbs
*/
-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[] =
{
{"alert", nsIAccessibleRole::ROLE_ALERT, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry},
{"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);
nsRoleMapEntry nsARIAMap::gLandmarkRoleMap = {
"",
nsIAccessibleRole::ROLE_NOTHING,
eNameLabelOrTitle,
@@ -226,16 +214,16 @@ nsRoleMapEntry nsARIAMap::gLandmarkRoleM
};
/**
* Universal states:
* The following state rules are applied to any accessible element,
* 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
};
--- a/accessible/src/base/nsARIAMap.h
+++ b/accessible/src/base/nsARIAMap.h
@@ -38,22 +38,16 @@
* ***** END LICENSE BLOCK ***** */
#ifndef _nsARIAMap_H_
#define _nsARIAMap_H_
#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
{
// eNameLabelOrTitle:
// Collect name from:
// 1) The content subtrees pointed to by labelledby
// which contains the IDs for the label content, or if unspecified
// 2) The title attribute if specified
@@ -68,30 +62,30 @@ enum ENameRule
// 3) The title attribute if specified
eNameOkFromChildren
};
// Is nsIAccessible value supported for this role or not?
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"
#define kBoolState 0
// Used in nsRoleMapEntry.state if no nsIAccessibleStates are automatic for a given role
#define kNoReqStates 0
// For this name and value pair, what is the nsIAccessibleStates mapping.
// 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
};
// For each ARIA role, this maps the nsIAccessible information
struct nsRoleMapEntry
{
// ARIA role: string representation such as "button"
@@ -105,17 +99,17 @@ struct nsRoleMapEntry
// Value mapping rule: how to compute nsIAccessible value
EValueRule valueRule;
// Automatic state mapping rule: always include in nsIAccessibleStates
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.
nsStateMapEntry attributeMap1;
nsStateMapEntry attributeMap2;
nsStateMapEntry attributeMap3;
nsStateMapEntry attributeMap4;
nsStateMapEntry attributeMap5;
@@ -126,17 +120,15 @@ struct nsRoleMapEntry
/**
* These are currently initialized (hardcoded) in nsARIAMap.cpp,
* and provide the mappings for WAI-ARIA roles and properties using the
* structs defined in this file.
*/
struct nsARIAMap
{
- static nsIAtom** gAriaAtomPtrsNS[eAria_none];
- static nsIAtom** gAriaAtomPtrsHyphenated[eAria_none];
static nsRoleMapEntry gWAIRoleMap[];
static PRUint32 gWAIRoleMapLength;
static nsRoleMapEntry gLandmarkRoleMap;
static nsStateMapEntry gWAIUnivStateMap[];
};
#endif
deleted file mode 100644
--- 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 <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)
--- a/accessible/src/base/nsAccessNode.cpp
+++ b/accessible/src/base/nsAccessNode.cpp
@@ -874,20 +874,8 @@ nsAccessNode::GetLanguage(nsAString& aLa
if (doc) {
doc->GetHeaderData(nsAccessibilityAtoms::headerContentLanguage, 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);
-}
--- a/accessible/src/base/nsAccessNode.h
+++ b/accessible/src/base/nsAccessNode.h
@@ -67,26 +67,16 @@ class nsApplicationAccessibleWrap;
class nsIDocShellTreeItem;
#define ACCESSIBLE_BUNDLE_URL "chrome://global-platform/locale/accessible.properties"
#define PLATFORM_KEYS_BUNDLE_URL "chrome://global-platform/locale/platformKeys.properties"
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
nsAccessNode(nsIDOMNode *, nsIWeakReference* aShell);
virtual ~nsAccessNode();
NS_DECL_ISUPPORTS
NS_DECL_NSIACCESSNODE
@@ -113,35 +103,16 @@ class nsAccessNode: public nsIAccessNode
static already_AddRefed<nsIAccessibleDocument> GetDocAccessibleFor(nsIDocument *aDocument);
static already_AddRefed<nsIAccessibleDocument> GetDocAccessibleFor(nsIWeakReference *aWeakShell);
static already_AddRefed<nsIAccessibleDocument> GetDocAccessibleFor(nsIDocShellTreeItem *aContainer, PRBool aCanCreate = PR_FALSE);
static already_AddRefed<nsIAccessibleDocument> GetDocAccessibleFor(nsIDOMNode *aNode);
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);
already_AddRefed<nsRootAccessible> GetRootAccessible();
static nsIDOMNode *gLastFocusedNode;
static nsIAccessibilityService* GetAccService();
--- a/accessible/src/base/nsAccessibilityAtomList.h
+++ b/accessible/src/base/nsAccessibilityAtomList.h
@@ -83,16 +83,17 @@ ACCESSIBILITY_ATOM(tableCaptionFrame, "T
ACCESSIBILITY_ATOM(tableCellFrame, "TableCellFrame")
ACCESSIBILITY_ATOM(tableOuterFrame, "TableOuterFrame")
// Alphabetical list of tag names
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")
ACCESSIBILITY_ATOM(caption, "caption") // XUL
ACCESSIBILITY_ATOM(choices, "choices") // XForms
ACCESSIBILITY_ATOM(description, "description") // XUL
ACCESSIBILITY_ATOM(dd, "dd")
ACCESSIBILITY_ATOM(div, "div")
@@ -144,52 +145,85 @@ ACCESSIBILITY_ATOM(ul, "ul")
// Alphabetical list of attributes
ACCESSIBILITY_ATOM(acceltext, "acceltext")
ACCESSIBILITY_ATOM(accesskey, "accesskey")
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")
ACCESSIBILITY_ATOM(droppable, "droppable") // XUL combo box
ACCESSIBILITY_ATOM(editable, "editable")
ACCESSIBILITY_ATOM(_for, "for")
ACCESSIBILITY_ATOM(hidden, "hidden") // XUL tree columns
ACCESSIBILITY_ATOM(href, "href")
ACCESSIBILITY_ATOM(increment, "increment") // XUL
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")
ACCESSIBILITY_ATOM(tooltiptext, "tooltiptext")
ACCESSIBILITY_ATOM(type, "type")
ACCESSIBILITY_ATOM(value, "value")
// ARIA (DHTML accessibility) attributes
// 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")
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -1484,43 +1484,33 @@ NS_IMETHODIMP nsAccessibilityService::Ge
return InitAccessible(newAcc, aAccessible, roleMapEntry);
}
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
nsAccessibilityService::GetRelevantContentNodeFor(nsIDOMNode *aNode,
nsIDOMNode **aRelevantNode)
{
// The method returns node that is relevant for attached accessible check.
// Sometimes element that is XBL widget hasn't accessible children in
--- a/accessible/src/base/nsAccessibilityUtils.cpp
+++ b/accessible/src/base/nsAccessibilityUtils.cpp
@@ -576,88 +576,22 @@ nsAccUtils::GetDocShellTreeItemFor(nsIDO
PRBool
nsAccUtils::GetID(nsIContent *aContent, nsAString& aID)
{
nsIAtom *idAttribute = aContent->GetIDAttributeName();
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 *aRelationAttr,
nsIAtom *aTagName,
- nsIAtom *aRelationAttr,
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)) {
binding = aForNode->GetBindingParent();
if (binding == aForNode)
return nsnull;
aForNode->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::anonid, controlID);
@@ -698,171 +632,113 @@ nsAccUtils::FindNeighbourPointingToNode(
if (NS_FAILED(rv))
return nsnull;
nsCOMPtr<nsIContent> content = do_QueryInterface(node);
if (!content)
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;
}
return labelContent;
}
// Pass in aAriaProperty = null and aRelationAttr == nsnull if any <label> will do
nsIContent*
nsAccUtils::FindDescendantPointingToID(const nsString *aId,
nsIContent *aLookContent,
- EAriaProperty aAriaProperty,
nsIAtom *aRelationAttr,
nsIContent *aExcludeContent,
nsIAtom *aTagType)
{
// Surround id with spaces for search
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,
// 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) {
- // 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 <label> or <description>
return nsnull;
}
}
// Recursively search descendants for match
PRUint32 count = 0;
nsIContent *child;
nsIContent *labelContent = nsnull;
while ((child = aLookContent->GetChildAt(count++)) != nsnull) {
if (child != aExcludeContent) {
labelContent = FindDescendantPointingToIDImpl(aIdWithSpaces, child,
- aAriaProperty, aAriaPropTypes,
aRelationAttr, aExcludeContent, aTagType);
if (labelContent) {
return labelContent;
}
}
}
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];
}
if (compare < 0) {
high = index - 1;
}
else {
--- a/accessible/src/base/nsAccessibilityUtils.h
+++ b/accessible/src/base/nsAccessibilityUtils.h
@@ -260,113 +260,61 @@ public:
* Get the ID for an element, in some types of XML this may not be the ID attribute
* @param aContent Node to get the ID for
* @param aID Where to put ID string
* @return PR_TRUE if there is an ID set for this node
*/
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.
* @param aNode The DOM node to get the role map entry for
* @return A pointer to the role map entry for the ARIA role, or nsnull if none
*/
static nsRoleMapEntry* GetRoleMapEntry(nsIDOMNode *aNode);
/**
* Search element in neighborhood of the given element by tag name and
* attribute value that equals to ID attribute of the given element.
* 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 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 aRelationAttr - attribute name of searched element, 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);
/**
* Search for element that satisfies the requirements in subtree of the given
* element. The requirements are tag name, attribute name and value of
* attribute.
*
* @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' --
* ignored if aAriaProperty passed in
*/
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);
};
#endif
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -178,17 +178,17 @@ PRBool nsAccessible::IsTextInterfaceSupp
}
return PR_TRUE;
}
#endif
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))) {
*aInstancePtr = static_cast<nsIAccessible*>(this);
NS_ADDREF_THIS();
return NS_OK;
}
@@ -198,25 +198,25 @@ nsresult nsAccessible::QueryInterface(RE
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIAccessibleSelectable))) {
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
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;
}
}
}
if (aIID.Equals(NS_GET_IID(nsIAccessibleValue))) {
@@ -309,25 +309,24 @@ NS_IMETHODIMP nsAccessible::GetDescripti
// 3. it doesn't have an accName; or
// 4. its title attribute already equals to its accName nsAutoString name;
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
if (!content) {
return NS_ERROR_FAILURE; // Node shut down
}
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
AppendFlatStringFromSubtree(descriptionContent, &description);
}
}
if (description.IsEmpty()) {
nsIAtom *descAtom = isXUL ? nsAccessibilityAtoms::tooltiptext :
@@ -1390,36 +1389,23 @@ NS_IMETHODIMP nsAccessible::SetSelected(
if (state & nsIAccessibleStates::STATE_SELECTABLE) {
nsCOMPtr<nsIAccessible> multiSelect = GetMultiSelectFor(mDOMNode);
if (!multiSelect) {
return aSelect ? TakeFocus() : NS_ERROR_FAILURE;
}
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);
+ if (aSelect) {
+ return content->SetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_selected,
+ NS_LITERAL_STRING("true"), PR_TRUE);
}
- nameSpaceID = kNameSpaceID_WAIProperties;
+ return content->UnsetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_selected, PR_TRUE);
}
- // 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;
}
/* void takeSelection (); */
NS_IMETHODIMP nsAccessible::TakeSelection()
{
@@ -1671,19 +1657,18 @@ nsresult nsAccessible::AppendFlatStringF
AppendFlatStringFromSubtreeRecurse(aContent->GetChildAt(index), aFlatString);
}
return NS_OK;
}
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);
}
nsIContent* nsAccessible::GetHTMLLabelContent(nsIContent *aForNode)
{
// Get either <label for="[id]"> element which explictly points to aForNode, or
// <label> ancestor which implicitly point to it
@@ -1701,43 +1686,43 @@ nsIContent* nsAccessible::GetHTMLLabelCo
// There can be a label targeted at this control using the
// for="control_id" attribute. To save computing time, only
// look for those inside of a form element
nsAutoString forId;
if (!nsAccUtils::GetID(aForNode, forId)) {
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);
}
}
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();
nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
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);
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(content->GetOwnerDoc());
NS_ENSURE_TRUE(domDoc, NS_ERROR_FAILURE);
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(' ');
NS_ASSERTION(idLength != 0, "Should not be 0 because of CompressWhitespace() call above");
if (idLength == kNotFound) {
id = ids;
ids.Truncate();
} else {
@@ -1773,17 +1758,17 @@ nsresult nsAccessible::GetHTMLName(nsASt
{
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
if (!content) {
return NS_ERROR_FAILURE; // Node shut down
}
// 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;
}
nsIContent *labelContent = GetHTMLLabelContent(content);
if (labelContent) {
AppendFlatStringFromSubtree(labelContent, &label);
@@ -1824,17 +1809,17 @@ nsresult nsAccessible::GetHTMLName(nsASt
*/
nsresult nsAccessible::GetXULName(nsAString& aLabel, PRBool aCanAggregateSubtree)
{
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
NS_ASSERTION(content, "No nsIContent for DOM node");
// 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;
}
// CASE #1 (via label attribute) -- great majority of the cases
nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl(do_QueryInterface(mDOMNode));
if (labeledEl) {
@@ -1857,19 +1842,18 @@ nsresult nsAccessible::GetXULName(nsAStr
}
}
}
// CASES #2 and #3 ------ label as a child or <label control="id" ... > </label>
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
if (xulLabel && NS_SUCCEEDED(xulLabel->GetValue(label)) && label.IsEmpty()) {
// If no value attribute, a non-empty label must contain
// children that define it's text -- possibly using HTML
AppendFlatStringFromSubtree(labelContent, &label);
}
@@ -1956,38 +1940,34 @@ NS_IMETHODIMP nsAccessible::GetFinalRole
if (mRoleMapEntry) {
*aRole = mRoleMapEntry->role;
// These unfortunate exceptions don't fit into the ARIA table
// 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"
- *aRole = nsIAccessibleRole::ROLE_BUTTONMENU;
- }
+ 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;
GetParent(getter_AddRefs(parent));
if (parent && Role(parent) == nsIAccessibleRole::ROLE_COMBOBOX) {
@@ -2008,94 +1988,77 @@ NS_IMETHODIMP nsAccessible::GetFinalRole
}
return mDOMNode ? GetRole(aRole) : NS_ERROR_FAILURE; // Node already shut down
}
NS_IMETHODIMP
nsAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
{
NS_ENSURE_ARG_POINTER(aAttributes);
-
- if (!mDOMNode)
+ *aAttributes = nsnull;
+
+ nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
+ if (!content) {
return NS_ERROR_FAILURE;
+ }
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
NS_ENSURE_TRUE(attributes, NS_ERROR_OUT_OF_MEMORY);
nsAccEvent::GetLastEventAttributes(mDOMNode, attributes);
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);
}
}
// Get container-foo computed live region properties based on the closest container with
// the live region attribute
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();
}
if (!nsAccUtils::HasAccGroupAttrs(attributes)) {
// The role of an accessible can be pointed by ARIA attribute but ARIA
// posinset, level, setsize may be skipped. Therefore we calculate here
// these properties to map them into description.
@@ -2219,22 +2182,22 @@ nsAccessible::GroupPosition(PRInt32 *aGr
return NS_OK;
}
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")) {
*aStateInOut &= ~aStateMapEntry->state;
}
else {
*aStateInOut |= aStateMapEntry->state;
}
@@ -2332,33 +2295,28 @@ nsAccessible::GetFinalState(PRUint32 *aS
if (role == nsIAccessibleRole::ROLE_ENTRY ||
role == nsIAccessibleRole::ROLE_PASSWORD_TEXT ||
role == nsIAccessibleRole::ROLE_COMBOBOX) {
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
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"))) {
*aExtraState |= nsIAccessibleStates::EXT_STATE_SUPPORTS_AUTOCOMPLETION;
}
// 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;
}
}
// For some reasons DOM node may have not a frame. We tract such accessibles
// as invisible.
nsIFrame *frame = GetFrame();
if (!frame)
return NS_OK;
@@ -2399,84 +2357,84 @@ nsAccessible::GetARIAState()
}
if (!mRoleMapEntry)
return ariaState;
// 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) &&
MappedAttrState(content, &ariaState, &mRoleMapEntry->attributeMap3) &&
MappedAttrState(content, &ariaState, &mRoleMapEntry->attributeMap4) &&
MappedAttrState(content, &ariaState, &mRoleMapEntry->attributeMap5) &&
MappedAttrState(content, &ariaState, &mRoleMapEntry->attributeMap6) &&
MappedAttrState(content, &ariaState, &mRoleMapEntry->attributeMap7)) {
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;
}
// Not implemented by this class
/* DOMString getValue (); */
NS_IMETHODIMP nsAccessible::GetValue(nsAString& aValue)
{
if (!mDOMNode) {
return NS_ERROR_FAILURE; // Node already shut down
}
if (mRoleMapEntry) {
if (mRoleMapEntry->valueRule == eNoValue) {
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;
}
}
return NS_OK;
}
// nsIAccessibleValue
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
nsAccessible::GetMinimumIncrement(double *aMinIncrement)
{
NS_ENSURE_ARG_POINTER(aMinIncrement);
*aMinIncrement = 0;
// No mimimum increment in dynamic content spec right now
return NS_OK_NO_ARIA_VALUE;
}
NS_IMETHODIMP
nsAccessible::GetCurrentValue(double *aValue)
{
- return GetAttrValue(eAria_valuenow, aValue);
+ return GetAttrValue(nsAccessibilityAtoms::aria_valuenow, aValue);
}
NS_IMETHODIMP
nsAccessible::SetCurrentValue(double aValue)
{
if (!mDOMNode)
return NS_ERROR_FAILURE; // Node already shut down
@@ -2497,24 +2455,18 @@ nsAccessible::SetCurrentValue(double aVa
if (NS_SUCCEEDED(GetMaximumValue(&maxValue)) && aValue > maxValue)
return NS_ERROR_INVALID_ARG;
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
NS_ENSURE_STATE(content);
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);
+ return content->SetAttr(kNameSpaceID_None,
+ nsAccessibilityAtoms::aria_valuenow, newValue, PR_TRUE);
}
/* void setName (in DOMString name); */
NS_IMETHODIMP nsAccessible::SetName(const nsAString& name)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
@@ -2614,21 +2566,17 @@ NS_IMETHODIMP nsAccessible::GetAccessibl
return NS_ERROR_NOT_IMPLEMENTED;
}
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();
}
nsCOMPtr<nsIDOMNode> atomicRegion;
if (atomic.EqualsLiteral("true")) {
atomicRegion = do_QueryInterface(loopContent);
}
return atomicRegion;
@@ -2658,79 +2606,76 @@ NS_IMETHODIMP nsAccessible::GetAccessibl
{
if (content->Tag() == nsAccessibilityAtoms::label) {
nsIAtom *relatedIDAttr = content->IsNodeOfType(nsINode::eHTML) ?
nsAccessibilityAtoms::_for : nsAccessibilityAtoms::control;
content->GetAttr(kNameSpaceID_None, relatedIDAttr, relatedID);
}
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)) {
// This affectively adds an optional control attribute to xul:description,
// which only affects accessibility, by allowing the description to be
// tied to a control.
content->GetAttr(kNameSpaceID_None,
nsAccessibilityAtoms::control, relatedID);
}
break;
}
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:
{
if (content->IsNodeOfType(nsINode::eHTML)) {
// HTML form controls implements nsIFormControl interface.
nsCOMPtr<nsIFormControl> control(do_QueryInterface(content));
if (control) {
@@ -3158,17 +3103,17 @@ NS_IMETHODIMP nsAccessible::GetObject(PR
// nsIAccessibleHyperLink::IsValid()
NS_IMETHODIMP nsAccessible::IsValid(PRBool *aIsValid)
{
PRUint32 state = State(this);
*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;
}
NS_IMETHODIMP nsAccessible::IsSelected(PRBool *aIsSelected)
{
*aIsSelected = (gLastFocusedNode == mDOMNode);
return NS_OK;
@@ -3311,33 +3256,33 @@ PRBool nsAccessible::CheckVisibilityInPa
document = parentDoc;
}
return PR_TRUE;
}
nsresult
-nsAccessible::GetAttrValue(EAriaProperty aProperty, double *aValue)
+nsAccessible::GetAttrValue(nsIAtom *aProperty, double *aValue)
{
NS_ENSURE_ARG_POINTER(aValue);
*aValue = 0;
if (!mDOMNode)
return NS_ERROR_FAILURE; // Node already shut down
if (!mRoleMapEntry || mRoleMapEntry->valueRule == eNoValue)
return NS_OK_NO_ARIA_VALUE;
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
NS_ENSURE_STATE(content);
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;
}
PRBool nsAccessible::MustPrune(nsIAccessible *aAccessible)
{
PRUint32 role = Role(aAccessible);
--- a/accessible/src/base/nsAccessible.h
+++ b/accessible/src/base/nsAccessible.h
@@ -180,17 +180,17 @@ protected:
/**
* For a given ARIA relation, such as labelledby or describedby, get the collated text
* for the subtree that's pointed to.
*
* @param aIDProperty The ARIA relationship property to get the text for
* @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);
// Name helpers
nsresult GetHTMLName(nsAString& _retval, PRBool aCanAggregateSubtree = PR_TRUE);
nsresult GetXULName(nsAString& aName, PRBool aCanAggregateSubtree = PR_TRUE);
// For accessibles that are not lists of choices, the name of the subtree should be the
@@ -233,30 +233,30 @@ protected:
// For accessibles that have actions
static void DoCommandCallback(nsITimer *aTimer, void *aClosure);
nsresult DoCommand(nsIContent *aContent = nsnull);
// Check the visibility across both parent content and chrome
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();
/**
* Get numeric value of the given ARIA attribute.
*
* @param aAriaProperty - the ARIA property we're using
* @param aValue - value of the attribute
*
* @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;
nsIAccessible *mFirstChild, *mNextSibling;
nsRoleMapEntry *mRoleMapEntry; // Non-null indicates author-supplied role; possibly state & value as well
PRInt32 mAccChildCount;
};
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -79,47 +79,32 @@
PRUint32 nsDocAccessible::gLastFocusedAccessiblesState = 0;
//-----------------------------------------------------
// construction
//-----------------------------------------------------
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)
return;
// Because of the way document loading happens, the new nsIWidget is created before
// the old one is removed. Since it creates the nsDocAccessible, for a brief moment
// there can be 2 nsDocAccessible's for the content area, although for 2 different
// pres shells.
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
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) {
nsCOMPtr<nsIWidget> widget;
vm->GetWidget(getter_AddRefs(widget));
if (widget) {
mWnd = widget->GetNativeData(NS_NATIVE_WINDOW);
}
@@ -220,17 +205,17 @@ NS_IMETHODIMP nsDocAccessible::GetValue(
{
return GetURL(aValue);
}
NS_IMETHODIMP
nsDocAccessible::GetDescription(nsAString& aDescription)
{
nsAutoString description;
- GetTextFromRelationID(eAria_describedby, description);
+ GetTextFromRelationID(nsAccessibilityAtoms::aria_describedby, description);
aDescription = description;
return NS_OK;
}
NS_IMETHODIMP
nsDocAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
{
// nsAccessible::GetState() always fail for document accessible.
@@ -904,23 +889,16 @@ NS_IMETHODIMP nsDocAccessible::Observe(n
new nsAccStateChangeEvent(this, nsIAccessibleStates::EXT_STATE_EDITABLE,
PR_TRUE, PR_TRUE);
FireAccessibleEvent(event);
}
return NS_OK;
}
-NS_IMETHODIMP
-nsDocAccessible::GetAriaPropTypes(PRUint32 *aAriaPropTypes)
-{
- *aAriaPropTypes = mAriaPropTypes;
- return NS_OK;
-}
-
///////////////////////////////////////////////////////////////////////
// nsIDocumentObserver
NS_IMPL_NSIDOCUMENTOBSERVER_CORE_STUB(nsDocAccessible)
NS_IMPL_NSIDOCUMENTOBSERVER_LOAD_STUB(nsDocAccessible)
NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(nsDocAccessible)
void
@@ -955,23 +933,16 @@ nsDocAccessible::AttributeChangedImpl(ns
// Otherwise it may just be a state change, for example an object changing
// its visibility
nsCOMPtr<nsISupports> container = mDocument->GetContainer();
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
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);
if (busyFlags) {
return; // Still loading, ignore setting of initial attributes
}
nsCOMPtr<nsIPresShell> shell = GetPresShell();
@@ -987,68 +958,60 @@ nsDocAccessible::AttributeChangedImpl(ns
// Since we're in synchronous code, we can store whether the current attribute
// change is from user input or not. If the attribute change causes an asynchronous
// layout change, that event can use the last known user input state
nsAccEvent::PrepareForEvent(targetNode);
// 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,
PR_TRUE);
FireDelayedAccessibleEvent(enabledChangeEvent);
nsCOMPtr<nsIAccessibleStateChangeEvent> sensitiveChangeEvent =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::EXT_STATE_SENSITIVE,
PR_TRUE);
FireDelayedAccessibleEvent(sensitiveChangeEvent);
return;
}
// 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
InvalidateCacheSubtree(aContent, nsIAccessibleEvent::EVENT_DOM_SIGNIFICANT_CHANGE);
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
// whatever gets event_focus, which is done in
// nsRootAccessible::FireAccessibleFocusEvent()
// So right here we make sure only to deal with multi selects
if (multiSelect) {
// Need to find the right event to use here, SELECTION_WITHIN would
@@ -1058,21 +1021,18 @@ nsDocAccessible::AttributeChangedImpl(ns
nsCOMPtr<nsIDOMNode> multiSelectDOMNode;
multiSelectAccessNode->GetDOMNode(getter_AddRefs(multiSelectDOMNode));
NS_ASSERTION(multiSelectDOMNode, "A new accessible without a DOM node!");
FireDelayedToolkitEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
multiSelectDOMNode, nsnull, eAllowDupes);
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;
}
FireDelayedToolkitEvent(nsIAccessibleEvent::EVENT_SELECTION_ADD,
targetNode, nsnull);
}
@@ -1090,66 +1050,67 @@ nsDocAccessible::AttributeChangedImpl(ns
void
nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
{
nsCOMPtr<nsIDOMNode> targetNode(do_QueryInterface(aContent));
if (!targetNode)
return;
- if (aAttribute == nsAccessibilityAtoms::required) {
+ if (aAttribute == nsAccessibilityAtoms::aria_required) {
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::STATE_REQUIRED,
PR_FALSE);
FireDelayedAccessibleEvent(event);
return;
}
- if (aAttribute == nsAccessibilityAtoms::invalid) {
+ if (aAttribute == nsAccessibilityAtoms::aria_invalid) {
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::STATE_INVALID,
PR_FALSE);
FireDelayedAccessibleEvent(event);
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();
if (currentFocus == targetNode) {
nsRefPtr<nsRootAccessible> rootAcc = GetRootAccessible();
if (rootAcc)
rootAcc->FireAccessibleFocusEvent(nsnull, currentFocus, nsnull, PR_TRUE);
}
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
// relevant for that particular role.
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 =
new nsAccStateChangeEvent(targetNode, kState, PR_FALSE);
FireDelayedAccessibleEvent(event);
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));
if (accessible) {
PRBool wasMixed = (gLastFocusedAccessiblesState & nsIAccessibleStates::STATE_MIXED) != 0;
PRBool isMixed = (State(accessible) & nsIAccessibleStates::STATE_MIXED) != 0;
if (wasMixed != isMixed) {
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
@@ -1158,49 +1119,46 @@ nsDocAccessible::ARIAAttributeChanged(ns
PR_FALSE, isMixed);
FireDelayedAccessibleEvent(event);
}
}
}
return;
}
- if (aAttribute == nsAccessibilityAtoms::expanded) {
+ if (aAttribute == nsAccessibilityAtoms::aria_expanded) {
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::STATE_EXPANDED,
PR_FALSE);
FireDelayedAccessibleEvent(event);
return;
}
- if (aAttribute == nsAccessibilityAtoms::readonly) {
+ if (aAttribute == nsAccessibilityAtoms::aria_readonly) {
nsCOMPtr<nsIAccessibleStateChangeEvent> event =
new nsAccStateChangeEvent(targetNode,
nsIAccessibleStates::STATE_READONLY,
PR_FALSE);
FireDelayedAccessibleEvent(event);
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);
- }
+ InvalidateCacheSubtree(aContent, nsIAccessibleEvent::EVENT_DOM_SIGNIFICANT_CHANGE);
}
}
void nsDocAccessible::ContentAppended(nsIDocument *aDocument,
nsIContent* aContainer,
PRInt32 aNewIndexInContainer)
{
if ((!mIsContentLoaded || !mDocument) && mAccessNodeCache.Count() <= 1) {
--- a/accessible/src/base/nsDocAccessible.h
+++ b/accessible/src/base/nsDocAccessible.h
@@ -210,17 +210,16 @@ class nsDocAccessible : public nsHyperTe
nsCOMPtr<nsITimer> mFireEventTimer;
PRUint16 mScrollPositionChangedTicks; // Used for tracking scroll events
PRPackedBool mIsContentLoaded;
nsCOMArray<nsIAccessibleEvent> mEventsToFire;
protected:
PRBool mIsAnchor;
PRBool mIsAnchorJumped;
- PRUint32 mAriaPropTypes;
static PRUint32 gLastFocusedAccessiblesState;
private:
static void DocLoadCallback(nsITimer *aTimer, void *aClosure);
nsCOMPtr<nsITimer> mDocLoadTimer;
};
#endif
--- a/accessible/src/base/nsRootAccessible.cpp
+++ b/accessible/src/base/nsRootAccessible.cpp
@@ -460,23 +460,23 @@ PRBool nsRootAccessible::FireAccessibleF
realFocusedNode = aNode;
}
if (realFocusedNode) {
mCaretAccessible->SetControlSelectionListener(realFocusedNode);
}
}
}
- // 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) {
return PR_FALSE;
}
nsCOMPtr<nsIDOMElement> relatedEl;
domDoc->GetElementById(id, getter_AddRefs(relatedEl));
finalFocusNode = do_QueryInterface(relatedEl);
--- a/accessible/src/html/nsHTMLFormControlAccessible.cpp
+++ b/accessible/src/html/nsHTMLFormControlAccessible.cpp
@@ -487,17 +487,17 @@ nsHTMLTextFieldAccessible::GetState(PRUi
autocomplete);
if (!autocomplete.LowerCaseEqualsLiteral("off")) {
nsCOMPtr<nsIDOMHTMLFormElement> form;
htmlInput->GetForm(getter_AddRefs(form));
nsCOMPtr<nsIContent> formContent(do_QueryInterface(form));
if (formContent) {
formContent->GetAttr(kNameSpaceID_None,
- nsAccessibilityAtoms::autocomplete, autocomplete);
+ nsAccessibilityAtoms::autocomplete, autocomplete);
}
if (!formContent || !autocomplete.LowerCaseEqualsLiteral("off"))
*aExtraState |= nsIAccessibleStates::EXT_STATE_SUPPORTS_AUTOCOMPLETION;
}
}
return NS_OK;
--- a/accessible/src/html/nsHTMLSelectAccessible.cpp
+++ b/accessible/src/html/nsHTMLSelectAccessible.cpp
@@ -1101,17 +1101,17 @@ nsHTMLComboboxAccessible::GetState(PRUin
return NS_OK;
}
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;
}
// Use description of currently focused option
nsCOMPtr<nsIAccessible> optionAccessible = GetFocusedOptionAccessible();
return optionAccessible ? optionAccessible->GetDescription(aDescription) : NS_OK;
}
--- a/accessible/src/html/nsHTMLTableAccessible.cpp
+++ b/accessible/src/html/nsHTMLTableAccessible.cpp
@@ -978,17 +978,17 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsP
}
// Check role and role attribute
PRBool hasNonTableRole = (Role(this) != nsIAccessibleRole::ROLE_TABLE);
if (hasNonTableRole) {
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");
}
// Check for legitimate data table elements or attributes
nsAutoString summary;
if ((content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary, summary) && !summary.IsEmpty()) ||
HasDescendant("caption", PR_FALSE) || HasDescendant("th") || HasDescendant("thead") ||
HasDescendant("tfoot") || HasDescendant("colgroup")) {
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -471,17 +471,18 @@ STDMETHODIMP nsAccessibleWrap::get_accRo
accessNode->GetDOMNode(getter_AddRefs(domNode));
nsIContent *content = GetRoleContent(domNode);
if (!content)
return E_FAIL;
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;
nodeInfo->GetNamespaceURI(nameSpaceURI);
if (!nameSpaceURI.IsEmpty()) {
// Only append name space if different from that of current document
roleString += NS_LITERAL_STRING(", ") + nameSpaceURI;
}
--- a/accessible/src/xforms/nsXFormsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsAccessible.cpp
@@ -220,31 +220,31 @@ nsXFormsAccessible::GetState(PRUint32 *a
return NS_OK;
}
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;
}
// search the xforms:label element
return GetBoundChildElementValue(NS_LITERAL_STRING("label"), aName);
}
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;
return NS_OK;
}
// search the xforms:hint element
return GetBoundChildElementValue(NS_LITERAL_STRING("hint"), aDescription);
--- a/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsFormControlsAccessible.cpp
@@ -54,26 +54,26 @@ nsXFormsLabelAccessible::GetRole(PRUint3
*aRole = nsIAccessibleRole::ROLE_STATICTEXT;
return NS_OK;
}
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;
}
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;
}
// nsXFormsOutputAccessible
nsXFormsOutputAccessible::
nsXFormsOutputAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell):
--- a/browser/base/content/pageinfo/pageInfo.xul
+++ b/browser/base/content/pageinfo/pageInfo.xul
@@ -54,17 +54,16 @@
<?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
#endif
<window id="main-window"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
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;"
persist="screenX screenY width height sizemode">
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>
<script type="application/x-javascript" src="chrome://browser/content/pageinfo/pageInfo.js"/>
@@ -325,51 +324,51 @@
<label value="&permissionsFor;" control="hostText" />
<textbox id="hostText" class="header" readonly="true"
crop="end" flex="1"/>
</hbox>
<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">
<radio id="image#1" command="cmd_imageToggle" label="&permAllow;"/>
<radio id="image#2" command="cmd_imageToggle" label="&permBlock;"/>
</radiogroup>
</hbox>
</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">
<radio id="popup#1" command="cmd_popupToggle" label="&permAllow;"/>
<radio id="popup#2" command="cmd_popupToggle" label="&permBlock;"/>
</radiogroup>
</hbox>
</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">
<radio id="cookie#1" command="cmd_cookieToggle" label="&permAllow;"/>
<radio id="cookie#8" command="cmd_cookieToggle" label="&permAllowSession;"/>
<radio id="cookie#2" command="cmd_cookieToggle" label="&permBlock;"/>
</radiogroup>
</hbox>
</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">
<radio id="install#1" command="cmd_installToggle" label="&permAllow;"/>
<radio id="install#2" command="cmd_installToggle" label="&permBlock;"/>
</radiogroup>
</hbox>
</vbox>
--- a/browser/components/migration/content/migration.xul
+++ b/browser/components/migration/content/migration.xul
@@ -42,18 +42,17 @@
<wizard id="migrationWizard"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
windowtype="Browser:MigrationWizard"
title="&migrationWizard.title;"
onload="MigrationWizard.init()"
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"/>
<stringbundle id="bundle" src="chrome://browser/locale/migration/migration.properties"/>
<stringbundle id="brandBundle" src="chrome://branding/locale/brand.properties"/>
<wizardpage id="importSource" pageid="importSource" next="selectProfile"
label="&importSource.title;"
@@ -126,18 +125,17 @@
<wizardpage id="importItems" pageid="importItems" label="&importItems.title;"
next="homePageImport"
onpageshow="return MigrationWizard.onImportItemsPageShow();"
onpagerewound="return MigrationWizard.onImportItemsPageRewound();"
onpageadvanced="return MigrationWizard.onImportItemsPageAdvanced();"
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"
next="migrating"
onpageshow="return MigrationWizard.onHomePageMigrationPageShow();"
onpageadvanced="return MigrationWizard.onHomePageMigrationPageAdvanced();">
<description id="homePageImportDesc" control="homePageRadioGroup"/>
@@ -147,20 +145,20 @@
</radiogroup>
</wizardpage>
<wizardpage id="migrating" pageid="migrating" label="&migrating.title;"
next="done"
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>
--- a/browser/components/preferences/advanced.xul
+++ b/browser/components/preferences/advanced.xul
@@ -47,19 +47,17 @@
<!ENTITY % privacyDTD SYSTEM "chrome://browser/locale/preferences/privacy.dtd">
%privacyDTD;
]>
<overlay id="AdvancedPaneOverlay"
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"
name="browser.preferences.advanced.selectedTabIndex"
type="int"/>
<!--XXX button prefs -->
@@ -222,29 +220,29 @@
<hbox align="center">
<label id="useCacheBefore"
accesskey="&useCacheBefore.accesskey;">&useCacheBefore.label;</label>
<textbox id="cacheSize" type="number" size="2"
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;"
oncommand="gAdvancedPane.clearCache();"/>
</hbox>
</groupbox>
</tabpanel>
<!-- 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;"
preference="app.update.enabled"/>
<checkbox id="enableAddonUpdate"
label="&enableAddonsUpdate.label;"
accesskey="&enableAddonsUpdate.accesskey;"
preference="extensions.update.enabled"/>
@@ -320,17 +318,17 @@
<description id="CertSelectionDesc" control="certSelection">&certselect.description;</description>
<!--
The values on these radio buttons may look like l12y issues, but
they're not - this preference uses *those strings* as its values.
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;"
value="Ask Every Time"/>
</radiogroup>
<separator/>
--- a/browser/components/safebrowsing/content/warning-overlay.xul
+++ b/browser/components/safebrowsing/content/warning-overlay.xul
@@ -29,18 +29,17 @@
<vbox id="safebrowsing-palm-message" hidden="true" pack="center"
class="safebrowsing-palm-fixed-width">
<!-- This is the main warning area -->
<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">
<spacer flex="1"/>
<image id="safebrowsing-palm-close"
onclick="goDoCommand('safebrowsing-decline-warning')"/>
</hbox>
--- a/content/base/public/nsINameSpaceManager.h
+++ b/content/base/public/nsINameSpaceManager.h
@@ -54,20 +54,17 @@ static const PRInt32 kNameSpaceID_None =
#define kNameSpaceID_XLink 4
#define kNameSpaceID_XSLT 5
#define kNameSpaceID_XBL 6
#define kNameSpaceID_MathML 7
#define kNameSpaceID_RDF 8
#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"
#define NS_INAMESPACEMANAGER_IID \
{ 0xd74e83e6, 0xf932, 0x4289, \
{ 0xac, 0x95, 0x9e, 0x10, 0x24, 0x30, 0x88, 0xd6 } }
/**
--- a/content/base/src/nsNameSpaceManager.cpp
+++ b/content/base/src/nsNameSpaceManager.cpp
@@ -66,19 +66,16 @@ PRBool NS_SVGEnabled();
#define kXLinkNameSpaceURI "http://www.w3.org/1999/xlink"
#define kXSLTNameSpaceURI "http://www.w3.org/1999/XSL/Transform"
#define kXBLNameSpaceURI "http://www.mozilla.org/xbl"
#define kMathMLNameSpaceURI "http://www.w3.org/1998/Math/MathML"
#define kRDFNameSpaceURI "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
#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
{
public:
typedef const nsAString* KeyType;
typedef const nsAString* KeyTypePointer;
nsNameSpaceKey(KeyTypePointer aKey) : mKey(aKey)
@@ -157,20 +154,16 @@ nsresult NameSpaceManagerImpl::Init()
REGISTER_NAMESPACE(kXLinkNameSpaceURI, kNameSpaceID_XLink);
REGISTER_NAMESPACE(kXSLTNameSpaceURI, kNameSpaceID_XSLT);
REGISTER_NAMESPACE(kXBLNameSpaceURI, kNameSpaceID_XBL);
REGISTER_NAMESPACE(kMathMLNameSpaceURI, kNameSpaceID_MathML);
REGISTER_NAMESPACE(kRDFNameSpaceURI, kNameSpaceID_RDF);
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
return NS_OK;
}
nsresult
NameSpaceManagerImpl::RegisterNameSpace(const nsAString& aURI,
--- a/content/xml/document/src/nsXMLFragmentContentSink.cpp
+++ b/content/xml/document/src/nsXMLFragmentContentSink.cpp
@@ -672,23 +672,20 @@ nsXHTMLParanoidFragmentSink::HandleStart
for (PRUint32 i = 0; i < aAttsCount; i += 2) {
nsContentUtils::SplitExpatName(aAtts[i], getter_AddRefs(prefix),
getter_AddRefs(localName), &nameSpaceID);
rv = mNodeInfoManager->GetNodeInfo(localName, prefix, nameSpaceID,
getter_AddRefs(nodeInfo));
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]);
}
}
allowedAttrs.AppendElement((const PRUnichar*) nsnull);
return
nsXMLFragmentContentSink::HandleStartElement(aName,
allowedAttrs.Elements(),
--- a/extensions/inspector/resources/content/viewers/dom/insertDialog.xul
+++ b/extensions/inspector/resources/content/viewers/dom/insertDialog.xul
@@ -109,22 +109,16 @@
id="mi_XULNS"
value="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>
<menuitem label="&namespaceTitle.SVG.label;"
id="mi_SVGNS"
value="http://www.w3.org/2000/svg"/>
<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"/>
<!-- Value set onload -->
<menuitem label="&namespaceTitle.custom.label;"
id="mi_custom"/>
</menupopup>
</menulist>
--- a/extensions/inspector/resources/content/viewers/domNode/domNodeDialog.xul
+++ b/extensions/inspector/resources/content/viewers/domNode/domNodeDialog.xul
@@ -97,22 +97,16 @@
id="mi_XULNS"
value="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>
<menuitem label="&namespaceTitle.SVG.label;"
id="mi_SVGNS"
value="http://www.w3.org/2000/svg"/>
<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"/>
<!-- Value set onload -->
<menuitem label="&namespaceTitle.custom.label;"
id="mi_custom"/>
</menupopup>
</menulist>
--- a/toolkit/content/commonDialog.xul
+++ b/toolkit/content/commonDialog.xul
@@ -2,18 +2,17 @@
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://global/content/commonDialog.css" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://global/locale/commonDialog.dtd">
<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();"
ondialogextra2="return commonDialogOnExtra2();"
buttonpack="center"
style="min-width: 29em; min-height: 8.5em; -moz-user-focus: ignore;">
<script type="application/javascript" src="chrome://global/content/commonDialog.js"/>
--- a/toolkit/content/widgets/datetimepicker.xml
+++ b/toolkit/content/widgets/datetimepicker.xml
@@ -869,89 +869,89 @@
<label class="datepicker-gridlabel"/>
</deck>
<label anonid="yearlabel" class="datepicker-gridlabel"/>
<spacer flex="1"/>
<button class="datepicker-next datepicker-button" type="repeat"
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"/>
<column class="datepicker-gridrow" flex="1"/>
<column class="datepicker-gridrow" flex="1"/>
<column class="datepicker-gridrow" flex="1"/>
<column class="datepicker-gridrow" flex="1"/>
<column class="datepicker-gridrow" flex="1"/>
</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>
</vbox>
</content>
<implementation>
<field name="_hasEntry">false</field>
@@ -1199,34 +1199,34 @@
</binding>
<binding id="datepicker-popup" display="xul:menu"
extends="chrome://global/content/bindings/datetimepicker.xml#datepicker">
<content align="center">
<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>
</xul:hbox>
<xul:spinbuttons anonid="buttons" xbl:inherits="disabled" allowevents="true"
onup="this.parentNode._increaseOrDecrease(1);"
ondown="this.parentNode._increaseOrDecrease(-1);"/>
<xul:dropmarker class="datepicker-dropmarker" xbl:inherits="disabled"/>
--- a/toolkit/content/widgets/preferences.xml
+++ b/toolkit/content/widgets/preferences.xml
@@ -503,25 +503,24 @@
<binding id="prefwindow"
extends="chrome://global/content/bindings/dialog.xml#dialog">
<resources>
<stylesheet src="chrome://global/skin/preferences.css"/>
</resources>
<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"/>
</xul:deck>
</xul:hbox>
<xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons"
#ifdef XP_UNIX
>
--- a/toolkit/mozapps/preferences/removemp.xul
+++ b/toolkit/mozapps/preferences/removemp.xul
@@ -8,18 +8,17 @@
%brandDTD;
%removempDTD;
]>
<dialog id="removemp" title="&removePassword.title;"
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"/>
<stringbundle id="bundlePreferences" src="chrome://mozapps/locale/preferences/preferences.properties"/>
<vbox id="warnings">
<description>&removeWarning1.label;</description>
<description class="header">&removeWarning2.label;</description>
@@ -29,15 +28,15 @@
<groupbox>
<caption label="&removeInfo.label;"/>
<hbox align="center">
<label control="password" value="&setPassword.oldPassword.label;"/>
<textbox id="password" type="password"
oninput="gRemovePasswordDialog.validateInput();"
- aaa:describedby="warnings"/>
+ aria-describedby="warnings"/>
</hbox>
</groupbox>
<separator/>
</dialog>
--- a/toolkit/themes/pinstripe/global/globalBindings.xml
+++ b/toolkit/themes/pinstripe/global/globalBindings.xml
@@ -1,15 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE bindings SYSTEM "chrome://global/locale/preferences.dtd">
<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">
<content titlebarcolor="#EBEBEB"/>
</binding>
<binding id="unifiedDialog"
extends="chrome://global/content/bindings/dialog.xml#dialog">
@@ -44,21 +43,21 @@
</binding>
<binding id="unifiedPrefwindow"
extends="chrome://global/content/bindings/preferences.xml#prefwindow">
<content dlgbuttons="accept,cancel"
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"/>
</xul:deck>
</xul:hbox>
<xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons">
<xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
<xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>