diff options
author | Ben Murdoch <benm@google.com> | 2011-06-02 12:07:03 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-10 10:47:21 +0100 |
commit | 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch) | |
tree | e4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebCore/accessibility/AccessibilityARIAGrid.cpp | |
parent | 87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff) | |
download | external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2 |
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebCore/accessibility/AccessibilityARIAGrid.cpp')
-rw-r--r-- | Source/WebCore/accessibility/AccessibilityARIAGrid.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp b/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp index d51750a..5f9444a 100644 --- a/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp +++ b/Source/WebCore/accessibility/AccessibilityARIAGrid.cpp @@ -75,7 +75,14 @@ void AccessibilityARIAGrid::addChild(AccessibilityObject* child, HashSet<Accessi row->setRowIndex((int)m_rows.size()); m_rows.append(row); - m_children.append(row); + + // Try adding the row if it's not ignoring accessibility, + // otherwise add its children (the cells) as the grid's children. + if (!row->accessibilityIsIgnored()) + m_children.append(row); + else + m_children.append(row->children()); + appendedRows.add(row); } @@ -99,17 +106,21 @@ void AccessibilityARIAGrid::addChildren() unsigned columnCount = 0; for (RefPtr<AccessibilityObject> child = firstChild(); child; child = child->nextSibling()) { - // in case the render tree doesn't match the expected ARIA hierarchy, look at the children - if (child->accessibilityIsIgnored()) { + if (child->isTableRow() || child->ariaRoleAttribute() == RowRole) + addChild(child.get(), appendedRows, columnCount); + else { + // in case the render tree doesn't match the expected ARIA hierarchy, look at the children if (!child->hasChildren()) child->addChildren(); - - AccessibilityChildrenVector children = child->children(); - unsigned length = children.size(); - for (unsigned i = 0; i < length; ++i) - addChild(children[i].get(), appendedRows, columnCount); - } else - addChild(child.get(), appendedRows, columnCount); + + // 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); + } } // make the columns based on the number of columns in the first body |