Title: [204938] trunk
Revision
204938
Author
n_w...@apple.com
Date
2016-08-24 15:25:17 -0700 (Wed, 24 Aug 2016)

Log Message

AX: VoiceOver on iOS ignores aria-checked on menuitemradio and menuitemcheckbox
https://bugs.webkit.org/show_bug.cgi?id=161118

Reviewed by Chris Fleizach.

Source/WebCore:

Added checkboxOrRadioValue and toggle trait to menuitemradio and menuitemcheckbox.

Test: accessibility/ios-simulator/menuitem-checked.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityTraits]):
(-[WebAccessibilityObjectWrapper accessibilityValue]):

LayoutTests:

* accessibility/ios-simulator/menuitem-checked-expected.txt: Added.
* accessibility/ios-simulator/menuitem-checked.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (204937 => 204938)


--- trunk/LayoutTests/ChangeLog	2016-08-24 22:05:39 UTC (rev 204937)
+++ trunk/LayoutTests/ChangeLog	2016-08-24 22:25:17 UTC (rev 204938)
@@ -1,3 +1,13 @@
+2016-08-24  Nan Wang  <n_w...@apple.com>
+
+        AX: VoiceOver on iOS ignores aria-checked on menuitemradio and menuitemcheckbox
+        https://bugs.webkit.org/show_bug.cgi?id=161118
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/ios-simulator/menuitem-checked-expected.txt: Added.
+        * accessibility/ios-simulator/menuitem-checked.html: Added.
+
 2016-08-24  Jiewen Tan  <jiewen_...@apple.com>
 
         Unreviewed, update expectations of iOS simulator WK1 css3 tests

Added: trunk/LayoutTests/accessibility/ios-simulator/menuitem-checked-expected.txt (0 => 204938)


--- trunk/LayoutTests/accessibility/ios-simulator/menuitem-checked-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/menuitem-checked-expected.txt	2016-08-24 22:25:17 UTC (rev 204938)
@@ -0,0 +1,22 @@
+
+Item one
+Item two
+Item three
+Item four
+Item five
+This tests that menu items can report the right value whether it's checked.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS radio.traits != menuItem1.traits is true
+PASS menuItem1.stringValue is 'AXValue: 1'
+PASS menuItem2.stringValue is 'AXValue: 0'
+PASS menuItem1.traits == menuItem3.traits is true
+PASS menuItem3.stringValue is 'AXValue: 1'
+PASS menuItem4.stringValue is 'AXValue: 0'
+PASS menuItem5.traits != menuItem4.traits is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/ios-simulator/menuitem-checked.html (0 => 204938)


--- trunk/LayoutTests/accessibility/ios-simulator/menuitem-checked.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/menuitem-checked.html	2016-08-24 22:25:17 UTC (rev 204938)
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<input id="radio" type="radio" name="group">
+<div id="menuitem1" role="menuitemradio" aria-checked="true">Item one</div>
+<div id="menuitem2" role="menuitemradio" aria-checked="false">Item two</div>
+
+<div id="menuitem3" role="menuitemcheckbox" aria-checked="true">Item three</div>
+<div id="menuitem4" role="menuitemcheckbox" aria-checked="false">Item four</div>
+
+<div id="menuitem5" role="menuitem">Item five</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that menu items can report the right value whether it's checked.");
+
+    if (window.accessibilityController) {
+
+        var radio = accessibilityController.accessibleElementById("radio");
+        
+        var menuItem1 = accessibilityController.accessibleElementById("menuitem1");
+        var menuItem2 = accessibilityController.accessibleElementById("menuitem2");
+
+        // Verify radio and menuitemradio have different traits.
+        shouldBeTrue("radio.traits != menuItem1.traits");
+        // Verify the value of the checked menu item is correct.
+        shouldBe("menuItem1.stringValue", "'AXValue: 1'");
+        shouldBe("menuItem2.stringValue", "'AXValue: 0'");
+        
+        var menuItem3 = accessibilityController.accessibleElementById("menuitem3");
+        var menuItem4 = accessibilityController.accessibleElementById("menuitem4");
+        
+        // Verify menuitemcheckbox and menuitemradio have same traits.
+        shouldBeTrue("menuItem1.traits == menuItem3.traits");
+        // Verify the value of the checked menu item is correct.
+        shouldBe("menuItem3.stringValue", "'AXValue: 1'");
+        shouldBe("menuItem4.stringValue", "'AXValue: 0'");
+        
+        // Verify menuitem and menuitemradio/menuitemcheckbox have different traits.
+        var menuItem5 = accessibilityController.accessibleElementById("menuitem5");
+        shouldBeTrue("menuItem5.traits != menuItem4.traits");
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (204937 => 204938)


--- trunk/Source/WebCore/ChangeLog	2016-08-24 22:05:39 UTC (rev 204937)
+++ trunk/Source/WebCore/ChangeLog	2016-08-24 22:25:17 UTC (rev 204938)
@@ -1,3 +1,18 @@
+2016-08-24  Nan Wang  <n_w...@apple.com>
+
+        AX: VoiceOver on iOS ignores aria-checked on menuitemradio and menuitemcheckbox
+        https://bugs.webkit.org/show_bug.cgi?id=161118
+
+        Reviewed by Chris Fleizach.
+
+        Added checkboxOrRadioValue and toggle trait to menuitemradio and menuitemcheckbox.
+
+        Test: accessibility/ios-simulator/menuitem-checked.html
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityTraits]):
+        (-[WebAccessibilityObjectWrapper accessibilityValue]):
+
 2016-08-24  Chris Dumez  <cdu...@apple.com>
 
         Assertion hit: ASSERT(!m_parserScheduler) in ~HTMLDocumentParser()

Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (204937 => 204938)


--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2016-08-24 22:05:39 UTC (rev 204937)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2016-08-24 22:25:17 UTC (rev 204938)
@@ -698,9 +698,11 @@
             break;
         case MenuButtonRole:
         case MenuItemRole:
+            traits |= [self _axMenuItemTrait];
+            break;
         case MenuItemCheckboxRole:
         case MenuItemRadioRole:
-            traits |= [self _axMenuItemTrait];
+            traits |= ([self _axMenuItemTrait] | [self _axToggleTrait]);
             break;
         default:
             break;
@@ -1247,7 +1249,8 @@
     if (value)
         return value;
     
-    if (m_object->isCheckboxOrRadio()) {
+    AccessibilityRole role = m_object->roleValue();
+    if (m_object->isCheckboxOrRadio() || role == MenuItemCheckboxRole || role == MenuItemRadioRole) {
         switch (m_object->checkboxOrRadioValue()) {
         case ButtonStateOff:
             return [NSString stringWithFormat:@"%d", 0];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to