Title: [88830] trunk
Revision
88830
Author
[email protected]
Date
2011-06-14 11:20:28 -0700 (Tue, 14 Jun 2011)

Log Message

Source/WebCore: VoiceOver cannot navigate the iTunes album view table
https://bugs.webkit.org/show_bug.cgi?id=62335

Reviewed by David Kilzer.

This is a regression from https://bugs.webkit.org/show_bug.cgi?id=57463.
Part of that patch made a change so that an ARIA table will only look at it's children and grandchildren
for possible rows. That however, doesn't allow arbitrary hierarchies to work with ARIA, like in iTunes album view.

Test: platform/mac/accessibility/aria-grid-with-strange-hierarchy.html

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addChild):
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityARIAGrid.h:

LayoutTests: VoiceOver cannot navigate the itunes album view table
https://bugs.webkit.org/show_bug.cgi?id=62335

Reviewed by David Kilzer.

* platform/mac/accessibility/aria-grid-with-strange-hierarchy-expected.txt: Added.
* platform/mac/accessibility/aria-grid-with-strange-hierarchy.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (88829 => 88830)


--- trunk/LayoutTests/ChangeLog	2011-06-14 18:17:21 UTC (rev 88829)
+++ trunk/LayoutTests/ChangeLog	2011-06-14 18:20:28 UTC (rev 88830)
@@ -1,3 +1,13 @@
+2011-06-14  Chris Fleizach  <[email protected]>
+
+        Reviewed by David Kilzer.
+
+        VoiceOver cannot navigate the itunes album view table
+        https://bugs.webkit.org/show_bug.cgi?id=62335
+
+        * platform/mac/accessibility/aria-grid-with-strange-hierarchy-expected.txt: Added.
+        * platform/mac/accessibility/aria-grid-with-strange-hierarchy.html: Added.
+
 2011-06-13  Adrienne Walker  <[email protected]>
 
         Reviewed by James Robinson.

Added: trunk/LayoutTests/platform/mac/accessibility/aria-grid-with-strange-hierarchy-expected.txt (0 => 88830)


--- trunk/LayoutTests/platform/mac/accessibility/aria-grid-with-strange-hierarchy-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-grid-with-strange-hierarchy-expected.txt	2011-06-14 18:20:28 UTC (rev 88830)
@@ -0,0 +1,19 @@
+ 	Name	Time	Popularity	 Price
+1	Test	Test	Test
+This tests that an ARIA grid with a hierarchy that ignores render elements in between will still expose the correct elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS grid.childrenCount is 6
+PASS grid.childAtIndex(0).role is 'AXRole: AXRow'
+PASS grid.childAtIndex(1).role is 'AXRole: AXColumn'
+PASS grid.childAtIndex(0).childrenCount is 4
+PASS grid.childAtIndex(0).childAtIndex(0).role is 'AXRole: AXCell'
+PASS grid.childAtIndex(0).childAtIndex(0).role is 'AXRole: AXCell'
+PASS grid.childAtIndex(0).childAtIndex(0).childAtIndex(0).role is 'AXRole: AXStaticText'
+PASS grid.childAtIndex(0).childAtIndex(0).childAtIndex(0).stringValue is 'AXValue: 1'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/aria-grid-with-strange-hierarchy.html (0 => 88830)


--- trunk/LayoutTests/platform/mac/accessibility/aria-grid-with-strange-hierarchy.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/aria-grid-with-strange-hierarchy.html	2011-06-14 18:20:28 UTC (rev 88830)
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script>
+var successfullyParsed = false;
+</script>
+<script src=""
+</head>
+<body id="body">
+
+<div tabindex=0 id="grid" role="grid" aria-readonly="true">
+<div  role="presentation">
+  <table role="presentation">
+          <thead>
+            <tr>
+                 <th role="columnheader" aria-sort="ascending">&nbsp;</th>
+                 <th role="columnheader">Name</th>
+                 <th role="columnheader">Time</th>
+                 <th role="columnheader">Popularity</th>
+                 <th role="columnheader"> Price</th>
+            </tr>
+          </thead>
+     
+    <tbody>
+    <tr role="row">
+        <td role="gridcell">
+          <span class="index"><span>1</span></span>
+        </td>
+        <td role="gridcell"">
+          <span><span>Test</span></span>
+        </td>
+        <td role="gridcell"">
+          <span><span>Test</span></span>
+        </td>
+        <td role="gridcell"">
+          <span><span>Test</span></span>
+        </td>
+    </tr>   
+</table></div></div>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that an ARIA grid with a hierarchy that ignores render elements in between will still expose the correct elements.");
+
+    if (window.accessibilityController) {
+
+          // this text field should be required.
+          document.getElementById("grid").focus();
+          var grid = accessibilityController.focusedElement;
+
+          shouldBe("grid.childrenCount", "6");
+          shouldBe("grid.childAtIndex(0).role", "'AXRole: AXRow'");
+          shouldBe("grid.childAtIndex(1).role", "'AXRole: AXColumn'");
+
+          shouldBe("grid.childAtIndex(0).childrenCount", "4");
+          shouldBe("grid.childAtIndex(0).childAtIndex(0).role", "'AXRole: AXCell'");
+
+          shouldBe("grid.childAtIndex(0).childAtIndex(0).role", "'AXRole: AXCell'");
+          shouldBe("grid.childAtIndex(0).childAtIndex(0).childAtIndex(0).role", "'AXRole: AXStaticText'");
+          shouldBe("grid.childAtIndex(0).childAtIndex(0).childAtIndex(0).stringValue", "'AXValue: 1'");
+
+    }
+    successfullyParsed = true;
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (88829 => 88830)


--- trunk/Source/WebCore/ChangeLog	2011-06-14 18:17:21 UTC (rev 88829)
+++ trunk/Source/WebCore/ChangeLog	2011-06-14 18:20:28 UTC (rev 88830)
@@ -1,3 +1,21 @@
+2011-06-14  Chris Fleizach  <[email protected]>
+
+        Reviewed by David Kilzer.
+
+        VoiceOver cannot navigate the iTunes album view table
+        https://bugs.webkit.org/show_bug.cgi?id=62335
+
+        This is a regression from https://bugs.webkit.org/show_bug.cgi?id=57463.
+        Part of that patch made a change so that an ARIA table will only look at it's children and grandchildren
+        for possible rows. That however, doesn't allow arbitrary hierarchies to work with ARIA, like in iTunes album view.
+
+        Test: platform/mac/accessibility/aria-grid-with-strange-hierarchy.html
+
+        * accessibility/AccessibilityARIAGrid.cpp:
+        (WebCore::AccessibilityARIAGrid::addChild):
+        (WebCore::AccessibilityARIAGrid::addChildren):
+        * accessibility/AccessibilityARIAGrid.h:
+
 2011-06-14  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r88823.

Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp (88829 => 88830)


--- trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp	2011-06-14 18:17:21 UTC (rev 88829)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp	2011-06-14 18:20:28 UTC (rev 88830)
@@ -59,14 +59,14 @@
     return adoptRef(new AccessibilityARIAGrid(renderer));
 }
 
-void AccessibilityARIAGrid::addChild(AccessibilityObject* child, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount)
+bool AccessibilityARIAGrid::addChild(AccessibilityObject* child, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount)
 {
     if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole)
-        return;
+        return false;
         
     AccessibilityTableRow* row = static_cast<AccessibilityTableRow*>(child);
     if (appendedRows.contains(row))
-        return;
+        return false;
         
     // store the maximum number of columns
     unsigned rowCellCount = row->children().size();
@@ -84,6 +84,7 @@
         m_children.append(row->children());
 
     appendedRows.add(row);
+    return true;
 }
     
 void AccessibilityARIAGrid::addChildren()
@@ -106,20 +107,18 @@
     unsigned columnCount = 0;
     for (RefPtr<AccessibilityObject> child = firstChild(); child; child = child->nextSibling()) {
 
-        if (child->isTableRow() || child->ariaRoleAttribute() == RowRole)
-            addChild(child.get(), appendedRows, columnCount);
-        else {
+        if (!addChild(child.get(), appendedRows, columnCount)) {
+            
             // in case the render tree doesn't match the expected ARIA hierarchy, look at the children
             if (!child->hasChildren())
                 child->addChildren();
 
-            // Do not navigate children through the Accessibility
-            // children vector to let addChild() check the result
-            // of accessibilityIsIgnored() and make the proper
-            // decision (add the objects or their children).
-            AccessibilityObject* grandChild = 0;
-            for (grandChild = child->firstChild(); grandChild; grandChild = grandChild->nextSibling())
-                addChild(grandChild, appendedRows, columnCount);
+            // The children of this non-row will contain all non-ignored elements (recursing to find them). 
+            // This allows the table to dive arbitrarily deep to find the rows.
+            AccessibilityChildrenVector children = child->children();
+            size_t length = children.size();
+            for (size_t i = 0; i < length; ++i)
+                addChild(children[i].get(), appendedRows, columnCount);
         }
     }
     

Modified: trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.h (88829 => 88830)


--- trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.h	2011-06-14 18:17:21 UTC (rev 88829)
+++ trunk/Source/WebCore/accessibility/AccessibilityARIAGrid.h	2011-06-14 18:20:28 UTC (rev 88830)
@@ -55,7 +55,7 @@
     // ARIA treegrids and grids support selected rows.
     virtual bool supportsSelectedRows() { return true; }    
 
-    void addChild(AccessibilityObject*, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount);
+    bool addChild(AccessibilityObject*, HashSet<AccessibilityObject*>& appendedRows, unsigned& columnCount);
 };
 
 } // namespace WebCore 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to