AX: iOS ignores ARIA progressbar elements
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2013 16:27:16 +0000 (16:27 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2013 16:27:16 +0000 (16:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116727

Reviewed by David Kilzer.

Source/WebCore:

Make this an accessible element on iOS.

Test: platform/iphone-simulator/accessibility/progressbar.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
(-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):

Tools:

* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::minValue):
(AccessibilityUIElement::maxValue):

LayoutTests:

* platform/iphone-simulator/accessibility/progressbar-expected.txt: Added.
* platform/iphone-simulator/accessibility/progressbar.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/iphone-simulator/accessibility/progressbar-expected.txt [new file with mode: 0644]
LayoutTests/platform/iphone-simulator/accessibility/progressbar.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Tools/ChangeLog
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm

index ab89c77..d38bc9a 100644 (file)
@@ -1,3 +1,13 @@
+2013-06-06  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: iOS ignores ARIA progressbar elements
+        https://bugs.webkit.org/show_bug.cgi?id=116727
+
+        Reviewed by David Kilzer.
+
+        * platform/iphone-simulator/accessibility/progressbar-expected.txt: Added.
+        * platform/iphone-simulator/accessibility/progressbar.html: Added.
+
 2013-06-06  Brent Fulgham  <bfulgham@apple.com>
 
         Unreviewed TestExpectation gardening.  Clean up some lint warnings.
diff --git a/LayoutTests/platform/iphone-simulator/accessibility/progressbar-expected.txt b/LayoutTests/platform/iphone-simulator/accessibility/progressbar-expected.txt
new file mode 100644 (file)
index 0000000..69bbe73
--- /dev/null
@@ -0,0 +1,15 @@
+blah
+This tests that progress bars show up in the AX hierarchy and that min, current and max values are reported correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS button1.iphoneLabel is 'AXLabel: Popularity'
+PASS button1.iphoneValue is 'AXValue: 5.00'
+PASS button1.iphoneIsElement is true
+PASS button1.minValue is 1
+PASS button1.maxValue is 12
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/iphone-simulator/accessibility/progressbar.html b/LayoutTests/platform/iphone-simulator/accessibility/progressbar.html
new file mode 100644 (file)
index 0000000..cdb7458
--- /dev/null
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+var successfullyParsed = false;
+</script>
+</head>
+<body id="body">
+
+<div id="progressbar" role="progressbar" aria-label="Popularity" aria-valuemin="1" aria-valuenow="5" aria-valuemax="12">blah</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that progress bars show up in the AX hierarchy and that min, current and max values are reported correctly.");
+
+    if (window.accessibilityController) {
+
+        var button1 = accessibilityController.accessibleElementById("progressbar");
+        shouldBe("button1.iphoneLabel", "'AXLabel: Popularity'");
+        shouldBe("button1.iphoneValue", "'AXValue: 5.00'");
+        shouldBeTrue("button1.iphoneIsElement");
+        shouldBe("button1.minValue", "1");
+        shouldBe("button1.maxValue", "12");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+
+</body>
+</html>
+
index 3761859..953dec5 100644 (file)
@@ -1,3 +1,19 @@
+2013-06-06  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: iOS ignores ARIA progressbar elements
+        https://bugs.webkit.org/show_bug.cgi?id=116727
+
+        Reviewed by David Kilzer.
+
+        Make this an accessible element on iOS.
+
+        Test: platform/iphone-simulator/accessibility/progressbar.html
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
+        (-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
+        (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
+
 2013-06-06  Christophe Dumez  <ch.dumez@sisa.samsung.com>
 
         Remove unused HashValueForClassAndName() from JSC bindings generator
index 3cfecf5..bc35baa 100644 (file)
@@ -602,6 +602,7 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
         case MenuButtonRole:
         case ValueIndicatorRole:
         case ImageRole:
+        case ProgressIndicatorRole:
         case MenuItemRole:
         case IncrementorRole:
         case ComboBoxRole:
@@ -657,7 +658,6 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
         case RowRole:
         case ToolbarRole:
         case BusyIndicatorRole:
-        case ProgressIndicatorRole:
         case WindowRole:
         case DrawerRole:
         case SystemWideRole:
@@ -716,6 +716,16 @@ static void appendStringToResult(NSMutableString *result, NSString *string)
     [result appendString:string];
 }
 
+- (CGFloat)_accessibilityMinValue
+{
+    return m_object->minValueForRange();
+}
+
+- (CGFloat)_accessibilityMaxValue
+{
+    return m_object->maxValueForRange();
+}
+
 - (NSString *)accessibilityLabel
 {
     if (![self _prepareAccessibilityCall])
index 0ee4e17..69d43b2 100644 (file)
@@ -1,3 +1,14 @@
+2013-06-06  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: iOS ignores ARIA progressbar elements
+        https://bugs.webkit.org/show_bug.cgi?id=116727
+
+        Reviewed by David Kilzer.
+
+        * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+        (AccessibilityUIElement::minValue):
+        (AccessibilityUIElement::maxValue):
+
 2013-06-06  peavo@outlook.com  <peavo@outlook.com>
 
         [WinCairo] Fix build-webkit to build WinCairo under VS2010.
index 4608984..e66aa32 100644 (file)
@@ -77,6 +77,8 @@ AccessibilityUIElement::~AccessibilityUIElement()
 - (CGPoint)accessibilityClickPoint;
 - (void)accessibilityModifySelection:(WebCore::TextGranularity)granularity increase:(BOOL)increase;
 - (void)accessibilitySetPostedNotificationCallback:(AXPostedNotificationCallback)function withContext:(void*)context;
+- (CGFloat)_accessibilityMinValue;
+- (CGFloat)_accessibilityMaxValue;
 @end
 
 @interface NSObject (WebAccessibilityObjectWrapperPrivate)
@@ -506,12 +508,12 @@ double AccessibilityUIElement::intValue() const
 
 double AccessibilityUIElement::minValue()
 {
-    return 0.0f;
+    return [m_element _accessibilityMinValue];
 }
 
 double AccessibilityUIElement::maxValue()
 {
-    return 0.0;
+    return [m_element _accessibilityMaxValue];
 }
 
 JSStringRef AccessibilityUIElement::valueDescription()