haikuwebkit/LayoutTests/accessibility/table-with-hidden-head-sect...

31 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

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: Canonical link: https://commits.webkit.org/129759@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-03-05 07:13:46 +00:00
This tests that cellForRowAndColumn work as expected when cells are hidden in sections and rows.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Table1 has a hidden first row. Verify accessing cells works as expected.
PASS table1.rowCount is 2
PASS !table1cell1 || !table1cell1.isValid is true
PASS table1cell2.isEqual(accessibilityController.accessibleElementById('table1cell')) is true
PASS table1cell2.rowIndexRange() is '{1, 1}'
PASS table1cell2.columnIndexRange() is '{0, 1}'
Table2 has a hidden first section. Verify accessing cells works as expected.
PASS table2.rowCount is 2
PASS !table2cell1 || !table2cell1.isValid is true
PASS table2cell2.isEqual(accessibilityController.accessibleElementById('table2cell')) is true
PASS table2cell2.rowIndexRange() is '{1, 1}'
PASS table2cell2.columnIndexRange() is '{0, 1}'
Table3 only has a footer section.
PASS table3.rowCount is 3
PASS !table3cell1 || !table3cell1.isValid is true
PASS table3cell2.isEqual(accessibilityController.accessibleElementById('table3cell')) is true
PASS table3cell2.rowIndexRange() is '{2, 1}'
PASS table3cell2.columnIndexRange() is '{0, 1}'
PASS successfullyParsed is true
TEST COMPLETE