Title: [241066] branches/safari-607-branch
Revision
241066
Author
alanc...@apple.com
Date
2019-02-06 14:16:45 -0800 (Wed, 06 Feb 2019)

Log Message

Cherry-pick r240709. rdar://problem/47776349

    AX: Role=switch not returning correct accessibilityValue
    https://bugs.webkit.org/show_bug.cgi?id=194006

    Reviewed by Joanmarie Diggs.

    Source/WebCore:

    Return the toggle state of a role=switch element.

    Test: accessibility/ios-simulator/role-switch.html

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

    LayoutTests:

    * accessibility/ios-simulator/role-switch-expected.txt: Added.
    * accessibility/ios-simulator/role-switch.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-607-branch/LayoutTests/ChangeLog (241065 => 241066)


--- branches/safari-607-branch/LayoutTests/ChangeLog	2019-02-06 22:16:42 UTC (rev 241065)
+++ branches/safari-607-branch/LayoutTests/ChangeLog	2019-02-06 22:16:45 UTC (rev 241066)
@@ -1,5 +1,41 @@
 2019-02-05  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r240709. rdar://problem/47776349
+
+    AX: Role=switch not returning correct accessibilityValue
+    https://bugs.webkit.org/show_bug.cgi?id=194006
+    
+    Reviewed by Joanmarie Diggs.
+    
+    Source/WebCore:
+    
+    Return the toggle state of a role=switch element.
+    
+    Test: accessibility/ios-simulator/role-switch.html
+    
+    * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityValue]):
+    
+    LayoutTests:
+    
+    * accessibility/ios-simulator/role-switch-expected.txt: Added.
+    * accessibility/ios-simulator/role-switch.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-01-30  Chris Fleizach  <cfleiz...@apple.com>
+
+            AX: Role=switch not returning correct accessibilityValue
+            https://bugs.webkit.org/show_bug.cgi?id=194006
+
+            Reviewed by Joanmarie Diggs.
+
+            * accessibility/ios-simulator/role-switch-expected.txt: Added.
+            * accessibility/ios-simulator/role-switch.html: Added.
+
+2019-02-05  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r240537. rdar://problem/47774500
 
     <video> elements not in the DOM should be allowed to AirPlay

Added: branches/safari-607-branch/LayoutTests/accessibility/ios-simulator/role-switch-expected.txt (0 => 241066)


--- branches/safari-607-branch/LayoutTests/accessibility/ios-simulator/role-switch-expected.txt	                        (rev 0)
+++ branches/safari-607-branch/LayoutTests/accessibility/ios-simulator/role-switch-expected.txt	2019-02-06 22:16:45 UTC (rev 241066)
@@ -0,0 +1,12 @@
+
+This test thats accessibilityValue is correct for role=switch.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS element.stringValue is 'AXValue: 1'
+PASS element.stringValue is 'AXValue: 0'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: branches/safari-607-branch/LayoutTests/accessibility/ios-simulator/role-switch.html (0 => 241066)


--- branches/safari-607-branch/LayoutTests/accessibility/ios-simulator/role-switch.html	                        (rev 0)
+++ branches/safari-607-branch/LayoutTests/accessibility/ios-simulator/role-switch.html	2019-02-06 22:16:45 UTC (rev 241066)
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script>
+var successfullyParsed = false;
+if (window.testRunner)
+   testRunner.dumpAsText();
+</script>
+</head>
+<body>
+
+<button role="switch" aria-checked="true" id="switch" class="switch">
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This test thats accessibilityValue is correct for role=switch.");
+
+    if (window.accessibilityController) {
+
+        var element = accessibilityController.accessibleElementById("switch");
+        shouldBe("element.stringValue", "'AXValue: 1'");
+
+        document.getElementById("switch").ariaChecked = false;
+        shouldBe("element.stringValue", "'AXValue: 0'");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src=""
+
+</body>
+</html>
+

Modified: branches/safari-607-branch/Source/WebCore/ChangeLog (241065 => 241066)


--- branches/safari-607-branch/Source/WebCore/ChangeLog	2019-02-06 22:16:42 UTC (rev 241065)
+++ branches/safari-607-branch/Source/WebCore/ChangeLog	2019-02-06 22:16:45 UTC (rev 241066)
@@ -1,5 +1,45 @@
 2019-02-05  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r240709. rdar://problem/47776349
+
+    AX: Role=switch not returning correct accessibilityValue
+    https://bugs.webkit.org/show_bug.cgi?id=194006
+    
+    Reviewed by Joanmarie Diggs.
+    
+    Source/WebCore:
+    
+    Return the toggle state of a role=switch element.
+    
+    Test: accessibility/ios-simulator/role-switch.html
+    
+    * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityValue]):
+    
+    LayoutTests:
+    
+    * accessibility/ios-simulator/role-switch-expected.txt: Added.
+    * accessibility/ios-simulator/role-switch.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-01-30  Chris Fleizach  <cfleiz...@apple.com>
+
+            AX: Role=switch not returning correct accessibilityValue
+            https://bugs.webkit.org/show_bug.cgi?id=194006
+
+            Reviewed by Joanmarie Diggs.
+
+            Return the toggle state of a role=switch element.
+
+            Test: accessibility/ios-simulator/role-switch.html
+
+            * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+            (-[WebAccessibilityObjectWrapper accessibilityValue]):
+
+2019-02-05  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r240697. rdar://problem/47774541
 
     Make sure we have a frame before trying to access its loader

Modified: branches/safari-607-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (241065 => 241066)


--- branches/safari-607-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2019-02-06 22:16:42 UTC (rev 241065)
+++ branches/safari-607-branch/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2019-02-06 22:16:45 UTC (rev 241066)
@@ -1405,7 +1405,7 @@
         return value;
     
     AccessibilityRole role = m_object->roleValue();
-    if (m_object->isCheckboxOrRadio() || role == AccessibilityRole::MenuItemCheckbox || role == AccessibilityRole::MenuItemRadio) {
+    if (m_object->isCheckboxOrRadio() || role == AccessibilityRole::MenuItemCheckbox || role == AccessibilityRole::MenuItemRadio || role == AccessibilityRole::Switch) {
         switch (m_object->checkboxOrRadioValue()) {
         case AccessibilityButtonState::Off:
             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