AX: [ATK] Implement support for new AtkRole types for MathML
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Jan 2015 17:02:32 +0000 (17:02 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Jan 2015 17:02:32 +0000 (17:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140916

Reviewed by Chris Fleizach.

Source/WebCore:

Expose mfrac as ATK_ROLE_MATH_FRACTION, and both mroot and msqrt as
ATK_ROLE_MATH_ROOT. In the case of script elements, expose the container
(msub, msup, msubsup, and mmultiscripts) using the generic text block role
ATK_ROLE_SECTION. Then expose the actual script child elements using role
ATK_ROLE_SUBSCRIPT/ATK_ROLE_SUPERSCRIPT. In the case of mmultiscripts,
expose whether it is a prescript or postscript via AtkObject attribute.

Test: accessibility/math-multiscript-attributes.html
Also added additional test cases to accessibility/roles-exposed.html

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isMathScriptObject): Added.
(WebCore::AccessibilityObject::isMathMultiscriptObject): Added.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isMathScriptObject): Added.
(WebCore::AccessibilityRenderObject::isMathMultiscriptObject): Added.
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes): Expose whether a multiscript object is a prescript or postscript.
(atkRole): Map WebCore Accessibility objects to the new ATK roles.

Tools:

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: Add mapping for new ATK roles
* gtk/jhbuild.modules: Bump minimum version of ATK used by jhbuild to 2.15.4

LayoutTests:

* accessibility/math-multiscript-attributes.html: Added.
* accessibility/roles-exposed.html: New test cases added.
* platform/efl/accessibility/roles-exposed-expected.txt: Updated for new test cases.
* platform/gtk/accessibility/math-multiscript-attributes-expected.txt: Added.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated for new test cases.
* platform/mac-mavericks/accessibility/roles-exposed-expected.txt: Updated for new test cases.
* platform/mac-mountainlion/accessibility/roles-exposed-expected.txt: Updated for new test cases.
* platform/mac/accessibility/math-multiscript-attributes-expected.txt: Added.
* platform/mac/accessibility/roles-exposed-expected.txt: Updated for new test cases.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179253 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/math-multiscript-attributes.html [new file with mode: 0644]
LayoutTests/accessibility/roles-exposed.html
LayoutTests/platform/efl/accessibility/roles-exposed-expected.txt
LayoutTests/platform/gtk/accessibility/math-multiscript-attributes-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac-mavericks/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac-mountainlion/accessibility/roles-exposed-expected.txt
LayoutTests/platform/mac/accessibility/math-multiscript-attributes-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h
Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/gtk/jhbuild.modules

index e3dd7cc..31fa223 100644 (file)
@@ -1,3 +1,20 @@
+2015-01-28  Joanmarie Diggs  <jdiggs@igalia.com>
+
+        AX: [ATK] Implement support for new AtkRole types for MathML
+        https://bugs.webkit.org/show_bug.cgi?id=140916
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/math-multiscript-attributes.html: Added.
+        * accessibility/roles-exposed.html: New test cases added.
+        * platform/efl/accessibility/roles-exposed-expected.txt: Updated for new test cases.
+        * platform/gtk/accessibility/math-multiscript-attributes-expected.txt: Added.
+        * platform/gtk/accessibility/roles-exposed-expected.txt: Updated for new test cases.
+        * platform/mac-mavericks/accessibility/roles-exposed-expected.txt: Updated for new test cases.
+        * platform/mac-mountainlion/accessibility/roles-exposed-expected.txt: Updated for new test cases.
+        * platform/mac/accessibility/math-multiscript-attributes-expected.txt: Added.
+        * platform/mac/accessibility/roles-exposed-expected.txt: Updated for new test cases.
+
 2015-01-28  Brent Fulgham  <bfulgham@apple.com>
 
         REGRESSION: Re-skip media tests. (Unreviewed)
diff --git a/LayoutTests/accessibility/math-multiscript-attributes.html b/LayoutTests/accessibility/math-multiscript-attributes.html
new file mode 100644 (file)
index 0000000..c1c4776
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+<math>
+  <mmultiscripts id="mmultiscripts">
+    <mi>X</mi>
+    <mi>D</mi>
+    <mi>C</mi>
+    <mprescripts />
+    <mi>B</mi>
+    <mi>A</mi>
+    </mmultiscripts>
+</math>
+<div id="console"></div>
+<script>
+description("This tests the attributes of the children of a MathML mmultiscripts element.");
+if (window.testRunner && window.accessibilityController) {
+    var elem = accessibilityController.accessibleElementById("mmultiscripts");
+    debug(elem.attributesOfChildren());
+
+}
+</script>
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
index 5217f01..8107ec1 100644 (file)
 <math><msqrt data-platform="atk,mac" class="ex">X</msqrt></math>
 <math><mrow data-platform="atk,mac" class="ex"><mi class="ex">X</mi></mrow></math>
 <math><ms data-platform="atk,mac" class="ex">X</ms></math>
+<math>
+  <msub data-platform="atk,mac" class="ex">
+    <mi data-platform="atk,mac" class="ex">X</mi>
+    <mi data-platform="atk,mac" class="ex">X</mi>
+  </msub>
+  <msup data-platform="atk,mac" class="ex">
+    <mi data-platform="atk,mac" class="ex">X</mi>
+    <mi data-platform="atk,mac" class="ex">X</mi>
+  </msup>
+  <msubsup data-platform="atk,mac" class="ex">
+    <mi data-platform="atk,mac" class="ex">X</mi>
+    <mi data-platform="atk,mac" class="ex">X</mi>
+    <mi data-platform="atk,mac" class="ex">x</mi>
+  </msubsup>
+  <mmultiscripts data-platform="atk,mac" class="ex">
+    <mi data-platform="atk,mac" class="ex">X</mi>
+    <mi data-platform="atk,mac" class="ex">X</mi>
+    <mi data-platform="atk,mac" class="ex">x</mi>
+    <mprescripts data-platform="atk,mac" class="ex" />
+    <mi data-platform="atk,mac" class="ex">X</mi>
+    <mi data-platform="atk,mac" class="ex">x</mi>
+  </mmultiscripts>
+</math>
+</math>
 <math><mtext data-platform="atk,mac" class="ex">X</mtext></math>
 <math>
   <mtable data-platform="atk,mac" class="ex">
index afe7968..755cb8a 100644 (file)
@@ -250,6 +250,57 @@ mrow
 ms
       AXRole: AXStatic
       
+msub
+      AXRole: AXSection
+      
+mi
+      AXRole: AXUnknown
+      
+mi
+      AXRole: AXUnknown
+      
+msup
+      AXRole: AXSection
+      
+mi
+      AXRole: AXUnknown
+      
+mi
+      AXRole: AXUnknown
+      
+msubsup
+      AXRole: AXSection
+      
+mi
+      AXRole: AXUnknown
+      
+mi
+      AXRole: AXUnknown
+      
+mi
+      AXRole: AXUnknown
+      
+mmultiscripts
+      AXRole: AXSection
+      
+mi
+      AXRole: AXUnknown
+      
+mi
+      AXRole: AXUnknown
+      
+mi
+      AXRole: AXUnknown
+      
+mprescripts
+      AXRole: 
+      
+mi
+      AXRole: AXUnknown
+      
+mi
+      AXRole: AXUnknown
+      
 mtext
       AXRole: AXStatic
       
diff --git a/LayoutTests/platform/gtk/accessibility/math-multiscript-attributes-expected.txt b/LayoutTests/platform/gtk/accessibility/math-multiscript-attributes-expected.txt
new file mode 100644 (file)
index 0000000..1e498e7
--- /dev/null
@@ -0,0 +1,110 @@
+X
+D
+C
+B
+A
+This tests the attributes of the children of a MathML mmultiscripts element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+AXRole: AXStatic
+AXParent: AXSection
+AXChildren: 0
+AXPosition: { 19.000000, -34.000000 }
+AXSize: { 15.000000, 106.000000 }
+AXTitle: 
+AXDescription: 
+AXValue: X
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: toolkit:WebKitGtk
+------------
+AXRole: AXSubscript
+AXParent: AXSection
+AXChildren: 0
+AXPosition: { 33.000000, -14.000000 }
+AXSize: { 11.000000, 81.000000 }
+AXTitle: 
+AXDescription: 
+AXValue: D
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: multiscript-type:post, toolkit:WebKitGtk
+------------
+AXRole: AXSuperscript
+AXParent: AXSection
+AXChildren: 0
+AXPosition: { 33.000000, -26.000000 }
+AXSize: { 11.000000, 80.000000 }
+AXTitle: 
+AXDescription: 
+AXValue: C
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: multiscript-type:post, toolkit:WebKitGtk
+------------
+AXRole: AXSubscript
+AXParent: AXSection
+AXChildren: 0
+AXPosition: { 9.000000, -14.000000 }
+AXSize: { 10.000000, 81.000000 }
+AXTitle: 
+AXDescription: 
+AXValue: B
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: multiscript-type:pre, toolkit:WebKitGtk
+------------
+AXRole: AXSuperscript
+AXParent: AXSection
+AXChildren: 0
+AXPosition: { 9.000000, -26.000000 }
+AXSize: { 10.000000, 80.000000 }
+AXTitle: 
+AXDescription: 
+AXValue: A
+AXFocusable: 0
+AXFocused: 0
+AXSelectable: 0
+AXSelected: 0
+AXMultiSelectable: 0
+AXEnabled: 1
+AXExpanded: 0
+AXRequired: 0
+AXChecked: 0
+AXPlatformAttributes: multiscript-type:pre, toolkit:WebKitGtk
+------------
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
index 3b62db4..d56a0e5 100644 (file)
@@ -227,7 +227,7 @@ mfenced
       AXRole: AXGroup
       
 mfrac
-      AXRole: AXUnknown
+      AXRole: AXMathFraction
       
 mi
       AXRole: AXStatic
@@ -239,10 +239,10 @@ mo
       AXRole: AXStatic
       
 mroot
-      AXRole: AXUnknown
+      AXRole: AXMathRoot
       
 msqrt
-      AXRole: AXUnknown
+      AXRole: AXMathRoot
       
 mrow
       AXRole: AXGroup
@@ -250,6 +250,57 @@ mrow
 ms
       AXRole: AXStatic
       
+msub
+      AXRole: AXSection
+      
+mi
+      AXRole: AXStatic
+      
+mi
+      AXRole: AXSubscript
+      
+msup
+      AXRole: AXSection
+      
+mi
+      AXRole: AXStatic
+      
+mi
+      AXRole: AXSuperscript
+      
+msubsup
+      AXRole: AXSection
+      
+mi
+      AXRole: AXStatic
+      
+mi
+      AXRole: AXSubscript
+      
+mi
+      AXRole: AXSuperscript
+      
+mmultiscripts
+      AXRole: AXSection
+      
+mi
+      AXRole: AXStatic
+      
+mi
+      AXRole: AXSubscript
+      
+mi
+      AXRole: AXSuperscript
+      
+mprescripts
+      AXRole: 
+      
+mi
+      AXRole: AXSubscript
+      
+mi
+      AXRole: AXSuperscript
+      
 mtext
       AXRole: AXStatic
       
index 01525cd..cc5da38 100644 (file)
@@ -414,6 +414,91 @@ ms
       AXSubrole: AXMathText
       AXRoleDescription: group
       
+msub
+      AXRole: AXGroup
+      AXSubrole: AXMathSubscriptSuperscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+msup
+      AXRole: AXGroup
+      AXSubrole: AXMathSubscriptSuperscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+msubsup
+      AXRole: AXGroup
+      AXSubrole: AXMathSubscriptSuperscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mmultiscripts
+      AXRole: AXGroup
+      AXSubrole: AXMathMultiscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mprescripts
+      AXRole: 
+      AXSubrole: 
+      AXRoleDescription: 
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
 mtext
       AXRole: AXGroup
       AXSubrole: AXMathText
index 6de04ec..a55df7e 100644 (file)
@@ -414,6 +414,91 @@ ms
       AXSubrole: AXMathText
       AXRoleDescription: group
       
+msub
+      AXRole: AXGroup
+      AXSubrole: AXMathSubscriptSuperscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+msup
+      AXRole: AXGroup
+      AXSubrole: AXMathSubscriptSuperscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+msubsup
+      AXRole: AXGroup
+      AXSubrole: AXMathSubscriptSuperscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mmultiscripts
+      AXRole: AXGroup
+      AXSubrole: AXMathMultiscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mprescripts
+      AXRole: 
+      AXSubrole: 
+      AXRoleDescription: 
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
 mtext
       AXRole: AXGroup
       AXSubrole: AXMathText
diff --git a/LayoutTests/platform/mac/accessibility/math-multiscript-attributes-expected.txt b/LayoutTests/platform/mac/accessibility/math-multiscript-attributes-expected.txt
new file mode 100644 (file)
index 0000000..d2b0e60
--- /dev/null
@@ -0,0 +1,150 @@
+X
+D
+C
+B
+A
+This tests the attributes of the children of a MathML mmultiscripts element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+AXRole: AXGroup
+AXSubrole: AXMathIdentifier
+AXRoleDescription: group
+AXChildren: 
+AXHelp: 
+AXParent: 
+AXSize: NSSize: {12, 24}
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocused: 0
+AXEnabled: 1
+AXWindow: 
+AXSelectedTextMarkerRange: (null)
+AXStartTextMarker: 
+AXEndTextMarker: 
+AXVisited: 0
+AXLinkedUIElements: 
+AXSelected: 0
+AXBlockQuoteLevel: 0
+AXTopLevelUIElement: 
+AXLanguage: 
+AXDOMIdentifier: 
+AXDOMClassList: 
+AXElementBusy: 0
+
+------------
+AXRole: AXGroup
+AXSubrole: AXMathIdentifier
+AXRoleDescription: group
+AXChildren: 
+AXHelp: 
+AXParent: 
+AXSize: NSSize: {11, 19}
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocused: 0
+AXEnabled: 1
+AXWindow: 
+AXSelectedTextMarkerRange: (null)
+AXStartTextMarker: 
+AXEndTextMarker: 
+AXVisited: 0
+AXLinkedUIElements: 
+AXSelected: 0
+AXBlockQuoteLevel: 0
+AXTopLevelUIElement: 
+AXLanguage: 
+AXDOMIdentifier: 
+AXDOMClassList: 
+AXElementBusy: 0
+
+------------
+AXRole: AXGroup
+AXSubrole: AXMathIdentifier
+AXRoleDescription: group
+AXChildren: 
+AXHelp: 
+AXParent: 
+AXSize: NSSize: {10, 18}
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocused: 0
+AXEnabled: 1
+AXWindow: 
+AXSelectedTextMarkerRange: (null)
+AXStartTextMarker: 
+AXEndTextMarker: 
+AXVisited: 0
+AXLinkedUIElements: 
+AXSelected: 0
+AXBlockQuoteLevel: 0
+AXTopLevelUIElement: 
+AXLanguage: 
+AXDOMIdentifier: 
+AXDOMClassList: 
+AXElementBusy: 0
+
+------------
+AXRole: AXGroup
+AXSubrole: AXMathIdentifier
+AXRoleDescription: group
+AXChildren: 
+AXHelp: 
+AXParent: 
+AXSize: NSSize: {9, 19}
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocused: 0
+AXEnabled: 1
+AXWindow: 
+AXSelectedTextMarkerRange: (null)
+AXStartTextMarker: 
+AXEndTextMarker: 
+AXVisited: 0
+AXLinkedUIElements: 
+AXSelected: 0
+AXBlockQuoteLevel: 0
+AXTopLevelUIElement: 
+AXLanguage: 
+AXDOMIdentifier: 
+AXDOMClassList: 
+AXElementBusy: 0
+
+------------
+AXRole: AXGroup
+AXSubrole: AXMathIdentifier
+AXRoleDescription: group
+AXChildren: 
+AXHelp: 
+AXParent: 
+AXSize: NSSize: {9, 18}
+AXTitle: 
+AXDescription: 
+AXValue: 
+AXFocused: 0
+AXEnabled: 1
+AXWindow: 
+AXSelectedTextMarkerRange: (null)
+AXStartTextMarker: 
+AXEndTextMarker: 
+AXVisited: 0
+AXLinkedUIElements: 
+AXSelected: 0
+AXBlockQuoteLevel: 0
+AXTopLevelUIElement: 
+AXLanguage: 
+AXDOMIdentifier: 
+AXDOMClassList: 
+AXElementBusy: 0
+
+------------
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
index 1c8a062..c68bc38 100644 (file)
@@ -414,6 +414,91 @@ ms
       AXSubrole: AXMathText
       AXRoleDescription: group
       
+msub
+      AXRole: AXGroup
+      AXSubrole: AXMathSubscriptSuperscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+msup
+      AXRole: AXGroup
+      AXSubrole: AXMathSubscriptSuperscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+msubsup
+      AXRole: AXGroup
+      AXSubrole: AXMathSubscriptSuperscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mmultiscripts
+      AXRole: AXGroup
+      AXSubrole: AXMathMultiscript
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mprescripts
+      AXRole: 
+      AXSubrole: 
+      AXRoleDescription: 
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
+mi
+      AXRole: AXGroup
+      AXSubrole: AXMathIdentifier
+      AXRoleDescription: group
+      
 mtext
       AXRole: AXGroup
       AXSubrole: AXMathText
index 92cdc0a..18b69ad 100644 (file)
@@ -1,3 +1,31 @@
+2015-01-28  Joanmarie Diggs  <jdiggs@igalia.com>
+
+        AX: [ATK] Implement support for new AtkRole types for MathML
+        https://bugs.webkit.org/show_bug.cgi?id=140916
+
+        Reviewed by Chris Fleizach.
+
+        Expose mfrac as ATK_ROLE_MATH_FRACTION, and both mroot and msqrt as
+        ATK_ROLE_MATH_ROOT. In the case of script elements, expose the container
+        (msub, msup, msubsup, and mmultiscripts) using the generic text block role
+        ATK_ROLE_SECTION. Then expose the actual script child elements using role
+        ATK_ROLE_SUBSCRIPT/ATK_ROLE_SUPERSCRIPT. In the case of mmultiscripts,
+        expose whether it is a prescript or postscript via AtkObject attribute.
+
+        Test: accessibility/math-multiscript-attributes.html
+        Also added additional test cases to accessibility/roles-exposed.html
+
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::isMathScriptObject): Added.
+        (WebCore::AccessibilityObject::isMathMultiscriptObject): Added.
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::isMathScriptObject): Added.
+        (WebCore::AccessibilityRenderObject::isMathMultiscriptObject): Added.
+        * accessibility/AccessibilityRenderObject.h:
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetAttributes): Expose whether a multiscript object is a prescript or postscript.
+        (atkRole): Map WebCore Accessibility objects to the new ATK roles.
+
 2015-01-28  Chris Dumez  <cdumez@apple.com>
 
         Rename pageCache() to PageCache::shared() and return a reference
index 04ca48b..e37c532 100644 (file)
@@ -422,6 +422,9 @@ struct AccessibilitySelectTextCriteria {
     { }
 };
 
+enum AccessibilityMathScriptObjectType { Subscript, Superscript };
+enum AccessibilityMathMultiscriptObjectType { PreSubscript, PreSuperscript, PostSubscript, PostSuperscript };
+
 class AccessibilityObject : public RefCounted<AccessibilityObject> {
 protected:
     AccessibilityObject();
@@ -900,6 +903,8 @@ public:
     virtual bool isMathTableCell() const { return false; }
     virtual bool isMathMultiscript() const { return false; }
     virtual bool isMathToken() const { return false; }
+    virtual bool isMathScriptObject(AccessibilityMathScriptObjectType) const { return false; }
+    virtual bool isMathMultiscriptObject(AccessibilityMathMultiscriptObjectType) const { return false; }
 
     // Root components.
     virtual AccessibilityObject* mathRadicandObject() { return nullptr; }
index d31eec3..4d40492 100644 (file)
@@ -3611,6 +3611,42 @@ bool AccessibilityRenderObject::isMathTableCell() const
 {
     return node() && node()->hasTagName(MathMLNames::mtdTag);
 }
+
+bool AccessibilityRenderObject::isMathScriptObject(AccessibilityMathScriptObjectType type) const
+{
+    AccessibilityObject* parent = parentObjectUnignored();
+    if (!parent)
+        return false;
+
+    return type == Subscript ? this == parent->mathSubscriptObject() : this == parent->mathSuperscriptObject();
+}
+
+bool AccessibilityRenderObject::isMathMultiscriptObject(AccessibilityMathMultiscriptObjectType type) const
+{
+    AccessibilityObject* parent = parentObjectUnignored();
+    if (!parent || !parent->isMathMultiscript())
+        return false;
+
+    // The scripts in a MathML <mmultiscripts> element consist of one or more
+    // subscript, superscript pairs. In order to determine if this object is
+    // a scripted token, we need to examine each set of pairs to see if the
+    // this token is present and in the position corresponding with the type.
+
+    AccessibilityMathMultiscriptPairs pairs;
+    if (type == PreSubscript || type == PreSuperscript)
+        parent->mathPrescripts(pairs);
+    else
+        parent->mathPostscripts(pairs);
+
+    for (const auto& pair : pairs) {
+        if (this == pair.first)
+            return (type == PreSubscript || type == PostSubscript);
+        if (this == pair.second)
+            return (type == PreSuperscript || type == PostSuperscript);
+    }
+
+    return false;
+}
     
 bool AccessibilityRenderObject::isIgnoredElementWithinMathTree() const
 {
index e9582fb..5163189 100644 (file)
@@ -304,6 +304,8 @@ private:
     virtual bool isMathTableCell() const override;
     virtual bool isMathMultiscript() const override;
     virtual bool isMathToken() const override;
+    virtual bool isMathScriptObject(AccessibilityMathScriptObjectType) const override;
+    virtual bool isMathMultiscriptObject(AccessibilityMathMultiscriptObjectType) const override;
     
     // Generic components.
     virtual AccessibilityObject* mathBaseObject() override;
index 267169a..d8f9198 100644 (file)
@@ -425,6 +425,13 @@ static AtkAttributeSet* webkitAccessibleGetAttributes(AtkObject* object)
         attributeSet = addToAtkAttributeSet(attributeSet, "level", value.utf8().data());
     }
 
+    if (coreObject->roleValue() == MathElementRole) {
+        if (coreObject->isMathMultiscriptObject(PreSuperscript) || coreObject->isMathMultiscriptObject(PreSubscript))
+            attributeSet = addToAtkAttributeSet(attributeSet, "multiscript-type", "pre");
+        else if (coreObject->isMathMultiscriptObject(PostSuperscript) || coreObject->isMathMultiscriptObject(PostSubscript))
+            attributeSet = addToAtkAttributeSet(attributeSet, "multiscript-type", "post");
+    }
+
     // Set the 'layout-guess' attribute to help Assistive
     // Technologies know when an exposed table is not data table.
     if (is<AccessibilityTable>(*coreObject) && downcast<AccessibilityTable>(*coreObject).isExposableThroughAccessibility() && !coreObject->isDataTable())
@@ -658,6 +665,20 @@ static AtkRole atkRole(AccessibilityObject* coreObject)
             return ATK_ROLE_TABLE_ROW;
         if (coreObject->isMathTableCell())
             return ATK_ROLE_TABLE_CELL;
+        if (coreObject->isMathSubscriptSuperscript() || coreObject->isMathMultiscript())
+            return ATK_ROLE_SECTION;
+#if ATK_CHECK_VERSION(2, 15, 4)
+        if (coreObject->isMathFraction())
+            return ATK_ROLE_MATH_FRACTION;
+        if (coreObject->isMathSquareRoot() || coreObject->isMathRoot())
+            return ATK_ROLE_MATH_ROOT;
+        if (coreObject->isMathScriptObject(Subscript)
+            || coreObject->isMathMultiscriptObject(PreSubscript) || coreObject->isMathMultiscriptObject(PostSubscript))
+            return ATK_ROLE_SUBSCRIPT;
+        if (coreObject->isMathScriptObject(Superscript)
+            || coreObject->isMathMultiscriptObject(PreSuperscript) || coreObject->isMathMultiscriptObject(PostSuperscript))
+            return ATK_ROLE_SUPERSCRIPT;
+#endif
 #if ATK_CHECK_VERSION(2, 15, 2)
         if (coreObject->isMathToken())
             return ATK_ROLE_STATIC;
index 24e5d79..a54d63a 100644 (file)
@@ -1,3 +1,13 @@
+2015-01-28  Joanmarie Diggs  <jdiggs@igalia.com>
+
+        AX: [ATK] Implement support for new AtkRole types for MathML
+        https://bugs.webkit.org/show_bug.cgi?id=140916
+
+        Reviewed by Chris Fleizach.
+
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: Add mapping for new ATK roles
+        * gtk/jhbuild.modules: Bump minimum version of ATK used by jhbuild to 2.15.4
+
 2015-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Stop removing color marks from unit tests output
index 09a991b..0ad2235 100644 (file)
@@ -485,6 +485,16 @@ const gchar* roleToString(AtkObject* object)
     case ATK_ROLE_STATIC:
         return "AXStatic";
 #endif
+#if ATK_CHECK_VERSION(2, 15, 4)
+    case ATK_ROLE_MATH_FRACTION:
+        return "AXMathFraction";
+    case ATK_ROLE_MATH_ROOT:
+        return "AXMathRoot";
+    case ATK_ROLE_SUBSCRIPT:
+        return "AXSubscript";
+    case ATK_ROLE_SUPERSCRIPT:
+        return "AXSuperscript";
+#endif
     default:
         // We want to distinguish ATK_ROLE_UNKNOWN from a known AtkRole which
         // our DRT isn't properly handling.
index fcf9cd9..9380ca3 100644 (file)
   <autotools id="atk"
              autogen-sh="configure"
              autogenargs="--disable-introspection">
-    <branch module="pub/GNOME/sources/atk/2.15/atk-2.15.2.tar.xz" version="2.15.2"
+    <branch module="pub/GNOME/sources/atk/2.15/atk-2.15.4.tar.xz" version="2.15.4"
             repo="ftp.gnome.org"
-            hash="sha256:179d15424b8aa3a5726903f0da458de68e0585dfd9d451c6dcfcdb6b7b509cbe"/>
+            hash="sha256:0dddfa73a02178ca21a8de172c86d699aa887b4efeec736b4c8721eee4ac349c"/>
   </autotools>
 
   <autotools id="at-spi2-core"