AX: Toggling check box state not speaking using plain space, not VO space.
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2015 21:21:24 +0000 (21:21 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2015 21:21:24 +0000 (21:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143356

Reviewed by Darin Adler.

Source/WebCore:

The checkbox state change needs to result in a value change being generated, otherwise accessibility won't know the value has changed through keyboard usage.

Test: platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html

* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):

LayoutTests:

* platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space-expected.txt: Added.
* platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm

index fd137ef..3f6ea7a 100644 (file)
@@ -1,3 +1,13 @@
+2015-04-03  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: Toggling check box state not speaking using plain space, not VO space.
+        https://bugs.webkit.org/show_bug.cgi?id=143356
+
+        Reviewed by Darin Adler.
+
+        * platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space-expected.txt: Added.
+        * platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html: Added.
+
 2015-04-03  Alexey Proskuryakov  <ap@apple.com>
 
         Re-skip tests that got recently enabled, but time out.
diff --git a/LayoutTests/platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space-expected.txt b/LayoutTests/platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space-expected.txt
new file mode 100644 (file)
index 0000000..12489ad
--- /dev/null
@@ -0,0 +1,13 @@
+checkbox
+radio
+This tests that if a radio or checkbox has its state changed with a space bar, then a value change notification is sent
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Received AXValueChanged
+Received AXValueChanged
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html b/LayoutTests/platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html
new file mode 100644 (file)
index 0000000..001f040
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<meta charset="utf-8">
+<script src="../../../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<input type="checkbox" id="checkbox">checkbox<br>
+
+<input type="radio" id="radio">radio
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that if a radio or checkbox has its state changed with a space bar, then a value change notification is sent");
+
+    var callbackCount = 0;
+    function notificationCallback(notification) {
+        if (notification == "AXValueChanged") {
+           debug("Received " + notification);
+
+           if (callbackCount == 1)
+               finishJSTest();
+           callbackCount++;
+        }
+    }
+
+    if (window.accessibilityController) {
+        window.jsTestIsAsync = true;
+
+        var checkbox = accessibilityController.accessibleElementById("checkbox");
+        checkbox.addNotificationListener(notificationCallback);
+
+        var radio = accessibilityController.accessibleElementById("radio");
+        radio.addNotificationListener(notificationCallback);
+
+        document.getElementById("checkbox").focus();
+        eventSender.keyDown(' ', new Array());
+
+        document.getElementById("radio").focus();
+        eventSender.keyDown(' ', new Array());
+    }
+
+</script>
+
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
index e6e5d65..33dffbd 100644 (file)
@@ -1,3 +1,17 @@
+2015-04-03  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: Toggling check box state not speaking using plain space, not VO space.
+        https://bugs.webkit.org/show_bug.cgi?id=143356
+
+        Reviewed by Darin Adler.
+
+        The checkbox state change needs to result in a value change being generated, otherwise accessibility won't know the value has changed through keyboard usage.
+  
+        Test: platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html
+
+        * accessibility/mac/AXObjectCacheMac.mm:
+        (WebCore::AXObjectCache::postPlatformNotification):
+
 2015-04-03  Zalan Bujtas  <zalan@apple.com>
 
         Simple line layout: Use pre-computed simple line runs to produce innerText content.
index 2c74430..b300e77 100644 (file)
@@ -105,6 +105,7 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
         case AXSelectedTextChanged:
             macNotification = NSAccessibilitySelectedTextChangedNotification;
             break;
+        case AXCheckedStateChanged:
         case AXValueChanged:
             macNotification = NSAccessibilityValueChangedNotification;
             break;
@@ -138,8 +139,6 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
         case AXMenuOpened:
             macNotification = (id)kAXMenuOpenedNotification;
             break;
-        case AXCheckedStateChanged:
-            // Does not exist on Mac.
         default:
             return;
     }