Skip to content

Commit

Permalink
Merge r222551 - [ATK] atk_table_cell_get_position() should return val…
Browse files Browse the repository at this point in the history
…ues of aria-rowindex and aria-colindex, if present

https://bugs.webkit.org/show_bug.cgi?id=171176

Reviewed by Chris Fleizach.

Source/WebCore:

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):

LayoutTests:

* accessibility/aria-table-attributes.html: Updated to reflect new behavior.
* platform/gtk/accessibility/aria-table-attributes-expected.txt: Updated to reflect new behavior.
  • Loading branch information
joanmarie authored and carlosgcampos committed Oct 17, 2017
1 parent afb7640 commit 0ea9d6e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 12 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2017-09-27 Joanmarie Diggs <jdiggs@igalia.com>

[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 <jdiggs@igalia.com>

AX: Several ARIA roles with presentational children are exposing children
Expand Down
16 changes: 11 additions & 5 deletions LayoutTests/accessibility/aria-table-attributes.html
Expand Up @@ -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}'");
Expand Down
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
2017-09-27 Joanmarie Diggs <jdiggs@igalia.com>

[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 <jdiggs@igalia.com>

AX: Several ARIA roles with presentational children are exposing children
Expand Down
Expand Up @@ -119,12 +119,22 @@ gboolean webkitAccessibleTableCellGetPosition(AtkTableCell* cell, gint* row, gin

std::pair<unsigned, unsigned> columnRowRange;
if (row) {
downcast<AccessibilityTableCell>(*axObject).rowIndexRange(columnRowRange);
*row = columnRowRange.first;
// aria-rowindex is 1-based.
int rowIndex = downcast<AccessibilityTableCell>(*axObject).ariaRowIndex() - 1;
if (rowIndex <= -1) {
downcast<AccessibilityTableCell>(*axObject).rowIndexRange(columnRowRange);
rowIndex = columnRowRange.first;
}
*row = rowIndex;
}
if (column) {
downcast<AccessibilityTableCell>(*axObject).columnIndexRange(columnRowRange);
*column = columnRowRange.first;
// aria-colindex is 1-based.
int columnIndex = downcast<AccessibilityTableCell>(*axObject).ariaColumnIndex() - 1;
if (columnIndex <= -1) {
downcast<AccessibilityTableCell>(*axObject).columnIndexRange(columnRowRange);
columnIndex = columnRowRange.first;
}
*column = columnIndex;
}

return true;
Expand Down

0 comments on commit 0ea9d6e

Please sign in to comment.