Changeset 222551 in webkit


Ignore:
Timestamp:
Sep 27, 2017 2:45:35 AM (7 years ago)
Author:
jdiggs@igalia.com
Message:

[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.

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.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r222546 r222551  
     12017-09-27  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [ATK] atk_table_cell_get_position() should return values of aria-rowindex and aria-colindex, if present
     4        https://bugs.webkit.org/show_bug.cgi?id=171176
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * accessibility/aria-table-attributes.html: Updated to reflect new behavior.
     9        * platform/gtk/accessibility/aria-table-attributes-expected.txt: Updated to reflect new behavior.
     10
    1112017-09-26  Zalan Bujtas  <zalan@apple.com>
    212
  • trunk/LayoutTests/accessibility/aria-table-attributes.html

    r222276 r222551  
    9898          shouldBe("cell4.numberAttributeValue('AXARIAColumnIndex')", "3");
    9999         
    100           // aria-colspan and aria-rowspan
    101           shouldBe("cell2.rowIndexRange()", "'{1, 2}'");
    102           shouldBe("cell5.columnIndexRange()", "'{2, 3}'");
    103           // aria-rowspan="0"
    104           shouldBe("cell3.rowIndexRange()", "'{1, 2}'");
     100          // aria-colspan and aria-rowspan, including aria-rowspan="0"
     101          if (accessibilityController.platformName == "atk") {
     102              // 0-based because these methods use the AtkTableCell interface
     103              shouldBe("cell2.rowIndexRange()", "'{7, 2}'");
     104              shouldBe("cell5.columnIndexRange()", "'{3, 3}'");
     105              shouldBe("cell3.rowIndexRange()", "'{7, 2}'");
     106          } else {
     107              shouldBe("cell2.rowIndexRange()", "'{1, 2}'");
     108              shouldBe("cell5.columnIndexRange()", "'{2, 3}'");
     109              shouldBe("cell3.rowIndexRange()", "'{1, 2}'");
     110          }
    105111          shouldBe("cell6.rowIndexRange()", "'{0, 2}'");
    106112          // use rowspan for native table
  • trunk/LayoutTests/platform/gtk/accessibility/aria-table-attributes-expected.txt

    r222276 r222551  
    1313PASS cell2.numberAttributeValue('AXARIARowIndex') is 8
    1414PASS cell4.numberAttributeValue('AXARIAColumnIndex') is 3
    15 PASS cell2.rowIndexRange() is '{1, 2}'
    16 PASS cell5.columnIndexRange() is '{2, 3}'
    17 PASS cell3.rowIndexRange() is '{1, 2}'
     15PASS cell2.rowIndexRange() is '{7, 2}'
     16PASS cell5.columnIndexRange() is '{3, 3}'
     17PASS cell3.rowIndexRange() is '{7, 2}'
    1818PASS cell6.rowIndexRange() is '{0, 2}'
    1919PASS cell7.rowIndexRange() is '{0, 2}'
  • trunk/Source/WebCore/ChangeLog

    r222550 r222551  
     12017-09-27  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [ATK] atk_table_cell_get_position() should return values of aria-rowindex and aria-colindex, if present
     4        https://bugs.webkit.org/show_bug.cgi?id=171176
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Modify webKitAccessibleTableCellGetPosition() to prefer the ARIA value
     9        over the DOM-based value.
     10
     11        No new tests needed: We have coverage through aria-table-attributes.html.
     12        Platform expectations for this test were updated.
     13
     14        * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
     15        (webkitAccessibleTableCellGetPosition):
     16
    1172017-09-27  Alicia Boya García  <aboya@igalia.com>
    218
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp

    r174898 r222551  
    120120    std::pair<unsigned, unsigned> columnRowRange;
    121121    if (row) {
    122         downcast<AccessibilityTableCell>(*axObject).rowIndexRange(columnRowRange);
    123         *row = columnRowRange.first;
     122        // aria-rowindex is 1-based.
     123        int rowIndex = downcast<AccessibilityTableCell>(*axObject).ariaRowIndex() - 1;
     124        if (rowIndex <= -1) {
     125            downcast<AccessibilityTableCell>(*axObject).rowIndexRange(columnRowRange);
     126            rowIndex = columnRowRange.first;
     127        }
     128        *row = rowIndex;
    124129    }
    125130    if (column) {
    126         downcast<AccessibilityTableCell>(*axObject).columnIndexRange(columnRowRange);
    127         *column = columnRowRange.first;
     131        // aria-colindex is 1-based.
     132        int columnIndex = downcast<AccessibilityTableCell>(*axObject).ariaColumnIndex() - 1;
     133        if (columnIndex <= -1) {
     134            downcast<AccessibilityTableCell>(*axObject).columnIndexRange(columnRowRange);
     135            columnIndex = columnRowRange.first;
     136        }
     137        *column = columnIndex;
    128138    }
    129139
Note: See TracChangeset for help on using the changeset viewer.