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

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

Issue 150403003: Consider text alignment and direction when computing the left offset for horizontal writing modes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@issue313593
Patch Set: Created 6 years, 11 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
Index: Source/core/rendering/RenderText.cpp
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index 70f35a32a4a9fb0c011c3016db1b2e8d5e004d1f..678506cbf436974b5311a5a4458d75997e01e069 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -692,22 +692,18 @@ LayoutRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, Lay
rightEdge = max<float>(cb->logicalWidth(), rootRight);
bool rightAligned = false;
- switch (cbStyle->textAlign()) {
+ switch (simplifiedTextAlign(cbStyle->textAlign())) {
case RIGHT:
- case WEBKIT_RIGHT:
rightAligned = true;
break;
case LEFT:
- case WEBKIT_LEFT:
case CENTER:
- case WEBKIT_CENTER:
break;
case JUSTIFY:
- case TASTART:
rightAligned = !cbStyle->isLeftToRightDirection();
break;
- case TAEND:
- rightAligned = cbStyle->isLeftToRightDirection();
+ default:
+ ASSERT_NOT_REACHED();
break;
}
« Source/core/rendering/RenderObject.cpp ('K') | « Source/core/rendering/RenderObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698