AX: cellForColumnAndRow fails for tables with hidden table cells
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 07:13:46 +0000 (07:13 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 07:13:46 +0000 (07:13 +0000)
commit5f5600c326129f107dce2d2a6ffc1018e27d4fe6
treeadd16ead94598bdc85fe04d899999c4d3d9be96b
parent1039f2024b8dc51dd462b009f16143fc4bde90e5
AX: cellForColumnAndRow fails for tables with hidden table cells
https://bugs.webkit.org/show_bug.cgi?id=110050

Reviewed by Tim Horton.

Source/WebCore:

If a table had hidden cells, then accessibility code was being confused in a few ways.
1) The cellForColumnAndRow method would return the wrong information since that was
   using the RenderTableSection to retrieve a cell, which did not have the same data as the AXTable
2) The way we were adding children made it impossible to determine column and row range because we
   would skip rows that had hidden children
3) AccessibilityARIAGrid and AccessibilityTable were using different methods for cellForColumnAndRow

The fix does a few things to make things right:
1) Always add an accessibility row, even if there are no visible cells in that row.
2) Have one method for AXTable and AXARIAGrid for cellForColumnAndRow.
3) Change cellForColumnAndRow to query the accessibility children rather than the RenderTableSection in determining the row, col info.
4) cellForColumnAndRow should use unsigned values instead of int values.

Test: accessibility/table-with-hidden-head-section.html

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore):
* accessibility/AccessibilityARIAGrid.h:
(AccessibilityARIAGrid):
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::rowIndexRange):
(WebCore::AccessibilityARIAGridCell::columnIndexRange):
* accessibility/AccessibilityARIAGridCell.h:
(AccessibilityARIAGridCell):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::cellForColumnAndRow):
* accessibility/AccessibilityTable.h:
(WebCore):
(AccessibilityTable):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::rowIndexRange):
(WebCore::AccessibilityTableCell::columnIndexRange):
* accessibility/AccessibilityTableCell.h:
(AccessibilityTableCell):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableGetColumnAtIndex):
(webkitAccessibleTableGetRowAtIndex):
(webkitAccessibleTableGetColumnExtentAt):
(webkitAccessibleTableGetRowExtentAt):
(webkitAccessibleTableGetColumnHeader):
(webkitAccessibleTableGetRowHeader):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* rendering/RenderTableSection.h:
(RenderTableSection):
(WebCore::RenderTableSection::rowRendererAt):

Source/WebKit/chromium:

* src/WebAccessibilityObject.cpp:
(WebKit::WebAccessibilityObject::cellColumnIndex):
(WebKit::WebAccessibilityObject::cellColumnSpan):
(WebKit::WebAccessibilityObject::cellRowIndex):
(WebKit::WebAccessibilityObject::cellRowSpan):

LayoutTests:

* accessibility/table-with-hidden-head-section-expected.txt: Added.
* accessibility/table-with-hidden-head-section.html: Added.
* platform/chromium/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/table-with-hidden-head-section-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/table-with-hidden-head-section.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityARIAGrid.cpp
Source/WebCore/accessibility/AccessibilityARIAGrid.h
Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp
Source/WebCore/accessibility/AccessibilityARIAGridCell.h
Source/WebCore/accessibility/AccessibilityTable.cpp
Source/WebCore/accessibility/AccessibilityTable.h
Source/WebCore/accessibility/AccessibilityTableCell.cpp
Source/WebCore/accessibility/AccessibilityTableCell.h
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/rendering/RenderTableSection.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebAccessibilityObject.cpp