diff --git a/accessible/src/base/nsARIAMap.cpp b/accessible/src/base/nsARIAMap.cpp index db55d0c415b..7b86f7f2b3e 100644 --- a/accessible/src/base/nsARIAMap.cpp +++ b/accessible/src/base/nsARIAMap.cpp @@ -408,6 +408,17 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] = eARIASelectable, eARIAReadonly }, + { + "scrollbar", + nsIAccessibleRole::ROLE_SCROLLBAR, + kUseMapRole, + eHasValueMinMax, + eNoAction, + eNoLiveAttr, + kNoReqStates, + eARIAOrientation, + eARIAReadonly + }, { "separator", nsIAccessibleRole::ROLE_SEPARATOR, @@ -628,6 +639,11 @@ nsStateMapEntry nsARIAMap::gWAIStateMap[] = { nsStateMapEntry(&nsAccessibilityAtoms::aria_multiselectable, kBoolType, 0, nsIAccessibleStates::STATE_MULTISELECTABLE | nsIAccessibleStates::STATE_EXTSELECTABLE, 0), + // eARIAOrientation + nsStateMapEntry(&nsAccessibilityAtoms::aria_orientation, eUseFirstState, + "vertical", 0, nsIAccessibleStates::EXT_STATE_VERTICAL, + "horizontal", 0, nsIAccessibleStates::EXT_STATE_HORIZONTAL), + // eARIAPressed nsStateMapEntry(&nsAccessibilityAtoms::aria_pressed, kMixedType, nsIAccessibleStates::STATE_CHECKABLE, @@ -693,6 +709,7 @@ nsAttributeCharacteristics nsARIAMap::gWAIUnivAttrMap[] = { {&nsAccessibilityAtoms::aria_multiline, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, {&nsAccessibilityAtoms::aria_multiselectable, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, {&nsAccessibilityAtoms::aria_owns, ATTR_BYPASSOBJ }, + {&nsAccessibilityAtoms::aria_orientation, ATTR_VALTOKEN }, {&nsAccessibilityAtoms::aria_pressed, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, {&nsAccessibilityAtoms::aria_readonly, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, {&nsAccessibilityAtoms::aria_relevant, ATTR_BYPASSOBJ }, @@ -749,6 +766,26 @@ nsStateMapEntry::nsStateMapEntry(nsIAtom **aAttrName, { } +nsStateMapEntry::nsStateMapEntry(nsIAtom **aAttrName, + EDefaultStateRule aDefaultStateRule, + const char *aValue1, + PRUint32 aState1, PRUint32 aExtraState1, + const char *aValue2, + PRUint32 aState2, PRUint32 aExtraState2, + const char *aValue3, + PRUint32 aState3, PRUint32 aExtraState3) : + attributeName(aAttrName), isToken(PR_TRUE), permanentState(0), + value1(aValue1), state1(aState1), extraState1(aExtraState1), + value2(aValue2), state2(aState2), extraState2(aExtraState2), + value3(aValue3), state3(aState3), extraState3(aExtraState3), + defaultState(0), defaultExtraState(0), definedIfAbsent(PR_TRUE) +{ + if (aDefaultStateRule == eUseFirstState) { + defaultState = aState1; + defaultExtraState = aExtraState1; + } +} + PRBool nsStateMapEntry::MapToStates(nsIContent *aContent, PRUint32 *aState, PRUint32 *aExtraState, diff --git a/accessible/src/base/nsARIAMap.h b/accessible/src/base/nsARIAMap.h index 82ce2a1b5b8..5e8c6a9fae1 100644 --- a/accessible/src/base/nsARIAMap.h +++ b/accessible/src/base/nsARIAMap.h @@ -157,6 +157,12 @@ enum eStateValueType kMixedType }; +enum EDefaultStateRule +{ + //eNoDefaultState, + eUseFirstState +}; + /** * ID for state map entry, used in nsRoleMapEntry. */ @@ -174,6 +180,7 @@ enum eStateMapEntryID eARIAInvalid, eARIAMultiline, eARIAMultiSelectable, + eARIAOrientation, eARIAPressed, eARIAReadonly, eARIAReadonlyOrEditable, @@ -207,6 +214,17 @@ public: const char *aValue3 = 0, PRUint32 aState3 = 0, PRUint32 aExtraState3 = 0); + /** + * Used for ARIA attributes having enumerated values, and where a default + * attribute state should be assumed when not supplied by the author. + */ + nsStateMapEntry(nsIAtom **aAttrName, + EDefaultStateRule aDefaultStateRule, + const char *aValue1, PRUint32 aState1, PRUint32 aExtraState1, + const char *aValue2, PRUint32 aState2, PRUint32 aExtraState2, + const char *aValue3 = 0, PRUint32 aState3 = 0, + PRUint32 aExtraState3 = 0); + /** * Maps ARIA state map pointed by state map entry ID to accessible states. * diff --git a/accessible/src/base/nsAccessibilityAtomList.h b/accessible/src/base/nsAccessibilityAtomList.h index 53ae537a54e..5d9ed579679 100644 --- a/accessible/src/base/nsAccessibilityAtomList.h +++ b/accessible/src/base/nsAccessibilityAtomList.h @@ -241,6 +241,7 @@ 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_orientation, "aria-orientation") ACCESSIBILITY_ATOM(aria_owns, "aria-owns") ACCESSIBILITY_ATOM(aria_posinset, "aria-posinset") ACCESSIBILITY_ATOM(aria_pressed, "aria-pressed") diff --git a/accessible/tests/mochitest/common.js b/accessible/tests/mochitest/common.js index 8712c76e9c4..cd4d8c2fb1c 100644 --- a/accessible/tests/mochitest/common.js +++ b/accessible/tests/mochitest/common.js @@ -79,6 +79,7 @@ const EXT_STATE_MULTI_LINE = nsIAccessibleStates.EXT_STATE_MULTI_LINE; const EXT_STATE_SINGLE_LINE = nsIAccessibleStates.EXT_STATE_SINGLE_LINE; const EXT_STATE_SUPPORTS_AUTOCOMPLETION = nsIAccessibleStates.EXT_STATE_SUPPORTS_AUTOCOMPLETION; +const EXT_STATE_VERTICAL = nsIAccessibleStates.EXT_STATE_VERTICAL; //////////////////////////////////////////////////////////////////////////////// // OS detect diff --git a/accessible/tests/mochitest/role.js b/accessible/tests/mochitest/role.js index eef1db4a194..05549f1153e 100644 --- a/accessible/tests/mochitest/role.js +++ b/accessible/tests/mochitest/role.js @@ -44,6 +44,7 @@ const ROLE_PUSHBUTTON = nsIAccessibleRole.ROLE_PUSHBUTTON; const ROLE_RADIOBUTTON = nsIAccessibleRole.ROLE_RADIOBUTTON; const ROLE_ROW = nsIAccessibleRole.ROLE_ROW; const ROLE_ROWHEADER = nsIAccessibleRole.ROLE_ROWHEADER; +const ROLE_SCROLLBAR = nsIAccessibleRole.ROLE_SCROLLBAR; const ROLE_SECTION = nsIAccessibleRole.ROLE_SECTION; const ROLE_SEPARATOR = nsIAccessibleRole.ROLE_SEPARATOR; const ROLE_SLIDER = nsIAccessibleRole.ROLE_SLIDER; diff --git a/accessible/tests/mochitest/test_aria_roles.html b/accessible/tests/mochitest/test_aria_roles.html index fb621918231..f63e8f77936 100644 --- a/accessible/tests/mochitest/test_aria_roles.html +++ b/accessible/tests/mochitest/test_aria_roles.html @@ -3,6 +3,7 @@
@@ -134,5 +139,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=469688sectionsectionhead+ +scrollbar