Chromium Code Reviews| Index: Source/core/rendering/RenderText.cpp |
| diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp |
| index 03b74ff509e48640acf37d9c178eadd59e150aab..cf20e237c4735fa48a9f0205d166ed92f23c125b 100644 |
| --- a/Source/core/rendering/RenderText.cpp |
| +++ b/Source/core/rendering/RenderText.cpp |
| @@ -694,12 +694,22 @@ LayoutRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, Lay |
| break; |
| } |
| - if (rightAligned) { |
| - left = std::max(left, leftEdge); |
| - left = std::min(left, rootRight - caretWidth); |
| + if (node() && node()->selfOrAncestorHasDirAutoAttribute()) { |
| + if (rightAligned && inlineBox->bidiLevel()%2) { |
| + left = std::max(left, leftEdge); |
| + left = std::min(left, rootRight - caretWidth); |
| + } else { |
| + left = std::min(left, rightEdge - caretWidthRightOfOffset); |
| + left = std::max(left, rootLeft); |
| + } |
| } else { |
| - left = std::min(left, rightEdge - caretWidthRightOfOffset); |
| - left = std::max(left, rootLeft); |
| + if (rightAligned) { |
| + left = std::max(left, leftEdge); |
|
eae
2014/09/08 18:58:50
The code in this block is identical to that in the
Habib Virji
2014/09/09 10:44:02
Done.
|
| + left = std::min(left, rootRight - caretWidth); |
| + } else { |
| + left = std::min(left, rightEdge - caretWidthRightOfOffset); |
| + left = std::max(left, rootLeft); |
| + } |
| } |
| return style()->isHorizontalWritingMode() ? IntRect(left, top, caretWidth, height) : IntRect(top, left, height, caretWidth); |