AX: Expose ARIA Busy Notifications
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2013 05:58:10 +0000 (05:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Oct 2013 05:58:10 +0000 (05:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121451

Patch by Sam White <samuel_white@apple.com> on 2013-09-30
Reviewed by Chris Fleizach.

Source/WebCore:

Added AXElementBusyChanged notification that posts when aria-busy is toggled. This
enables screen readers to detect busy states without polling the focused element.

Test: platform/mac/accessibility/element-busy-changed.html

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

LayoutTests:

Added test to verify that elements post AXElementBusyChanged notifications when aria-busy is toggled.

* platform/mac/accessibility/element-busy-changed-expected.txt: Added.
* platform/mac/accessibility/element-busy-changed.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/element-busy-changed-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/element-busy-changed.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AXObjectCache.h
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm

index e3f0cca2e1087704247be0d49143f9b351e65079..497850f2801c5ecc08086f5c032da11d62a2fc05 100644 (file)
@@ -1,3 +1,15 @@
+2013-09-30  Sam White  <samuel_white@apple.com>
+
+        AX: Expose ARIA Busy Notifications
+        https://bugs.webkit.org/show_bug.cgi?id=121451
+
+        Reviewed by Chris Fleizach.
+
+        Added test to verify that elements post AXElementBusyChanged notifications when aria-busy is toggled.
+
+        * platform/mac/accessibility/element-busy-changed-expected.txt: Added.
+        * platform/mac/accessibility/element-busy-changed.html: Added.
+
 2013-09-30  Sam Weinig  <sam@webkit.org>
 
         Remove support for DOMFileSystem
diff --git a/LayoutTests/platform/mac/accessibility/element-busy-changed-expected.txt b/LayoutTests/platform/mac/accessibility/element-busy-changed-expected.txt
new file mode 100644 (file)
index 0000000..d02ea56
--- /dev/null
@@ -0,0 +1,11 @@
+This tests that AXElementBusyChanged is posted correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Received AXElementBusyChanged notification 1 of 2
+Received AXElementBusyChanged notification 2 of 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/element-busy-changed.html b/LayoutTests/platform/mac/accessibility/element-busy-changed.html
new file mode 100644 (file)
index 0000000..9239d82
--- /dev/null
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test-pre.js"></script>
+<title>Element Busy Changed</title>
+</head>
+<!-- Busy state begins false. -->
+<body aria-busy="false" id="body">
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that AXElementBusyChanged is posted correctly.");
+    
+    window.jsTestIsAsync = true;
+    
+    var body = 0;
+    var notificationCount = 0;
+    
+    if (window.accessibilityController) {
+        body = accessibilityController.accessibleElementById("body");
+        body.addNotificationListener(function(notification) {
+            debug("Received " + notification + " notification " + ++notificationCount + " of 2");
+            
+            if (notificationCount == 2) {
+                body.removeNotificationListener();
+                
+                finishJSTest();
+            }
+        });
+        
+        // Toggle through both busy state transitions.
+        var busyElement = document.getElementById("body");
+        busyElement.setAttribute("aria-busy", "true");
+        busyElement.setAttribute("aria-busy", "false");
+    }
+</script>
+
+<script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
index 17135bb259b6073108c33f7d7f907a7c5c877689..aa761532b311ff715e1f75755b8064eda0393c5c 100644 (file)
@@ -1,3 +1,21 @@
+2013-09-30  Sam White  <samuel_white@apple.com>
+
+        AX: Expose ARIA Busy Notifications
+        https://bugs.webkit.org/show_bug.cgi?id=121451
+
+        Reviewed by Chris Fleizach.
+
+        Added AXElementBusyChanged notification that posts when aria-busy is toggled. This
+        enables screen readers to detect busy states without polling the focused element.
+
+        Test: platform/mac/accessibility/element-busy-changed.html
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::handleAttributeChanged):
+        * accessibility/AXObjectCache.h:
+        * accessibility/mac/AXObjectCacheMac.mm:
+        (WebCore::AXObjectCache::postPlatformNotification):
+
 2013-09-30  Sam Weinig  <sam@webkit.org>
 
         Fixing the build.
index 2cff72927c438f5b49becb9bd182981875eeb758..89e6f4e8307eafd6e612ef387e10c601d042895d 100644 (file)
@@ -830,6 +830,8 @@ void AXObjectCache::handleAttributeChanged(const QualifiedName& attrName, Elemen
 
     if (attrName == aria_activedescendantAttr)
         handleActiveDescendantChanged(element);
+    else if (attrName == aria_busyAttr)
+        postNotification(element, AXObjectCache::AXElementBusyChanged);
     else if (attrName == aria_valuenowAttr || attrName == aria_valuetextAttr)
         postNotification(element, AXObjectCache::AXValueChanged);
     else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || attrName == aria_labelledbyAttr)
index 9a31e6228cde30969baf66d889391bcfb0dd1c34..970b1ce9d6276b9245fc8b8d6e266a375c9e1a2a 100644 (file)
@@ -178,7 +178,8 @@ public:
         AXRowExpanded,
         AXInvalidStatusChanged,
         AXTextChanged,
-        AXAriaAttributeChanged
+        AXAriaAttributeChanged,
+        AXElementBusyChanged
     };
 
     void postNotification(RenderObject*, AXNotification, PostTarget = TargetElement, PostType = PostAsynchronously);
index 58870836c07d76429e1445030aa530d54e0cf7da..9aa07fc5073dd78086e581dc0ee05a77e6af9182 100644 (file)
@@ -115,8 +115,11 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
         case AXRowCollapsed:
             macNotification = NSAccessibilityRowCollapsedNotification;
             break;
-            // Does not exist on Mac.
+        case AXElementBusyChanged:
+            macNotification = @"AXElementBusyChanged";
+            break;
         case AXCheckedStateChanged:
+            // Does not exist on Mac.
         default:
             return;
     }