Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: Source/core/rendering/RenderText.cpp

Issue 541823003: Move caret to correct position when dir=auto (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Compile fix for Windows Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « Source/core/dom/Position.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698