2011-06-01 Ryosuke Niwa <rniwa@webkit.org>
authorRyosuke Niwa <rniwa@webkit.org>
Thu, 2 Jun 2011 19:05:52 +0000 (19:05 +0000)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Fri, 3 Jun 2011 14:37:40 +0000 (11:37 -0300)
commit3104ebfae1418e8bc426bd3a8c8909728fb0faaf
treeb56e8be9d3cb1c90a9bacd7db8e1af5a75d8bbf1
parent970ff13b5847f3302ae6b16f69e212ea6c9bc49f
2011-06-01  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Simon Fraser.

        REGRESSION: Text selection broken for text with line-height applied
        https://bugs.webkit.org/show_bug.cgi?id=54929

        The bug was caused by RenderText::positionForPoint's not considering the case where a point is
        above selectionTop and below lineTop of the first root inline box. Fixed the bug by considering
        any point between selectionTop and lineTop to be inside a root inline box. This condition is
        consistent with the condition we use to determine the bottom of a line.

        Test: editing/selection/hit-test-on-text-with-line-height.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::positionForPointWithInlineChildren): Fixed a condition to determine whether
        or not a point is above the first root line box. We need to check both selectionTop and logicalTop
        for the same reason explained above.
        * rendering/RenderText.cpp:
        (WebCore::RenderText::positionForPoint): See above.
2011-06-01  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Simon Fraser.

        REGRESSION: Text selection broken for text with line-height applied
        https://bugs.webkit.org/show_bug.cgi?id=54929

        Added a test to ensure WebKit can place caret in text with a line-height smaller than
        the height of the text.

        * editing/selection/hit-test-on-text-with-line-height-expected.txt: Added.
        * editing/selection/hit-test-on-text-with-line-height.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/selection/hit-test-on-text-with-line-height-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/hit-test-on-text-with-line-height.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderText.cpp