Title: [182520] trunk
Revision
182520
Author
[email protected]
Date
2015-04-07 22:57:02 -0700 (Tue, 07 Apr 2015)

Log Message

Bug 142887 - role progress bar does not support indeterminate state
https://bugs.webkit.org/show_bug.cgi?id=142887

Patch by Michael Peechatt <[email protected]> on 2015-04-07
Reviewed by Chris Fleizach.

Source/WebCore:

Test: platform/mac/accessibility/progressbar-indeterminate.html

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
When getting min or max value of an indeterminate progress indicator, return 0.
This is so VoiceOver will recognize it as indeterminate.

LayoutTests:

* platform/mac/accessibility/progressbar-indeterminate-expected.txt: Added.
* platform/mac/accessibility/progressbar-indeterminate.html: Added.
Test that checks if 0 is returned for indetermiate progress indicators when
aria min and max values are non zero.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (182519 => 182520)


--- trunk/LayoutTests/ChangeLog	2015-04-08 05:44:28 UTC (rev 182519)
+++ trunk/LayoutTests/ChangeLog	2015-04-08 05:57:02 UTC (rev 182520)
@@ -1,3 +1,15 @@
+2015-04-07  Michael Peechatt  <[email protected]>
+
+        Bug 142887 - role progress bar does not support indeterminate state
+        https://bugs.webkit.org/show_bug.cgi?id=142887
+
+        Reviewed by Chris Fleizach.
+
+        * platform/mac/accessibility/progressbar-indeterminate-expected.txt: Added.
+        * platform/mac/accessibility/progressbar-indeterminate.html: Added.
+        Test that checks if 0 is returned for indetermiate progress indicators when
+        aria min and max values are non zero.
+
 2015-04-07  Chris Dumez  <[email protected]>
 
         Open WebSockets should not prevent a page from entering PageCache

Added: trunk/LayoutTests/platform/mac/accessibility/progressbar-indeterminate-expected.txt (0 => 182520)


--- trunk/LayoutTests/platform/mac/accessibility/progressbar-indeterminate-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/progressbar-indeterminate-expected.txt	2015-04-08 05:57:02 UTC (rev 182520)
@@ -0,0 +1,15 @@
+X
+
+This tests that elements with progressbar role return 0 for min and max value, if indeterminate.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS prog1.maxValue is 0
+PASS prog1.minValue is 0
+PASS prog2.maxValue is 0
+PASS prog2.minValue is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/progressbar-indeterminate.html (0 => 182520)


--- trunk/LayoutTests/platform/mac/accessibility/progressbar-indeterminate.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/progressbar-indeterminate.html	2015-04-08 05:57:02 UTC (rev 182520)
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div tabindex="0" id="progressbar1" role="progressbar" aria-valuemin="35" aria-valuemax="100">X</div>
+<progress tabindex="0" id="progressbar2" role="progressbar" aria-valuemin="75" aria-valuemax="100"></progress>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that elements with progressbar role return 0 for min and max value, if indeterminate.");
+
+    if (window.accessibilityController) {
+          // Div element given progressbar role, with no value.
+          var prog1 = accessibilityController.accessibleElementById("progressbar1");
+          shouldBe("prog1.maxValue", "0");
+          shouldBe("prog1.minValue", "0");
+
+          // Indeterminate progress element.
+          var prog2 = accessibilityController.accessibleElementById("progressbar2");
+          shouldBe("prog2.maxValue", "0");
+          shouldBe("prog2.minValue", "0");
+    }
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (182519 => 182520)


--- trunk/Source/WebCore/ChangeLog	2015-04-08 05:44:28 UTC (rev 182519)
+++ trunk/Source/WebCore/ChangeLog	2015-04-08 05:57:02 UTC (rev 182520)
@@ -1,3 +1,17 @@
+2015-04-07  Michael Peechatt  <[email protected]>
+
+        Bug 142887 - role progress bar does not support indeterminate state
+        https://bugs.webkit.org/show_bug.cgi?id=142887
+
+        Reviewed by Chris Fleizach.
+
+        Test: platform/mac/accessibility/progressbar-indeterminate.html
+
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
+        When getting min or max value of an indeterminate progress indicator, return 0.
+        This is so VoiceOver will recognize it as indeterminate.
+
 2015-04-07  Chris Dumez  <[email protected]>
 
         Unreviewed, speculative iOS build fix after r182516.

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (182519 => 182520)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2015-04-08 05:44:28 UTC (rev 182519)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2015-04-08 05:57:02 UTC (rev 182520)
@@ -2496,12 +2496,20 @@
         const unichar ch = 0x2713; // ✓ used on Mac for selected menu items.
         return (m_object->isChecked()) ? [NSString stringWithCharacters:&ch length:1] : nil;
     }
-
-    if ([attributeName isEqualToString: NSAccessibilityMinValueAttribute])
+    
+    if ([attributeName isEqualToString: NSAccessibilityMinValueAttribute]) {
+        // Indeterminate progress indicator should return 0.
+        if (m_object->isProgressIndicator() && !m_object->hasAttribute(aria_valuenowAttr))
+            return @0;
         return [NSNumber numberWithFloat:m_object->minValueForRange()];
+    }
     
-    if ([attributeName isEqualToString: NSAccessibilityMaxValueAttribute])
+    if ([attributeName isEqualToString: NSAccessibilityMaxValueAttribute]) {
+        // Indeterminate progress indicator should return 0.
+        if (m_object->isProgressIndicator() && !m_object->hasAttribute(aria_valuenowAttr))
+            return @0;
         return [NSNumber numberWithFloat:m_object->maxValueForRange()];
+    }
     
     if ([attributeName isEqualToString: NSAccessibilityHelpAttribute])
         return [self baseAccessibilityHelpText];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to