Changeset 50339 in webkit


Ignore:
Timestamp:
Oct 30, 2009 10:19:40 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-10-30 Joanmarie Diggs <joanmarie.diggs@gmail.com>

Reviewed by Xan Lopez.

https://bugs.webkit.org/show_bug.cgi?id=25534
[GTK] Objects of ROLE_TABLE should implement the accessible table interface

Second part of the implementation of AtkTable.

  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (cellAtIndex): (webkit_accessible_table_get_column_at_index): (webkit_accessible_table_get_row_at_index): (webkit_accessible_table_get_caption): (atk_table_interface_init):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r50337 r50339  
     12009-10-30  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
     2
     3        Reviewed by Xan Lopez.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=25534
     6        [GTK] Objects of ROLE_TABLE should implement the accessible table interface
     7
     8        Second part of the implementation of AtkTable.
     9
     10        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     11        (cellAtIndex):
     12        (webkit_accessible_table_get_column_at_index):
     13        (webkit_accessible_table_get_row_at_index):
     14        (webkit_accessible_table_get_caption):
     15        (atk_table_interface_init):
     16
    1172009-10-30  Pavel Feldman  <pfeldman@chromium.org>
    218
  • trunk/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r50282 r50339  
    12391239}
    12401240
     1241static AccessibilityTableCell* cellAtIndex(AtkTable* table, gint index)
     1242{
     1243    AccessibilityObject* accTable = core(table);
     1244    if (accTable->isAccessibilityRenderObject()) {
     1245        AccessibilityObject::AccessibilityChildrenVector allCells;
     1246        static_cast<AccessibilityTable*>(accTable)->cells(allCells);
     1247        if (0 <= index && static_cast<unsigned>(index) < allCells.size()) {
     1248            AccessibilityObject* accCell = allCells.at(index).get();
     1249            return static_cast<AccessibilityTableCell*>(accCell);
     1250        }
     1251    }
     1252    return 0;
     1253}
     1254
    12411255static AtkObject* webkit_accessible_table_ref_at(AtkTable* table, gint row, gint column)
    12421256{
     
    12521266    AccessibilityTable* AXTable = static_cast<AccessibilityTable*>(core(table));
    12531267    return cellIndex(AXCell, AXTable);
     1268}
     1269
     1270static gint webkit_accessible_table_get_column_at_index(AtkTable* table, gint index)
     1271{
     1272    AccessibilityTableCell* axCell = cellAtIndex(table, index);
     1273    if (axCell){
     1274        pair<int, int> columnRange;
     1275        axCell->columnIndexRange(columnRange);
     1276        return columnRange.first;
     1277    }
     1278    return -1;
     1279}
     1280
     1281static gint webkit_accessible_table_get_row_at_index(AtkTable* table, gint index)
     1282{
     1283    AccessibilityTableCell* axCell = cellAtIndex(table, index);
     1284    if (axCell){
     1285        pair<int, int> rowRange;
     1286        axCell->rowIndexRange(rowRange);
     1287        return rowRange.first;
     1288    }
     1289    return -1;
    12541290}
    12551291
     
    13091345}
    13101346
     1347static AtkObject* webkit_accessible_table_get_caption(AtkTable* table)
     1348{
     1349    AccessibilityObject* accTable = core(table);
     1350    if (accTable->isAccessibilityRenderObject()) {
     1351        Node* node = static_cast<AccessibilityRenderObject*>(accTable)->renderer()->node();
     1352        if (node && node->hasTagName(HTMLNames::tableTag)) {
     1353            HTMLTableCaptionElement* caption = static_cast<HTMLTableElement*>(node)->caption();
     1354            if (caption)
     1355                return AccessibilityObject::firstAccessibleObjectFromNode(caption->renderer()->node())->wrapper();
     1356        }
     1357    }
     1358    return 0;
     1359}
     1360
    13111361static void atk_table_interface_init(AtkTableIface* iface)
    13121362{
    13131363    iface->ref_at = webkit_accessible_table_ref_at;
    13141364    iface->get_index_at = webkit_accessible_table_get_index_at;
     1365    iface->get_column_at_index = webkit_accessible_table_get_column_at_index;
     1366    iface->get_row_at_index = webkit_accessible_table_get_row_at_index;
    13151367    iface->get_n_columns = webkit_accessible_table_get_n_columns;
    13161368    iface->get_n_rows = webkit_accessible_table_get_n_rows;
     
    13181370    iface->get_row_extent_at = webkit_accessible_table_get_row_extent_at;
    13191371    iface->get_row_header = webkit_accessible_table_get_row_header;
     1372    iface->get_caption = webkit_accessible_table_get_caption;
    13201373}
    13211374
Note: See TracChangeset for help on using the changeset viewer.