AX: Expose ARIA Busy Notifications

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: http://svn.webkit.org/repository/webkit/trunk@156698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c726e7a6
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
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
<!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>
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.
......@@ -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)
......
......@@ -178,7 +178,8 @@ public:
AXRowExpanded,
AXInvalidStatusChanged,
AXTextChanged,
AXAriaAttributeChanged
AXAriaAttributeChanged,
AXElementBusyChanged
};
void postNotification(RenderObject*, AXNotification, PostTarget = TargetElement, PostType = PostAsynchronously);
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment