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

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

Issue 19471004: Rendering the property, text-align-last. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using Ahem.ttf font Created 7 years, 2 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/RenderBlockLineLayout.cpp
diff --git a/Source/core/rendering/RenderBlockLineLayout.cpp b/Source/core/rendering/RenderBlockLineLayout.cpp
index 171bd9922687cac305db0710deb2dfdcf0d0a45b..ccd09e29247e39fc0260af60d006fcfc751396b3 100644
--- a/Source/core/rendering/RenderBlockLineLayout.cpp
+++ b/Source/core/rendering/RenderBlockLineLayout.cpp
@@ -667,8 +667,33 @@ RootInlineBox* RenderBlockFlow::constructLine(BidiRunList<BidiRun>& bidiRuns, co
ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const
{
ETextAlign alignment = style()->textAlign();
- if (!endsWithSoftBreak && alignment == JUSTIFY)
- alignment = TASTART;
+ if (endsWithSoftBreak)
+ return alignment;
+
+ if (!RuntimeEnabledFeatures::css3TextEnabled())
+ return (alignment == JUSTIFY) ? TASTART : alignment;
+
+ TextAlignLast alignmentLast = style()->textAlignLast();
+ switch (alignmentLast) {
+ case TextAlignLastStart:
+ return TASTART;
+ case TextAlignLastEnd:
+ return TAEND;
+ case TextAlignLastLeft:
+ return LEFT;
+ case TextAlignLastRight:
+ return RIGHT;
+ case TextAlignLastCenter:
+ return CENTER;
+ case TextAlignLastJustify:
+ return JUSTIFY;
+ case TextAlignLastAuto:
+ if (alignment != JUSTIFY)
+ return alignment;
+ if (style()->textJustify() == TextJustifyDistribute)
+ return JUSTIFY;
+ return TASTART;
+ }
return alignment;
}

Powered by Google App Engine
This is Rietveld 408576698