From e78090c2e9fb23c0a5fd85019743a148a33346f1 Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Fri, 11 Apr 2008 19:53:20 +0000 Subject: [PATCH] Bug 428479. Support ARIA role of math. r=marcoz, a=beltzner --- accessible/public/nsIAccessibleRole.idl | 12 +++++++++--- accessible/src/atk/nsRoleMap.h | 1 + accessible/src/base/nsARIAMap.cpp | 1 + accessible/src/base/nsAccessibilityService.h | 4 ++-- accessible/src/base/nsAccessible.cpp | 1 + accessible/src/mac/nsRoleMap.h | 1 + accessible/src/msaa/nsRoleMap.h | 3 +++ 7 files changed, 18 insertions(+), 5 deletions(-) diff --git a/accessible/public/nsIAccessibleRole.idl b/accessible/public/nsIAccessibleRole.idl index dc43574512c..54de2bb9eab 100755 --- a/accessible/public/nsIAccessibleRole.idl +++ b/accessible/public/nsIAccessibleRole.idl @@ -44,7 +44,7 @@ * @note - When adding a new role, be sure to also add it to nsRoleMap.h for * each platform. */ -[scriptable, uuid(31685b85-36a3-448c-99ed-b034a198e303)] +[scriptable, uuid(8c0f68f8-164a-4078-a9ee-36a7d180f0e4)] interface nsIAccessibleRole : nsISupports { /** @@ -392,7 +392,8 @@ interface nsIAccessibleRole : nsISupports const unsigned long ROLE_ANIMATION = 54; /** - * Represents a mathematical equation. It is used by MATHML. + * Represents a mathematical equation. It is used by MATHML, where there is a + * rich DOM subtree for an equation. Use ROLE_FLAT_EQUATION for [TeX] */ const unsigned long ROLE_EQUATION = 55; @@ -763,10 +764,15 @@ interface nsIAccessibleRole : nsISupports */ const unsigned long ROLE_LISTBOX = 119; + /** + * Represents a mathematical equation in the accessible name + */ + const unsigned long ROLE_FLAT_EQUATION = 120; + /** * It's not role actually. This contanst is important to help ensure * nsRoleMap's are synchronized. */ - const unsigned long ROLE_LAST_ENTRY = 120; + const unsigned long ROLE_LAST_ENTRY = 121; }; diff --git a/accessible/src/atk/nsRoleMap.h b/accessible/src/atk/nsRoleMap.h index bdcf2138605..337f9182aa4 100644 --- a/accessible/src/atk/nsRoleMap.h +++ b/accessible/src/atk/nsRoleMap.h @@ -166,6 +166,7 @@ static const PRUint32 atkRoleMap[] = { ATK_ROLE_LIST_ITEM, // nsIAccessibleRole::ROLE_OPTION 117 ATK_ROLE_LIST_ITEM, // nsIAccessibleRole::ROLE_RICH_OPTION 118 ATK_ROLE_LIST, // nsIAccessibleRole::ROLE_LISTBOX 119 + ATK_ROLE_UNKNOWN, // nsIAccessibleRole::ROLE_FLAT_EQUATION 120 kROLE_ATK_LAST_ENTRY // nsIAccessibleRole::ROLE_LAST_ENTRY }; diff --git a/accessible/src/base/nsARIAMap.cpp b/accessible/src/base/nsARIAMap.cpp index b12e25ac644..25c669433d4 100644 --- a/accessible/src/base/nsARIAMap.cpp +++ b/accessible/src/base/nsARIAMap.cpp @@ -107,6 +107,7 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] = {&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}, + {"math", nsIAccessibleRole::ROLE_FLAT_EQUATION, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry}, {"menu", nsIAccessibleRole::ROLE_MENUPOPUP, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry}, {"menubar", nsIAccessibleRole::ROLE_MENUBAR, eNameLabelOrTitle, eNoValue, kNoReqStates, kEndEntry}, {"menuitem", nsIAccessibleRole::ROLE_MENUITEM, eNameOkFromChildren, eNoValue, kNoReqStates, diff --git a/accessible/src/base/nsAccessibilityService.h b/accessible/src/base/nsAccessibilityService.h index 55ebe0d12aa..59f3bca6f82 100644 --- a/accessible/src/base/nsAccessibilityService.h +++ b/accessible/src/base/nsAccessibilityService.h @@ -269,8 +269,8 @@ static const char kRoleNames[][20] = { "image map", //ROLE_IMAGE_MAP "listbox option", //ROLE_OPTION "listbox rich option", //ROLE_RICH_OPTION - "listbox" //ROLE_LISTBOX - + "listbox", //ROLE_LISTBOX + "flat equation" //ROLE_FLAT_EQUATION }; /** diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index d67fa9951d1..65a70481019 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -3523,6 +3523,7 @@ PRBool nsAccessible::MustPrune(nsIAccessible *aAccessible) role == nsIAccessibleRole::ROLE_COMBOBOX_OPTION || role == nsIAccessibleRole::ROLE_OPTION || role == nsIAccessibleRole::ROLE_ENTRY || + role == nsIAccessibleRole::ROLE_FLAT_EQUATION || role == nsIAccessibleRole::ROLE_PASSWORD_TEXT || role == nsIAccessibleRole::ROLE_PUSHBUTTON || role == nsIAccessibleRole::ROLE_TOGGLE_BUTTON || diff --git a/accessible/src/mac/nsRoleMap.h b/accessible/src/mac/nsRoleMap.h index 2802537c9ae..d4ea3818f14 100644 --- a/accessible/src/mac/nsRoleMap.h +++ b/accessible/src/mac/nsRoleMap.h @@ -162,5 +162,6 @@ static const NSString* AXRoles [] = { NSAccessibilityRowRole, // ROLE_OPTION NSAccessibilityRowRole, // ROLE_RICH_OPTION NSAccessibilityListRole, // ROLE_LISTBOX + NSAccessibilityUnknownRole, // ROLE_FLAT_EQUATION @"ROLE_LAST_ENTRY" // ROLE_LAST_ENTRY. bogus role that will never be shown (just marks the end of this array)! }; diff --git a/accessible/src/msaa/nsRoleMap.h b/accessible/src/msaa/nsRoleMap.h index 516f72fc300..946df5e1f39 100644 --- a/accessible/src/msaa/nsRoleMap.h +++ b/accessible/src/msaa/nsRoleMap.h @@ -434,6 +434,9 @@ static const WindowsRoleMapItem gWindowsRoleMap[] = { // nsIAccessibleRole::ROLE_LISTBOX { ROLE_SYSTEM_LIST, ROLE_SYSTEM_LIST }, + // nsIAccessibleRole::ROLE_FLAT_EQUATION + { ROLE_SYSTEM_EQUATION, ROLE_SYSTEM_EQUATION }, + // nsIAccessibleRole::ROLE_LAST_ENTRY { ROLE_WINDOWS_LAST_ENTRY, ROLE_WINDOWS_LAST_ENTRY } };