2011-06-01 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jun 2011 19:05:52 +0000 (19:05 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jun 2011 19:05:52 +0000 (19:05 +0000)
commita20202369d915388ab6df4f8bfcb04daace66950
tree07bc96989c9092b874817a6a0aef2efe6a4c1277
parent12a9e555831fcdc87dd956e6256db7343400cbe8
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: https://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