Title: [183111] trunk
Revision
183111
Author
[email protected]
Date
2015-04-22 10:36:44 -0700 (Wed, 22 Apr 2015)

Log Message

AX: WebKit does not expose text fields inside tree views.
https://bugs.webkit.org/show_bug.cgi?id=142196

Patch by Nan Wang <[email protected]> on 2015-04-22
Reviewed by Chris Fleizach.

Source/WebCore:

The problem is that any object in a tree which is not a static text
or treeitem will be ignored. Fixed it by exposing the children of treeitem.

Test: accessibility/treeitem-child-exposed.html

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

LayoutTests:

Tests for treeitem’s children’s accessibility.
Also fixed the search predicate test for treeitem,
the static text is the second child of treeitem and
list marker is the first child.

* accessibility/treeitem-child-exposed-expected.txt: Added.
* accessibility/treeitem-child-exposed.html: Added.
* platform/mac/accessibility/search-predicate-expected.txt:
* platform/mac/accessibility/search-predicate.html:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (183110 => 183111)


--- trunk/LayoutTests/ChangeLog	2015-04-22 17:29:15 UTC (rev 183110)
+++ trunk/LayoutTests/ChangeLog	2015-04-22 17:36:44 UTC (rev 183111)
@@ -1,3 +1,20 @@
+2015-04-22  Nan Wang  <[email protected]>
+
+        AX: WebKit does not expose text fields inside tree views.
+        https://bugs.webkit.org/show_bug.cgi?id=142196
+
+        Reviewed by Chris Fleizach.
+
+        Tests for treeitem’s children’s accessibility.
+        Also fixed the search predicate test for treeitem,
+        the static text is the second child of treeitem and
+        list marker is the first child.
+
+        * accessibility/treeitem-child-exposed-expected.txt: Added.
+        * accessibility/treeitem-child-exposed.html: Added.
+        * platform/mac/accessibility/search-predicate-expected.txt:
+        * platform/mac/accessibility/search-predicate.html:
+
 2015-04-22  Xabier Rodriguez Calvar  <[email protected]> and Youenn Fablet  <[email protected]>
 
         [Streams API] Implement ReadableStreamController

Added: trunk/LayoutTests/accessibility/treeitem-child-exposed-expected.txt (0 => 183111)


--- trunk/LayoutTests/accessibility/treeitem-child-exposed-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/treeitem-child-exposed-expected.txt	2015-04-22 17:36:44 UTC (rev 183111)
@@ -0,0 +1,15 @@
+
+
+ 
+This tests if a treeitem contains an element other than static text, it should be exposed
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS tree.childrenCount is 2
+PASS inputField.isValid is true
+PASS inputField3.isValid is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/treeitem-child-exposed.html (0 => 183111)


--- trunk/LayoutTests/accessibility/treeitem-child-exposed.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/treeitem-child-exposed.html	2015-04-22 17:36:44 UTC (rev 183111)
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div role="tree" id="tree">
+   <div role="treeitem" id="item1">
+      <input id="input1" /input>
+   </div>
+   <input id="input2" /input>
+   <div role="treeitem" id="item2">
+      <row>
+         <input id="input3" /input>
+      </row>
+   </div>
+</div>
+
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests if a treeitem contains an element other than static text, it should be exposed");
+
+    if (window.accessibilityController) {
+    	// tree should only have 2 child, since only treeitem or static text can be a tree's child
+        var tree = accessibilityController.accessibleElementById("tree");
+        shouldBe("tree.childrenCount", "2");
+        
+        // input filed in treeitem1 should be exposed
+        var inputField = accessibilityController.accessibleElementById("input1");
+        shouldBeTrue("inputField.isValid");
+        
+        // treeitem's children should be exposed, eg. the input field in treeitem2
+        var inputField3 = accessibilityController.accessibleElementById("input3");
+        shouldBeTrue("inputField3.isValid");
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>
+

Modified: trunk/LayoutTests/platform/mac/accessibility/search-predicate-expected.txt (183110 => 183111)


--- trunk/LayoutTests/platform/mac/accessibility/search-predicate-expected.txt	2015-04-22 17:29:15 UTC (rev 183110)
+++ trunk/LayoutTests/platform/mac/accessibility/search-predicate-expected.txt	2015-04-22 17:36:44 UTC (rev 183111)
@@ -97,7 +97,7 @@
 PASS resultElement.role is 'AXRole: AXGroup'
 PASS resultElement.stringAttributeValue('AXARIALive') is 'polite'
 PASS resultElement.role is 'AXRole: AXOutline'
-PASS resultElement.childAtIndex(0).childAtIndex(0).stringValue is 'AXValue: tree item'
+PASS resultElement.childAtIndex(0).childAtIndex(1).stringValue is 'AXValue: tree item'
 PASS resultElement.role is 'AXRole: AXStaticText'
 PASS resultElement.stringValue is 'AXValue: first blockquote level 1'
 PASS resultElement.role is 'AXRole: AXRadioGroup'

Modified: trunk/LayoutTests/platform/mac/accessibility/search-predicate.html (183110 => 183111)


--- trunk/LayoutTests/platform/mac/accessibility/search-predicate.html	2015-04-22 17:29:15 UTC (rev 183110)
+++ trunk/LayoutTests/platform/mac/accessibility/search-predicate.html	2015-04-22 17:36:44 UTC (rev 183111)
@@ -215,7 +215,7 @@
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         resultElement = containerElement.uiElementForSearchPredicate(startElement, true, "AXOutlineSearchKey", "", false);
         shouldBe("resultElement.role", "'AXRole: AXOutline'");
-        shouldBe("resultElement.childAtIndex(0).childAtIndex(0).stringValue", "'AXValue: tree item'");
+        shouldBe("resultElement.childAtIndex(0).childAtIndex(1).stringValue", "'AXValue: tree item'");
         
         // Plain text.
         startElement = accessibilityController.focusedElement.childAtIndex(0);

Modified: trunk/Source/WebCore/ChangeLog (183110 => 183111)


--- trunk/Source/WebCore/ChangeLog	2015-04-22 17:29:15 UTC (rev 183110)
+++ trunk/Source/WebCore/ChangeLog	2015-04-22 17:36:44 UTC (rev 183111)
@@ -1,3 +1,18 @@
+2015-04-22  Nan Wang  <[email protected]>
+
+        AX: WebKit does not expose text fields inside tree views.
+        https://bugs.webkit.org/show_bug.cgi?id=142196
+
+        Reviewed by Chris Fleizach.
+
+        The problem is that any object in a tree which is not a static text 
+        or treeitem will be ignored. Fixed it by exposing the children of treeitem.
+
+        Test: accessibility/treeitem-child-exposed.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::isAllowedChildOfTree):
+
 2015-04-22  Xabier Rodriguez Calvar  <[email protected]> and Youenn Fablet  <[email protected]>
 
         [Streams API] Implement ReadableStreamController

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (183110 => 183111)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2015-04-22 17:29:15 UTC (rev 183110)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2015-04-22 17:36:44 UTC (rev 183111)
@@ -1111,7 +1111,10 @@
     // Determine if this is in a tree. If so, we apply special behavior to make it work like an AXOutline.
     AccessibilityObject* axObj = parentObject();
     bool isInTree = false;
+    bool isTreeItemDescendant = false;
     while (axObj) {
+        if (axObj->roleValue() == TreeItemRole)
+            isTreeItemDescendant = true;
         if (axObj->isTree()) {
             isInTree = true;
             break;
@@ -1122,7 +1125,7 @@
     // If the object is in a tree, only tree items should be exposed (and the children of tree items).
     if (isInTree) {
         AccessibilityRole role = roleValue();
-        if (role != TreeItemRole && role != StaticTextRole)
+        if (role != TreeItemRole && role != StaticTextRole && !isTreeItemDescendant)
             return false;
     }
     return true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to