Bug 1128143 - Add ATK roles for MathML fractions and roots, r=surkov
authorFrédéric Wang <fred.wang@free.fr>
Thu, 12 Mar 2015 08:21:33 -0400
changeset 233276 1b0004f24d3f799adbcf625330f6a8933a9dfb65
parent 233275 19fafff99435311062003238226ffa58d7e45067
child 233277 672cea72c662ed8cf336d5b622324060ff022bbf
push id56797
push usersurkov.alexander@gmail.com
push dateThu, 12 Mar 2015 12:17:28 +0000
treeherdermozilla-inbound@1b0004f24d3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs1128143
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 1128143 - Add ATK roles for MathML fractions and roots, r=surkov
accessible/atk/AccessibleWrap.cpp
accessible/base/RoleMap.h
other-licenses/atk-1.0/atk/atkobject.h
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -706,16 +706,19 @@ getRoleCB(AtkObject *aAtkObj)
   if (aAtkObj->role == ATK_ROLE_LIST_BOX && !IsAtkVersionAtLeast(2, 1))
     aAtkObj->role = ATK_ROLE_LIST;
   else if (aAtkObj->role == ATK_ROLE_TABLE_ROW && !IsAtkVersionAtLeast(2, 1))
     aAtkObj->role = ATK_ROLE_LIST_ITEM;
   else if (aAtkObj->role == ATK_ROLE_MATH && !IsAtkVersionAtLeast(2, 12))
     aAtkObj->role = ATK_ROLE_PANEL;
   else if (aAtkObj->role == ATK_ROLE_STATIC && !IsAtkVersionAtLeast(2, 16))
     aAtkObj->role = ATK_ROLE_TEXT;
+  else if ((aAtkObj->role == ATK_ROLE_MATH_FRACTION ||
+            aAtkObj->role == ATK_ROLE_MATH_ROOT) && !IsAtkVersionAtLeast(2, 16))
+    aAtkObj->role = ATK_ROLE_UNKNOWN;
 
   return aAtkObj->role;
 }
 
 static AtkAttributeSet*
 ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes)
 {
     if (!aAttributes)
--- a/accessible/base/RoleMap.h
+++ b/accessible/base/RoleMap.h
@@ -1125,33 +1125,33 @@ ROLE(MATHML_ROW,
      ATK_ROLE_PANEL,
      NSAccessibilityUnknownRole,
      0,
      IA2_ROLE_UNKNOWN,
      eNoNameRule)
 
 ROLE(MATHML_FRACTION,
      "mathml fraction",
-     ATK_ROLE_UNKNOWN,
+     ATK_ROLE_MATH_FRACTION,
      NSAccessibilityUnknownRole,
      0,
      IA2_ROLE_UNKNOWN,
      eNoNameRule)
 
 ROLE(MATHML_SQUARE_ROOT,
      "mathml square root",
-     ATK_ROLE_UNKNOWN,
+     ATK_ROLE_MATH_ROOT,
      NSAccessibilityUnknownRole,
      0,
      IA2_ROLE_UNKNOWN,
      eNoNameRule)
 
 ROLE(MATHML_ROOT,
      "mathml root",
-     ATK_ROLE_UNKNOWN,
+     ATK_ROLE_MATH_ROOT,
      NSAccessibilityUnknownRole,
      0,
      IA2_ROLE_UNKNOWN,
      eNoNameRule)
 
 ROLE(MATHML_FENCED,
      "mathml fenced",
      ATK_ROLE_PANEL,
--- a/other-licenses/atk-1.0/atk/atkobject.h
+++ b/other-licenses/atk-1.0/atk/atkobject.h
@@ -214,16 +214,20 @@ extern "C" {
  * should not be applied to widgets which are traditionally interactive, objects
  * which display a significant amount of content, or any object which has an
  * accessible relation pointing to another object. Implementors should expose the
  * displayed information through the accessible name of the object. If doing so seems
  * inappropriate, it may indicate that a different role should be used. For
  * labels which describe another widget, see ATK_ROLE_LABEL. For text views, see
  * ATK_ROLE_TEXT. For generic containers, see ATK_ROLE_PANEL. For objects whose
  * role is not known by the implementor, see ATK_ROLE_UNKNOWN. @Since: ATK-2.16.
+ *@ATK_ROLE_MATH_FRACTION: An object that represents a mathematical fraction.
+ * @Since: ATK-2.16.
+ *@ATK_ROLE_MATH_ROOT: An object that represents a mathematical expression
+ * displayed with a radical. @Since: ATK-2.16.
  *@ATK_ROLE_LAST_DEFINED: not a valid role, used for finding end of the enumeration
  *
  * Describes the role of an object
  *
  * These are the built-in enumerated roles that UI components can have in
  * ATK.  Other roles may be added at runtime, so an AtkRole >=
  * ATK_ROLE_LAST_DEFINED is not necessarily an error.
  **/
@@ -342,16 +346,18 @@ typedef enum
   ATK_ROLE_MARQUEE,
   ATK_ROLE_MATH,
   ATK_ROLE_RATING,
   ATK_ROLE_TIMER,
   ATK_ROLE_DESCRIPTION_LIST,
   ATK_ROLE_DESCRIPTION_TERM,
   ATK_ROLE_DESCRIPTION_VALUE,
   ATK_ROLE_STATIC,
+  ATK_ROLE_MATH_FRACTION,
+  ATK_ROLE_MATH_ROOT,
   ATK_ROLE_LAST_DEFINED
 } AtkRole;
 
 AtkRole                  atk_role_register        (const gchar *name);
 
 /**
  *AtkLayer:
  *@ATK_LAYER_INVALID: The object does not have a layer