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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp

Issue 1635203002: Apply text indent if the text direction matches the text alignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
index 05b71ef1447c822df210ce919b31cf8df5a4e835..e534ffd191edb18a566930489bf7ce9754f842f6 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -2060,7 +2060,24 @@ LayoutUnit LayoutBlockFlow::startAlignedOffsetForLine(LayoutUnit position, Inden
{
ETextAlign textAlign = style()->textAlign();
- if (textAlign == TASTART) // FIXME: Handle TAEND here
+ bool applyIndentText;
+ switch (textAlign) { // FIXME: Handle TAEND here
+ case LEFT:
+ case WEBKIT_LEFT:
+ applyIndentText = style()->isLeftToRightDirection();
+ break;
+ case RIGHT:
+ case WEBKIT_RIGHT:
+ applyIndentText = !style()->isLeftToRightDirection();
+ break;
+ case TASTART:
+ applyIndentText = true;
+ break;
+ default:
+ applyIndentText = false;
+ }
+
+ if (applyIndentText)
return startOffsetForLine(position, indentText);
// updateLogicalWidthForAlignment() handles the direction of the block so no need to consider it here

Powered by Google App Engine
This is Rietveld 408576698