Changeset 184198 in webkit


Ignore:
Timestamp:
May 12, 2015, 4:59:46 AM (10 years ago)
Author:
jdiggs@igalia.com
Message:

[GTK][WK2] rowAtIndex is not implemented in DRT/WKTR
https://bugs.webkit.org/show_bug.cgi?id=116971

Reviewed by Chris Fleizach.

Source/WebCore:

Because ATK lacks API to directly get an accessible row via its index,
the implementation of rowAtIndex gets a cell in the indexed row and
returns the parent row. The failing test continued to fail because
AccessibilityARIAGridCell::parentTable called parentObjectUnignored at
most twice, the second call in place to handle rows which are included
in the tree. However, given a well-formed ARIA grid with a rowgroup that
is interactive, that rowgroup also needs to be in the tree necessitating
parentObjectUnignored be called a third time to get to the grid. Given a
poorly-formed ARIA grid, there may additional objects which pass the test
for inclusion standing in between the cell and grid necessitating more
calls still. Therefore, ascend the hierarchy to find the parent grid.

No new tests. The failing test now passes.

  • accessibility/AccessibilityARIAGridCell.cpp:

(WebCore::AccessibilityARIAGridCell::parentTable):

Tools:

Implement rowAtIndex for ATK.

  • WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

(WTR::AccessibilityUIElement::rowAtIndex):

LayoutTests:

  • platform/gtk/TestExpectations: Removed previously-failing test.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r184161 r184198  
     12015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [GTK][WK2] rowAtIndex is not implemented in DRT/WKTR
     4        https://bugs.webkit.org/show_bug.cgi?id=116971
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * platform/gtk/TestExpectations: Removed previously-failing test.
     9
    1102015-05-12  Jinwoo Song  <jinwoo7.song@samsung.com>
    211
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r184102 r184198  
    15871587webkit.org/b/125506 accessibility/alt-tag-on-image-with-nonimage-role.html [ Failure ]
    15881588
    1589 webkit.org/b/116971 accessibility/poorly-formed-aria-table.html [ Failure ]
    1590 
    15911589# Blur and focus events are not received for the following tests.
    15921590Bug(GTK) fast/events/frame-tab-focus.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r184197 r184198  
     12015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [GTK][WK2] rowAtIndex is not implemented in DRT/WKTR
     4        https://bugs.webkit.org/show_bug.cgi?id=116971
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Because ATK lacks API to directly get an accessible row via its index,
     9        the implementation of rowAtIndex gets a cell in the indexed row and
     10        returns the parent row. The failing test continued to fail because
     11        AccessibilityARIAGridCell::parentTable called parentObjectUnignored at
     12        most twice, the second call in place to handle rows which are included
     13        in the tree. However, given a well-formed ARIA grid with a rowgroup that
     14        is interactive, that rowgroup also needs to be in the tree necessitating
     15        parentObjectUnignored be called a third time to get to the grid. Given a
     16        poorly-formed ARIA grid, there may additional objects which pass the test
     17        for inclusion standing in between the cell and grid necessitating more
     18        calls still. Therefore, ascend the hierarchy to find the parent grid.
     19
     20        No new tests. The failing test now passes.
     21
     22        * accessibility/AccessibilityARIAGridCell.cpp:
     23        (WebCore::AccessibilityARIAGridCell::parentTable):
     24
    1252015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
    226
  • trunk/Source/WebCore/accessibility/AccessibilityARIAGridCell.cpp

    r177733 r184198  
    5252AccessibilityTable* AccessibilityARIAGridCell::parentTable() const
    5353{
    54     AccessibilityObject* parent = parentObjectUnignored();
    55     if (!parent)
    56         return nullptr;
    57    
    58     if (is<AccessibilityTable>(*parent) && downcast<AccessibilityTable>(*parent).isExposableThroughAccessibility())
    59         return downcast<AccessibilityTable>(parent);
     54    // ARIA gridcells may have multiple levels of unignored ancestors that are not the parent table,
     55    // including rows and interactive rowgroups. In addition, poorly-formed grids may contain elements
     56    // which pass the tests for inclusion.
     57    for (AccessibilityObject* parent = parentObjectUnignored(); parent; parent = parent->parentObjectUnignored()) {
     58        if (is<AccessibilityTable>(*parent) && downcast<AccessibilityTable>(*parent).isExposableThroughAccessibility())
     59            return downcast<AccessibilityTable>(parent);
     60    }
    6061
    61     // It could happen that we hadn't reached the parent table yet (in
    62     // case objects for rows were not ignoring accessibility) so for
    63     // that reason we need to run parentObjectUnignored once again.
    64     parent = parent->parentObjectUnignored();
    65     if (!(is<AccessibilityTable>(parent) && downcast<AccessibilityTable>(*parent).isExposableThroughAccessibility()))
    66         return nullptr;
    67    
    68     return downcast<AccessibilityTable>(parent);
     62    return nullptr;
    6963}
    7064   
  • trunk/Tools/ChangeLog

    r184151 r184198  
     12015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [GTK][WK2] rowAtIndex is not implemented in DRT/WKTR
     4        https://bugs.webkit.org/show_bug.cgi?id=116971
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Implement rowAtIndex for ATK.
     9
     10        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
     11        (WTR::AccessibilityUIElement::rowAtIndex):
     12
    1132015-05-11  Dan Bernstein  <mitz@apple.com>
    214
  • trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp

    r183822 r184198  
    801801PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::rowAtIndex(unsigned index)
    802802{
    803     // FIXME: implement
     803    // ATK doesn't have API to get an accessible row by index directly. It does, however, have
     804    // API to get cells in the row specified by index. The parent of a cell should be the row.
     805    AtkTable* axTable = ATK_TABLE(m_element.get());
     806    unsigned nColumns = columnCount();
     807    for (unsigned col = 0; col < nColumns; col++) {
     808        // Find the first cell in this row that only spans one row.
     809        if (atk_table_get_row_extent_at(axTable, index, col) == 1) {
     810            AtkObject* cell = atk_table_ref_at(axTable, index, col);
     811            return cell ? AccessibilityUIElement::create(atk_object_get_parent(cell)) : nullptr;
     812        }
     813    }
     814
    804815    return nullptr;
    805816}
Note: See TracChangeset for help on using the changeset viewer.