Title: [195457] trunk
Revision
195457
Author
[email protected]
Date
2016-01-22 10:11:51 -0800 (Fri, 22 Jan 2016)

Log Message

AX: ARIA combo boxes are not returning the right value for selected text range
https://bugs.webkit.org/show_bug.cgi?id=153260

Reviewed by Darin Adler.

Source/WebCore:

Just because an element has an ARIA role doesn't mean we should always use the selected text range of the whole document.
If the element is also a text based ARIA control, we can still use the element's inner text range to return the right value.

Test: accessibility/selected-text-range-aria-elements.html

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

LayoutTests:

* accessibility/selected-text-range-aria-elements-expected.txt: Added.
* accessibility/selected-text-range-aria-elements.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195456 => 195457)


--- trunk/LayoutTests/ChangeLog	2016-01-22 18:07:58 UTC (rev 195456)
+++ trunk/LayoutTests/ChangeLog	2016-01-22 18:11:51 UTC (rev 195457)
@@ -1,3 +1,13 @@
+2016-01-22  Chris Fleizach  <[email protected]>
+
+        AX: ARIA combo boxes are not returning the right value for selected text range
+        https://bugs.webkit.org/show_bug.cgi?id=153260
+
+        Reviewed by Darin Adler.
+
+        * accessibility/selected-text-range-aria-elements-expected.txt: Added.
+        * accessibility/selected-text-range-aria-elements.html: Added.
+
 2016-01-21  Dave Hyatt  <[email protected]>
 
         Elements with overflow and border-radius don't show in multicolumn properly.

Added: trunk/LayoutTests/accessibility/selected-text-range-aria-elements-expected.txt (0 => 195457)


--- trunk/LayoutTests/accessibility/selected-text-range-aria-elements-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/selected-text-range-aria-elements-expected.txt	2016-01-22 18:11:51 UTC (rev 195457)
@@ -0,0 +1,11 @@
+
+This test makes sure that a native text control with a text-like ARIA value returns selectedTextRange
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Text range: {4, 2}
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/selected-text-range-aria-elements.html (0 => 195457)


--- trunk/LayoutTests/accessibility/selected-text-range-aria-elements.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/selected-text-range-aria-elements.html	2016-01-22 18:11:51 UTC (rev 195457)
@@ -0,0 +1,29 @@
+<html>
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+    <input id="combo" type="text" role="combobox" value="Hello World"> 
+    
+    <p id="description"></p>
+    <div id="console"></div>
+     
+    <script>
+ 
+        var node = document.getElementById("combo");
+        node.focus();
+        node.setSelectionRange(4, 6); 
+
+        if (window.accessibilityController) {
+            description("This test makes sure that a native text control with a text-like ARIA value returns selectedTextRange");
+
+            var element = accessibilityController.accessibleElementById("combo");
+            debug("Text range: " + element.selectedTextRange);
+        }
+    </script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (195456 => 195457)


--- trunk/Source/WebCore/ChangeLog	2016-01-22 18:07:58 UTC (rev 195456)
+++ trunk/Source/WebCore/ChangeLog	2016-01-22 18:11:51 UTC (rev 195457)
@@ -1,3 +1,18 @@
+2016-01-22  Chris Fleizach  <[email protected]>
+
+        AX: ARIA combo boxes are not returning the right value for selected text range
+        https://bugs.webkit.org/show_bug.cgi?id=153260
+
+        Reviewed by Darin Adler.
+
+        Just because an element has an ARIA role doesn't mean we should always use the selected text range of the whole document.
+        If the element is also a text based ARIA control, we can still use the element's inner text range to return the right value.
+
+        Test: accessibility/selected-text-range-aria-elements.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::selectedTextRange):
+
 2016-01-22  Chris Dumez  <[email protected]>
 
         Unreviewed iOS build fix after r195452.

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (195456 => 195457)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-01-22 18:07:58 UTC (rev 195456)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-01-22 18:11:51 UTC (rev 195457)
@@ -1493,7 +1493,8 @@
         return PlainTextRange();
     
     AccessibilityRole ariaRole = ariaRoleAttribute();
-    if (isNativeTextControl() && ariaRole == UnknownRole) {
+    // Use the text control native range if it's a native object and it has no ARIA role (or has a text based ARIA role).
+    if (isNativeTextControl() && (ariaRole == UnknownRole || isARIATextControl())) {
         HTMLTextFormControlElement& textControl = downcast<RenderTextControl>(*m_renderer).textFormControlElement();
         return PlainTextRange(textControl.selectionStart(), textControl.selectionEnd() - textControl.selectionStart());
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to