Changeset 77234 in webkit


Ignore:
Timestamp:
Feb 1, 2011 1:54:23 AM (13 years ago)
Author:
mario@webkit.org
Message:

2011-02-01 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.

[GTK] character range extents is off when the end of a wrapped line is included
https://bugs.webkit.org/show_bug.cgi?id=53323

Fixed wrong calculation getting the range extents.

  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (webkit_accessible_text_get_range_extents): Removed '+1' since the requested interval shouldn't include the last character.

2011-02-01 Mario Sanchez Prada <msanchez@igalia.com>

Reviewed by Martin Robinson.

[GTK] character range extents is off when the end of a wrapped line is included
https://bugs.webkit.org/show_bug.cgi?id=53323

Update unit test to check the fix for this bug.

  • tests/testatk.c: (testWebkitAtkGetExtents): Check that the extent for a full line are the same height than for a partial section of the same line.
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r77233 r77234  
     12011-02-01  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] character range extents is off when the end of a wrapped line is included
     6        https://bugs.webkit.org/show_bug.cgi?id=53323
     7
     8        Fixed wrong calculation getting the range extents.
     9
     10        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     11        (webkit_accessible_text_get_range_extents): Removed '+1' since the
     12        requested interval shouldn't include the last character.
     13
    1142011-02-01  Mario Sanchez Prada  <msanchez@igalia.com>
    215
  • trunk/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r77233 r77234  
    15451545static void webkit_accessible_text_get_range_extents(AtkText* text, gint startOffset, gint endOffset, AtkCoordType coords, AtkTextRectangle* rect)
    15461546{
    1547     IntRect extents = textExtents(text, startOffset, endOffset - startOffset + 1, coords);
     1547    IntRect extents = textExtents(text, startOffset, endOffset - startOffset, coords);
    15481548    rect->x = extents.x();
    15491549    rect->y = extents.y();
  • trunk/Source/WebKit/gtk/ChangeLog

    r77233 r77234  
     12011-02-01  Mario Sanchez Prada  <msanchez@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] character range extents is off when the end of a wrapped line is included
     6        https://bugs.webkit.org/show_bug.cgi?id=53323
     7
     8        Update unit test to check the fix for this bug.
     9
     10        * tests/testatk.c:
     11        (testWebkitAtkGetExtents): Check that the extent for a full line
     12        are the same height than for a partial section of the same line.
     13
    1142011-02-01  Mario Sanchez Prada  <msanchez@igalia.com>
    215
  • trunk/Source/WebKit/gtk/tests/testatk.c

    r77233 r77234  
    11931193    g_assert_cmpint(y, ==, mline_window.y + mline_window.height - height);
    11941194    g_assert_cmpint(height, <=, mline_window.height);
     1195
     1196    /* Check that extent for a full line are the same height than for
     1197       a partial section of the same line */
     1198    gint startOffset;
     1199    gint endOffset;
     1200    gchar* text = atk_text_get_text_at_offset(multilineText, 0, ATK_TEXT_BOUNDARY_LINE_START, &startOffset, &endOffset);
     1201    g_free(text);
     1202
     1203    AtkTextRectangle fline_window;
     1204    AtkTextRectangle afline_window;
     1205    atk_text_get_range_extents(multilineText, startOffset, endOffset, ATK_XY_WINDOW, &fline_window);
     1206    atk_text_get_range_extents(multilineText, startOffset, endOffset - 1, ATK_XY_WINDOW, &afline_window);
     1207    g_assert_cmpint(fline_window.x, ==, afline_window.x);
     1208    g_assert_cmpint(fline_window.y, ==, afline_window.y);
     1209    g_assert_cmpint(fline_window.height, ==, afline_window.height);
    11951210
    11961211    g_object_unref(shortText1);
Note: See TracChangeset for help on using the changeset viewer.