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

Unified Diff: Source/core/rendering/RenderBoxModelObject.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: Rebased patch against master Created 6 years, 10 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/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index d5dfa279e43f7722398d7af39a0c67016f61c87c..48934da1ad4136924430a8fce4b9ee403151285c 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -2628,26 +2628,21 @@ LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width,
CaretAlignment alignment = alignLeft;
- switch (currentStyle->textAlign()) {
+ switch (simplifiedTextAlign(currentStyle->textAlign())) {
case LEFT:
- case WEBKIT_LEFT:
break;
case CENTER:
- case WEBKIT_CENTER:
alignment = alignCenter;
break;
case RIGHT:
- case WEBKIT_RIGHT:
alignment = alignRight;
break;
case JUSTIFY:
- case TASTART:
if (!currentStyle->isLeftToRightDirection())
alignment = alignRight;
break;
- case TAEND:
- if (currentStyle->isLeftToRightDirection())
- alignment = alignRight;
+ default:
+ ASSERT_NOT_REACHED();
break;
}
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698