diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 9d2df8d09dc4..b89938f3c560 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2017-09-27 Joanmarie Diggs + + [ATK] atk_table_cell_get_position() should return values of aria-rowindex and aria-colindex, if present + https://bugs.webkit.org/show_bug.cgi?id=171176 + + Reviewed by Chris Fleizach. + + * accessibility/aria-table-attributes.html: Updated to reflect new behavior. + * platform/gtk/accessibility/aria-table-attributes-expected.txt: Updated to reflect new behavior. + 2017-09-26 Joanmarie Diggs AX: Several ARIA roles with presentational children are exposing children diff --git a/LayoutTests/accessibility/aria-table-attributes.html b/LayoutTests/accessibility/aria-table-attributes.html index ae56983f0299..95f07cf1009d 100644 --- a/LayoutTests/accessibility/aria-table-attributes.html +++ b/LayoutTests/accessibility/aria-table-attributes.html @@ -97,11 +97,17 @@ // aria-colindex from parent row shouldBe("cell4.numberAttributeValue('AXARIAColumnIndex')", "3"); - // aria-colspan and aria-rowspan - shouldBe("cell2.rowIndexRange()", "'{1, 2}'"); - shouldBe("cell5.columnIndexRange()", "'{2, 3}'"); - // aria-rowspan="0" - shouldBe("cell3.rowIndexRange()", "'{1, 2}'"); + // aria-colspan and aria-rowspan, including aria-rowspan="0" + if (accessibilityController.platformName == "atk") { + // 0-based because these methods use the AtkTableCell interface + shouldBe("cell2.rowIndexRange()", "'{7, 2}'"); + shouldBe("cell5.columnIndexRange()", "'{3, 3}'"); + shouldBe("cell3.rowIndexRange()", "'{7, 2}'"); + } else { + shouldBe("cell2.rowIndexRange()", "'{1, 2}'"); + shouldBe("cell5.columnIndexRange()", "'{2, 3}'"); + shouldBe("cell3.rowIndexRange()", "'{1, 2}'"); + } shouldBe("cell6.rowIndexRange()", "'{0, 2}'"); // use rowspan for native table shouldBe("cell7.rowIndexRange()", "'{0, 2}'"); diff --git a/LayoutTests/platform/gtk/accessibility/aria-table-attributes-expected.txt b/LayoutTests/platform/gtk/accessibility/aria-table-attributes-expected.txt index 95d49a169d3d..2cebb504be82 100644 --- a/LayoutTests/platform/gtk/accessibility/aria-table-attributes-expected.txt +++ b/LayoutTests/platform/gtk/accessibility/aria-table-attributes-expected.txt @@ -12,9 +12,9 @@ PASS cell1.numberAttributeValue('AXARIARowIndex') is 7 PASS cell2.numberAttributeValue('AXARIAColumnIndex') is 4 PASS cell2.numberAttributeValue('AXARIARowIndex') is 8 PASS cell4.numberAttributeValue('AXARIAColumnIndex') is 3 -PASS cell2.rowIndexRange() is '{1, 2}' -PASS cell5.columnIndexRange() is '{2, 3}' -PASS cell3.rowIndexRange() is '{1, 2}' +PASS cell2.rowIndexRange() is '{7, 2}' +PASS cell5.columnIndexRange() is '{3, 3}' +PASS cell3.rowIndexRange() is '{7, 2}' PASS cell6.rowIndexRange() is '{0, 2}' PASS cell7.rowIndexRange() is '{0, 2}' PASS successfullyParsed is true diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 1a1c2a34d50c..d9ba6ead2c96 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,19 @@ +2017-09-27 Joanmarie Diggs + + [ATK] atk_table_cell_get_position() should return values of aria-rowindex and aria-colindex, if present + https://bugs.webkit.org/show_bug.cgi?id=171176 + + Reviewed by Chris Fleizach. + + Modify webKitAccessibleTableCellGetPosition() to prefer the ARIA value + over the DOM-based value. + + No new tests needed: We have coverage through aria-table-attributes.html. + Platform expectations for this test were updated. + + * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp: + (webkitAccessibleTableCellGetPosition): + 2017-09-26 Joanmarie Diggs AX: Several ARIA roles with presentational children are exposing children diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp index 3d1e96211e94..1f096d1ddcb6 100644 --- a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp +++ b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp @@ -119,12 +119,22 @@ gboolean webkitAccessibleTableCellGetPosition(AtkTableCell* cell, gint* row, gin std::pair columnRowRange; if (row) { - downcast(*axObject).rowIndexRange(columnRowRange); - *row = columnRowRange.first; + // aria-rowindex is 1-based. + int rowIndex = downcast(*axObject).ariaRowIndex() - 1; + if (rowIndex <= -1) { + downcast(*axObject).rowIndexRange(columnRowRange); + rowIndex = columnRowRange.first; + } + *row = rowIndex; } if (column) { - downcast(*axObject).columnIndexRange(columnRowRange); - *column = columnRowRange.first; + // aria-colindex is 1-based. + int columnIndex = downcast(*axObject).ariaColumnIndex() - 1; + if (columnIndex <= -1) { + downcast(*axObject).columnIndexRange(columnRowRange); + columnIndex = columnRowRange.first; + } + *column = columnIndex; } return true;