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

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: 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/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index 6602390029017c981f68ed01a600298b771d8dd3..709463868cddefb2b59089e8c7014247f915385e 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -2662,26 +2662,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;
}

Powered by Google App Engine
This is Rietveld 408576698