Source/WebCore:
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 15:02:46 +0000 (15:02 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Sep 2015 15:02:46 +0000 (15:02 +0000)
AX: No VoiceOver typing feedback in some search fields
https://bugs.webkit.org/show_bug.cgi?id=149177

Reviewed by Mario Sanchez Prada.

If SearchFieldRole is not marked as a TextControl, it does not end up returning the accessibilityValue,
which is needed to output the right text to VoiceOver.

Test: accessibility/ax-value-with-search.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isTextControl):

LayoutTests:
AX: No VO typing feedback in some text fields
https://bugs.webkit.org/show_bug.cgi?id=149177

Reviewed by Mario Sanchez Prada.

* accessibility/ax-value-with-search-expected.txt: Added.
* accessibility/ax-value-with-search.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/accessibility/ax-value-with-search-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/ax-value-with-search.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp

index 8a26793..3c8ae8c 100644 (file)
@@ -1,3 +1,13 @@
+2015-09-16  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: No VO typing feedback in some text fields
+        https://bugs.webkit.org/show_bug.cgi?id=149177
+
+        Reviewed by Mario Sanchez Prada.
+
+        * accessibility/ax-value-with-search-expected.txt: Added.
+        * accessibility/ax-value-with-search.html: Added.
+
 2015-09-16  Manuel Rego Casasnovas  <rego@igalia.com>
 
         [css-grid] Grid container's height should include scrollbar
diff --git a/LayoutTests/accessibility/ax-value-with-search-expected.txt b/LayoutTests/accessibility/ax-value-with-search-expected.txt
new file mode 100644 (file)
index 0000000..3d85488
--- /dev/null
@@ -0,0 +1,12 @@
+
+This tests that a search field is returns its accessibilityValue correctly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS search.stringValue is 'AXValue: hello'
+PASS search.stringValue is 'AXValue: test'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/ax-value-with-search.html b/LayoutTests/accessibility/ax-value-with-search.html
new file mode 100644 (file)
index 0000000..1f730a6
--- /dev/null
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<input type="search" value="hello" id="search">
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that a search field is returns its accessibilityValue correctly.");
+
+    if (window.accessibilityController) {
+
+        var search = accessibilityController.accessibleElementById("search");
+        shouldBe("search.stringValue", "'AXValue: hello'");
+        document.getElementById('search').value = 'test';
+        shouldBe("search.stringValue", "'AXValue: test'");
+    }
+
+</script>
+
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>
index 1634acd..2e784e3 100644 (file)
@@ -1,3 +1,18 @@
+2015-09-16  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: No VoiceOver typing feedback in some search fields
+        https://bugs.webkit.org/show_bug.cgi?id=149177
+
+        Reviewed by Mario Sanchez Prada.
+
+        If SearchFieldRole is not marked as a TextControl, it does not end up returning the accessibilityValue,
+        which is needed to output the right text to VoiceOver.
+
+        Test: accessibility/ax-value-with-search.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isTextControl):
+
 2015-09-16  Manuel Rego Casasnovas  <rego@igalia.com>
 
         [css-grid] Grid container's height should include scrollbar
index d696a0a..6a5c5d5 100644 (file)
@@ -376,9 +376,10 @@ bool AccessibilityObject::isBlockquote() const
 bool AccessibilityObject::isTextControl() const
 {
     switch (roleValue()) {
+    case ComboBoxRole:
+    case SearchFieldRole:
     case TextAreaRole:
     case TextFieldRole:
-    case ComboBoxRole:
         return true;
     default:
         return false;