Changeset 125685 in webkit


Ignore:
Timestamp:
Aug 15, 2012 11:13:46 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Gtk] atk_text_get_text_at_offset() fails to provide the correct line for paragraphs in list items whose text wraps
https://bugs.webkit.org/show_bug.cgi?id=83435

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

Source/WebCore:

Fix a logic error when checking if an object is a list marker.

  • accessibility/gtk/WebKitAccessibleInterfaceText.cpp:

(textForRenderer):

Source/WebKit/gtk:

Updated unit test to include a paragraph in a list item when testing atk_text_get_text_at_offset().

  • tests/testatk.c:

(testWebkitAtkGetTextAtOffsetWithSpecialCharacters):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r125684 r125685  
     12012-08-15  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [Gtk] atk_text_get_text_at_offset() fails to provide the correct line for paragraphs in list items whose text wraps
     4        https://bugs.webkit.org/show_bug.cgi?id=83435
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Fix a logic error when checking if an object is a list marker.
     9
     10        * accessibility/gtk/WebKitAccessibleInterfaceText.cpp:
     11        (textForRenderer):
     12
    1132012-08-15  Arpita Bahuguna  <arpitabahuguna@gmail.com>
    214
  • trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp

    r120495 r125685  
    8080            // List item's markers will be treated in an special way
    8181            // later on this function, so ignore them here.
    82             if (object->isReplaced() && !renderer->isListItem())
     82            if (object->isReplaced() && !object->isListMarker())
    8383                g_string_append_unichar(resultText, objectReplacementCharacter);
    8484
  • trunk/Source/WebKit/gtk/ChangeLog

    r125615 r125685  
     12012-08-15  Joanmarie Diggs  <jdiggs@igalia.com>
     2
     3        [Gtk] atk_text_get_text_at_offset() fails to provide the correct line for paragraphs in list items whose text wraps
     4        https://bugs.webkit.org/show_bug.cgi?id=83435
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Updated unit test to include a paragraph in a list item when testing atk_text_get_text_at_offset().
     9
     10        * tests/testatk.c:
     11        (testWebkitAtkGetTextAtOffsetWithSpecialCharacters):
     12
    1132012-08-14  Adam Barth  <abarth@webkit.org>
    214
  • trunk/Source/WebKit/gtk/tests/testatk.c

    r125403 r125685  
    3636static const char* contentsWithPreformattedText = "<html><body><pre>\n\t\n\tfirst line\n\tsecond line\n</pre></body></html>";
    3737
    38 static const char* contentsWithSpecialChars = "<html><body><p>&laquo;&nbsp;This is a paragraph with &ldquo;special&rdquo; characters inside.&nbsp;&raquo;</p><ul><li style='max-width:100px;'>List item with some text that wraps across different lines.</li></ul></body></html>";
     38static const char* contentsWithSpecialChars = "<html><body><p>&laquo;&nbsp;This is a paragraph with &ldquo;special&rdquo; characters inside.&nbsp;&raquo;</p><ul><li style='max-width:100px;'>List item with some text that wraps across different lines.</li><li style='max-width:100px;'><p>List item with some text that wraps across different lines.</p></li></ul></body></html>";
    3939
    4040static const char* contentsInTextarea = "<html><body><textarea cols='80'>This is a test. This is the second sentence. And this the third.</textarea></body></html>";
     
    841841       (special character) and wrapped text always return the right
    842842       piece of text for each line. */
     843    testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, 3, "\342\200\242 List item ", 0, 12);
     844    testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, 13, "with some ", 12, 22);
     845    testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, 0, "\342\200\242 List item", 0, 11);
     846    testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, 12, " with some", 11, 21);
     847
     848    g_object_unref(listItem);
     849
     850    listItem = ATK_TEXT(atk_object_ref_accessible_child(list, 1));
     851    g_assert(ATK_IS_TEXT(listItem));
     852
     853    /* Check that placing the same text in a paragraph doesn't break things. */
     854    text = atk_text_get_text(ATK_TEXT(listItem), 0, -1);
     855    g_assert_cmpstr(text, ==, "\342\200\242 List item with some text that wraps across different lines.");
     856    g_free(text);
     857
    843858    testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, 3, "\342\200\242 List item ", 0, 12);
    844859    testGetTextFunction(ATK_TEXT(listItem), atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, 13, "with some ", 12, 22);
Note: See TracChangeset for help on using the changeset viewer.