AX: text editing not spoken by VO on web view contenteditable textbox
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jul 2010 16:24:52 +0000 (16:24 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jul 2010 16:24:52 +0000 (16:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=41912

Reviewed by Darin Adler.

WebCore:

Test: platform/mac/accessibility/selection-value-changes-for-aria-textbox.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::renderObjectIsObservable):

LayoutTests:

* platform/mac/accessibility/selection-value-changes-for-aria-textbox-expected.txt: Added.
* platform/mac/accessibility/selection-value-changes-for-aria-textbox.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/selection-value-changes-for-aria-textbox-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/selection-value-changes-for-aria-textbox.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/accessibility/AccessibilityRenderObject.cpp

index 56b0c9d..2361624 100644 (file)
@@ -1,3 +1,13 @@
+2010-07-09  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX:  text editing not spoken by VO on web view contenteditable textbox
+        https://bugs.webkit.org/show_bug.cgi?id=41912
+
+        * platform/mac/accessibility/selection-value-changes-for-aria-textbox-expected.txt: Added.
+        * platform/mac/accessibility/selection-value-changes-for-aria-textbox.html: Added.
+
 2010-07-09  Vitaly Repeshko  <vitalyr@chromium.org>
 
         Unreviewed.
diff --git a/LayoutTests/platform/mac/accessibility/selection-value-changes-for-aria-textbox-expected.txt b/LayoutTests/platform/mac/accessibility/selection-value-changes-for-aria-textbox-expected.txt
new file mode 100644 (file)
index 0000000..e3c5386
--- /dev/null
@@ -0,0 +1,17 @@
+ALERT: Successfully received AXSelectedTextChanged
+ALERT: Successfully received AXSelectedTextChanged
+ALERT: Successfully received AXSelectedTextChanged
+ALERT: Successfully received AXSelectedTextChanged
+ALERT: Successfully received AXSelectedTextChanged
+ALERT: Successfully received AXValueChanged
+conhello tent inside
+This tests that ARIA removing an element from a live region sends the correct notification.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS addedNotification is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/mac/accessibility/selection-value-changes-for-aria-textbox.html b/LayoutTests/platform/mac/accessibility/selection-value-changes-for-aria-textbox.html
new file mode 100644 (file)
index 0000000..b17cfd0
--- /dev/null
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<div role="textbox" tabindex=0 id="textbox" contenteditable=true>
+content inside
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that ARIA removing an element from a live region sends the correct notification.");
+
+    var axTextbox = 0;
+    function notificationCallback(notification) {
+        if (notification == "AXValueChanged") {
+           alert("Successfully received " + notification);
+           axTextbox.removeNotificationListener();
+           window.layoutTestController.notifyDone();
+        }
+        else if (notification == "AXSelectedTextChanged") {
+           alert("Successfully received " + notification);
+        }
+    }
+
+    if (window.accessibilityController) {
+        window.layoutTestController.waitUntilDone();
+
+        textbox = document.getElementById("textbox");
+        textbox.focus();
+
+        var axTextbox = accessibilityController.focusedElement;
+
+        // Trigger selection changes.
+        var s = window.getSelection();
+        s.setPosition(textbox, 0);
+        for (var k = 0; k < 3; k++) {
+            s.modify("move", "forward", "character");
+        }
+
+        // Trigger value change.
+        document.execCommand("InsertText", false, "hello ");
+
+        var addedNotification = axTextbox.addNotificationListener(notificationCallback);
+        shouldBe("addedNotification", "true");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index 39d555f..d476fa9 100644 (file)
@@ -1,3 +1,15 @@
+2010-07-09  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX:  text editing not spoken by VO on web view contenteditable textbox
+        https://bugs.webkit.org/show_bug.cgi?id=41912
+
+        Test: platform/mac/accessibility/selection-value-changes-for-aria-textbox.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::renderObjectIsObservable):
+
 2010-07-09  Michael Nordman  <michaeln@google.com>
 
         Reviewed by Dumitru Daniliuc.
index da09300..755ec21 100644 (file)
@@ -2914,7 +2914,13 @@ bool AccessibilityRenderObject::renderObjectIsObservable(RenderObject* renderer)
         return true;
     
     // AX clients will listen for AXSelectedChildrenChanged on listboxes.
-    if (renderer->isListBox() || axObjectCache()->nodeHasRole(renderer->node(), "listbox"))
+    AXObjectCache* cache = axObjectCache();
+    Node* node = renderer->node();
+    if (renderer->isListBox() || cache->nodeHasRole(node, "listbox"))
+        return true;
+    
+    // Textboxes should send out notifications.
+    if (cache->nodeHasRole(node, "textbox"))
         return true;
     
     return false;