Changeset 125692 in webkit


Ignore:
Timestamp:
Aug 15, 2012 12:18:27 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Gtk] atk_text_set_caret_offset() fails for table cells
https://bugs.webkit.org/show_bug.cgi?id=83501

Patch by Joanmarie Diggs <jdiggs@igalia.com> on 2012-08-15
Reviewed by Chris Fleizach.

Source/WebCore:

Allow using text ranges in accessible table cells.

  • accessibility/gtk/AccessibilityObjectAtk.cpp:

(WebCore::AccessibilityObject::allowsTextRanges):
Add table cells to the list of accessibility objects supporting text ranges.

Source/WebKit/gtk:

Update unit test to include setting the caret in a table cell via the AtkText interface.

  • tests/testatk.c:

(testWebkitAtkCaretOffsets): Add setting the caret inside the text of a table cell.

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r125691 r125692  
     12012-08-15  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [Gtk] atk_text_set_caret_offset() fails for table cells
     4        https://bugs.webkit.org/show_bug.cgi?id=83501
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Allow using text ranges in accessible table cells.
     9
     10        * accessibility/gtk/AccessibilityObjectAtk.cpp:
     11        (WebCore::AccessibilityObject::allowsTextRanges):
     12        Add table cells to the list of accessibility objects supporting text ranges.
     13
    1142012-08-15  Scott Graham  <scottmg@chromium.org>
    215
  • trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectAtk.cpp

    r111669 r125692  
    104104{
    105105    // Check type for the AccessibilityObject.
    106     if (isTextControl() || isWebArea() || isGroup() || isLink() || isHeading() || isListItem())
     106    if (isTextControl() || isWebArea() || isGroup() || isLink() || isHeading() || isListItem() || isTableCell())
    107107        return true;
    108108
  • trunk/Source/WebKit/gtk/ChangeLog

    r125685 r125692  
     12012-08-15  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [Gtk] atk_text_set_caret_offset() fails for table cells
     4        https://bugs.webkit.org/show_bug.cgi?id=83501
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Update unit test to include setting the caret in a table cell via the AtkText interface.
     9
     10        * tests/testatk.c:
     11        (testWebkitAtkCaretOffsets): Add setting the caret inside the text of a table cell.
     12
    1132012-08-15  Joanmarie Diggs  <jdiggs@igalia.com>
    214
  • trunk/Source/WebKit/gtk/tests/testatk.c

    r125685 r125692  
    6666static const char* listsOfItems = "<html><body><ul><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ul><ol><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ol></body></html>";
    6767
    68 static const char* textForCaretBrowsing = "<html><body><h1>A text header</h1><p>A paragraph <a href='http://foo.bar.baz/'>with a link</a> in the middle</p><ol><li>A list item</li></ol><select><option selected value='foo'>An option in a combo box</option></select><input type='text'' name='foo'' value='foo bar baz' /></body></html>";
     68static const char* textForCaretBrowsing = "<html><body><h1>A text header</h1><p>A paragraph <a href='http://foo.bar.baz/'>with a link</a> in the middle</p><ol><li>A list item</li></ol><select><option selected value='foo'>An option in a combo box</option></select><input type='text'' name='foo'' value='foo bar baz' /><table><tr><td>a table cell</td></tr></table></body></html>";
    6969
    7070static const char* textForSelections = "<html><body><p>A paragraph with plain text</p><p>A paragraph with <a href='http://webkit.org'>a link</a> in the middle</p><ol><li>A list item</li></ol><select></body></html>";
     
    389389    offset = atk_text_get_caret_offset(ATK_TEXT(textEntry));
    390390    g_assert_cmpint(offset, ==, 5);
     391
     392    AtkObject* table = atk_object_ref_accessible_child(object, 4);
     393    g_assert(ATK_IS_OBJECT(table));
     394    g_assert(atk_object_get_role(table) == ATK_ROLE_TABLE);
     395    g_assert_cmpint(atk_object_get_n_accessible_children(table), ==, 1);
     396
     397    AtkObject* tableCell = atk_object_ref_accessible_child(table, 0);
     398    g_assert(ATK_IS_TEXT(tableCell));
     399    g_assert(atk_object_get_role(tableCell) == ATK_ROLE_TABLE_CELL);
     400    text = atk_text_get_text(ATK_TEXT(tableCell), 0, -1);
     401    g_assert_cmpstr(text, ==, "a table cell");
     402    g_free(text);
     403
     404    result = atk_text_set_caret_offset(ATK_TEXT(tableCell), 2);
     405    g_assert_cmpint(result, ==, TRUE);
     406    offset = atk_text_get_caret_offset(ATK_TEXT(tableCell));
     407    g_assert_cmpint(offset, ==, 2);
    391408
    392409    g_free(textCaretMovedResult);
     
    402419    g_object_unref(comboBoxOption);
    403420    g_object_unref(textEntry);
     421    g_object_unref(table);
     422    g_object_unref(tableCell);
    404423    g_object_unref(webView);
    405424}
Note: See TracChangeset for help on using the changeset viewer.