Bug 1149118 - Expose radio group with the correct role on OS X, r=surkov
authorMarco Zehe <mzehe@mozilla.com>
Mon, 30 Mar 2015 15:37:09 +0200
changeset 266459 f3457bf766e4da9ebfdbfc2e30d4d5eceff7bab9
parent 266458 814e2c0ad479ae72ee152a456e1e73c9e9010426
child 266460 d5b2cb89687b0239e9983d89606ecb02a3e7e035
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1149118
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1149118 - Expose radio group with the correct role on OS X, r=surkov
accessible/base/ARIAMap.cpp
accessible/base/Role.h
accessible/base/RoleMap.h
accessible/interfaces/nsIAccessibleRole.idl
accessible/tests/mochitest/role.js
accessible/tests/mochitest/role/test_aria.html
accessible/tests/mochitest/tree/test_formctrl.xul
accessible/xul/XULFormControlAccessible.cpp
--- a/accessible/base/ARIAMap.cpp
+++ b/accessible/base/ARIAMap.cpp
@@ -473,17 +473,17 @@ static nsRoleMapEntry sWAIRoleMaps[] =
     eSelectAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIACheckableBool
   },
   { // radiogroup
     &nsGkAtoms::radiogroup,
-    roles::GROUPING,
+    roles::RADIO_GROUP,
     kUseMapRole,
     eNoValue,
     eNoAction,
     eNoLiveAttr,
     kGenericAccType,
     kNoReqStates,
     eARIAOrientation
   },
--- a/accessible/base/Role.h
+++ b/accessible/base/Role.h
@@ -971,17 +971,22 @@ enum Role {
    */
   MATHML_STACK_CARRY = 166,
 
   /**
    * A MathML line in a stack (msline in MathML).
    */
   MATHML_STACK_LINE = 167,
 
-  LAST_ROLE = MATHML_STACK_LINE
+  /**
+   * A group containing radio buttons
+   */
+  RADIO_GROUP = 168,
+
+  LAST_ROLE = RADIO_GROUP
 };
 
 } // namespace role
 
 typedef enum mozilla::a11y::roles::Role role;
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/base/RoleMap.h
+++ b/accessible/base/RoleMap.h
@@ -1354,8 +1354,16 @@ ROLE(MATHML_STACK_CARRY,
 
 ROLE(MATHML_STACK_LINE,
      "mathml stack line",
      ATK_ROLE_UNKNOWN,
      NSAccessibilityUnknownRole,
      0,
      IA2_ROLE_UNKNOWN,
      eNoNameRule)
+
+ROLE(RADIO_GROUP,
+     "grouping",
+     ATK_ROLE_PANEL,
+     NSAccessibilityRadioGroupRole,
+     ROLE_SYSTEM_GROUPING,
+     ROLE_SYSTEM_GROUPING,
+     eNoNameRule)
--- a/accessible/interfaces/nsIAccessibleRole.idl
+++ b/accessible/interfaces/nsIAccessibleRole.idl
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 /**
  * Defines cross platform (Gecko) roles.
  */
-[scriptable, uuid(55581ec3-ba6e-4805-8108-260ed34cdcbb)]
+[scriptable, uuid(00f9e831-3198-40b7-9186-5251474d4d7a)]
 interface nsIAccessibleRole : nsISupports
 {
   /**
    * Used when accessible hans't strong defined role.
    */
   const unsigned long ROLE_NOTHING = 0;
 
   /**
@@ -964,9 +964,14 @@ interface nsIAccessibleRole : nsISupport
    * A MathML carry, borrow, or crossout for a column (mscarry in MathML).
    */
   const unsigned long ROLE_MATHML_STACK_CARRY = 166;
 
   /**
    * A MathML line in a stack (msline in MathML).
    */
   const unsigned long ROLE_MATHML_STACK_LINE = 167;
+
+  /**
+   * A group containing radio buttons
+   */
+  const unsigned long ROLE_RADIO_GROUP = 168;
 };
--- a/accessible/tests/mochitest/role.js
+++ b/accessible/tests/mochitest/role.js
@@ -91,16 +91,17 @@ const ROLE_PAGETABLIST = nsIAccessibleRo
 const ROLE_PANE = nsIAccessibleRole.ROLE_PANE;
 const ROLE_PARAGRAPH = nsIAccessibleRole.ROLE_PARAGRAPH;
 const ROLE_PARENT_MENUITEM = nsIAccessibleRole.ROLE_PARENT_MENUITEM;
 const ROLE_PASSWORD_TEXT = nsIAccessibleRole.ROLE_PASSWORD_TEXT;
 const ROLE_PROGRESSBAR = nsIAccessibleRole.ROLE_PROGRESSBAR;
 const ROLE_PROPERTYPAGE = nsIAccessibleRole.ROLE_PROPERTYPAGE;
 const ROLE_PUSHBUTTON = nsIAccessibleRole.ROLE_PUSHBUTTON;
 const ROLE_RADIOBUTTON = nsIAccessibleRole.ROLE_RADIOBUTTON;
+const ROLE_RADIO_GROUP = nsIAccessibleRole.ROLE_RADIO_GROUP;
 const ROLE_RADIO_MENU_ITEM = nsIAccessibleRole.ROLE_RADIO_MENU_ITEM;
 const ROLE_RICH_OPTION = nsIAccessibleRole.ROLE_RICH_OPTION;
 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;
--- a/accessible/tests/mochitest/role/test_aria.html
+++ b/accessible/tests/mochitest/role/test_aria.html
@@ -46,17 +46,17 @@
       testRole("aria_menubar", ROLE_MENUBAR);
       testRole("aria_menuitem", ROLE_MENUITEM);
       testRole("aria_menuitemcheckbox", ROLE_CHECK_MENU_ITEM);
       testRole("aria_menuitemradio", ROLE_RADIO_MENU_ITEM);
       testRole("aria_note", ROLE_NOTE);
       testRole("aria_presentation", ROLE_TEXT_CONTAINER); // weak role
       testRole("aria_progressbar", ROLE_PROGRESSBAR);
       testRole("aria_radio", ROLE_RADIOBUTTON);
-      testRole("aria_radiogroup", ROLE_GROUPING);
+      testRole("aria_radiogroup", ROLE_RADIO_GROUP);
       testRole("aria_region", ROLE_PANE);
       testRole("aria_row", ROLE_ROW);
       testRole("aria_rowheader", ROLE_ROWHEADER);
       testRole("aria_scrollbar", ROLE_SCROLLBAR);
       testRole("aria_searchbox", ROLE_ENTRY);
       testRole("aria_separator", ROLE_SEPARATOR);
       testRole("aria_slider", ROLE_SLIDER);
       testRole("aria_spinbutton", ROLE_SPINBUTTON);
--- a/accessible/tests/mochitest/tree/test_formctrl.xul
+++ b/accessible/tests/mochitest/tree/test_formctrl.xul
@@ -34,17 +34,17 @@
         role: ROLE_CHECKBUTTON,
         children: [ ]
       };
 
       testAccessibleTree("checkbox", accTree);
 
       // radiogroup
       accTree = {
-        role: ROLE_GROUPING,
+        role: ROLE_RADIO_GROUP,
         children: [
           {
             role: ROLE_RADIOBUTTON,
             children: [ ]
           },
           {
             role: ROLE_RADIOBUTTON,
             children: [ ]
--- a/accessible/xul/XULFormControlAccessible.cpp
+++ b/accessible/xul/XULFormControlAccessible.cpp
@@ -467,17 +467,17 @@ XULRadioGroupAccessible::
   XULRadioGroupAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   XULSelectControlAccessible(aContent, aDoc)
 { 
 }
 
 role
 XULRadioGroupAccessible::NativeRole()
 {
-  return roles::GROUPING;
+  return roles::RADIO_GROUP;
 }
 
 uint64_t
 XULRadioGroupAccessible::NativeInteractiveState() const
 {
   // The radio group is not focusable. Sometimes the focus controller will
   // report that it is focused. That means that the actual selected radio button
   // should be considered focused.