Changeset 89056 in webkit


Ignore:
Timestamp:
Jun 16, 2011 12:11:32 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

2011-06-16 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by Eric Seidel.

Consider padding and border when looking for the next/previous line position
https://bugs.webkit.org/show_bug.cgi?id=55481

Added a test to ensure WebKit can allow vertical caret movements even when
inline elements that span multiple lines have paddings, borders, or both.

  • editing/selection/move-vertically-with-paddings-borders-expected.txt: Added.
  • editing/selection/move-vertically-with-paddings-borders.html: Added.

2011-06-16 Ryosuke Niwa <rniwa@webkit.org>

Reviewed by Eric Seidel.

Consider padding and border when looking for the next/previous line position
https://bugs.webkit.org/show_bug.cgi?id=55481

The bug was caused by previousLinePosition and nextLinePosition passing y coordinate
above the line in some cases. Fixed the bug by passing the larger of selectionTop and logicalTop.

This patch is based on a patch originally written by Mario Sanchez Prada <msanchez@igalia.com>.

Test: editing/selection/move-vertically-with-paddings-borders.html

  • editing/visible_units.cpp: (WebCore::previousLinePosition): (WebCore::nextLinePosition):
  • rendering/RootInlineBox.h: (WebCore::RootInlineBox::blockDirectionPointInLine):
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r89055 r89056  
     12011-06-16  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Consider padding and border when looking for the next/previous line position
     6        https://bugs.webkit.org/show_bug.cgi?id=55481
     7
     8        Added a test to ensure WebKit can allow vertical caret movements even when
     9        inline elements that span multiple lines have paddings, borders, or both.
     10
     11        * editing/selection/move-vertically-with-paddings-borders-expected.txt: Added.
     12        * editing/selection/move-vertically-with-paddings-borders.html: Added.
     13
    1142011-06-16  Keunsoon Lee  <keunsoon.lee@samsung.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r89055 r89056  
     12011-06-16  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Consider padding and border when looking for the next/previous line position
     6        https://bugs.webkit.org/show_bug.cgi?id=55481
     7
     8        The bug was caused by previousLinePosition and nextLinePosition passing y coordinate
     9        above the line in some cases. Fixed the bug by passing the larger of selectionTop and logicalTop.
     10
     11        This patch is based on a patch originally written by Mario Sanchez Prada <msanchez@igalia.com>.
     12
     13        Test: editing/selection/move-vertically-with-paddings-borders.html
     14
     15        * editing/visible_units.cpp:
     16        (WebCore::previousLinePosition):
     17        (WebCore::nextLinePosition):
     18        * rendering/RootInlineBox.h:
     19        (WebCore::RootInlineBox::blockDirectionPointInLine):
     20
    1212011-06-16  Keunsoon Lee  <keunsoon.lee@samsung.com>
    222
  • trunk/Source/WebCore/editing/visible_units.cpp

    r88359 r89056  
    574574        if (node && editingIgnoresContent(node))
    575575            return positionInParentBeforeNode(node);
    576         return renderer->positionForPoint(IntPoint(x - absPos.x(), root->lineTop()));
     576        return renderer->positionForPoint(IntPoint(x - absPos.x(), root->blockDirectionPointInLine()));
    577577    }
    578578   
     
    681681        if (node && editingIgnoresContent(node))
    682682            return positionInParentBeforeNode(node);
    683         return renderer->positionForPoint(IntPoint(x - absPos.x(), root->lineTop()));
     683        return renderer->positionForPoint(IntPoint(x - absPos.x(), root->blockDirectionPointInLine()));
    684684    }   
    685685
  • trunk/Source/WebCore/rendering/RootInlineBox.h

    r88319 r89056  
    5757    int selectionBottom() const;
    5858    int selectionHeight() const { return max(0, selectionBottom() - selectionTop()); }
     59
     60    int blockDirectionPointInLine() const { return max(lineTop(), selectionTop()); }
    5961
    6062    int alignBoxesInBlockDirection(int heightOfBlock, GlyphOverflowAndFallbackFontsMap&, VerticalPositionCache&);
Note: See TracChangeset for help on using the changeset viewer.