Index: Source/core/rendering/RenderText.cpp |
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp |
index 1170cddfc7c91f7dbcc921b0c483092966cd6e6f..fcac83ca05240b2248cc974ebe1e7658b1b164e4 100644 |
--- a/Source/core/rendering/RenderText.cpp |
+++ b/Source/core/rendering/RenderText.cpp |
@@ -694,6 +694,12 @@ LayoutRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, Lay |
break; |
} |
+ // for dir=auto, use inlineBoxBidiLevel() to test the correct direction for the cursor. |
+ if (rightAligned && (node() && node()->selfOrAncestorHasDirAutoAttribute())) { |
+ if (inlineBox->bidiLevel()%2 != 1) |
+ rightAligned = false; |
+ } |
+ |
if (rightAligned) { |
left = std::max(left, leftEdge); |
left = std::min(left, rootRight - caretWidth); |