diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-30 11:37:48 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-30 11:38:52 +0200 |
| commit | 89e2486a48b739f8d771d69ede5a6a1b244a10fc (patch) | |
| tree | 503b1a7812cf97d93704c32437eb5f62dc1a1ff9 /Source/WebCore/rendering/RenderText.cpp | |
| parent | 625f028249cb37c55bbbd153f3902afd0b0756d9 (diff) | |
| download | qtwebkit-89e2486a48b739f8d771d69ede5a6a1b244a10fc.tar.gz | |
Imported WebKit commit 0282df8ca7c11d8c8a66ea18543695c69f545a27 (http://svn.webkit.org/repository/webkit/trunk@124002)
New snapshot with prospective Mountain Lion build fix
Diffstat (limited to 'Source/WebCore/rendering/RenderText.cpp')
| -rw-r--r-- | Source/WebCore/rendering/RenderText.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp index baf95475c..f93704dc2 100644 --- a/Source/WebCore/rendering/RenderText.cpp +++ b/Source/WebCore/rendering/RenderText.cpp @@ -613,6 +613,7 @@ VisiblePosition RenderText::positionForPoint(const LayoutPoint& point) LayoutUnit pointLineDirection = firstTextBox()->isHorizontal() ? point.x() : point.y(); LayoutUnit pointBlockDirection = firstTextBox()->isHorizontal() ? point.y() : point.x(); + bool blocksAreFlipped = style()->isFlippedBlocksWritingMode(); InlineTextBox* lastBox = 0; for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { @@ -620,12 +621,13 @@ VisiblePosition RenderText::positionForPoint(const LayoutPoint& point) box = box->nextTextBox(); RootInlineBox* rootBox = box->root(); - if (pointBlockDirection >= rootBox->selectionTop() || pointBlockDirection >= rootBox->lineTop()) { + LayoutUnit top = min(rootBox->selectionTop(), rootBox->lineTop()); + if (pointBlockDirection > top || (!blocksAreFlipped && pointBlockDirection == top)) { LayoutUnit bottom = rootBox->selectionBottom(); if (rootBox->nextRootBox()) bottom = min(bottom, rootBox->nextRootBox()->lineTop()); - if (pointBlockDirection < bottom) { + if (pointBlockDirection < bottom || (blocksAreFlipped && pointBlockDirection == bottom)) { ShouldAffinityBeDownstream shouldAffinityBeDownstream; if (lineDirectionPointFitsInBox(pointLineDirection, box, shouldAffinityBeDownstream)) return createVisiblePositionAfterAdjustingOffsetForBiDi(box, box->offsetForPosition(pointLineDirection), shouldAffinityBeDownstream); |
