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

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: 1st patch for review 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 66f002a2fe46ae79e47c6bb86751552b410417aa..3a582bbf92fe522651abff761a6cde2d720d178d 100644
--- a/Source/core/rendering/RenderBlockLineLayout.cpp
+++ b/Source/core/rendering/RenderBlockLineLayout.cpp
@@ -708,8 +708,36 @@ RootInlineBox* RenderBlock::constructLine(BidiRunList<BidiRun>& bidiRuns, const
ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const
{
ETextAlign alignment = style()->textAlign();
- if (!endsWithSoftBreak && alignment == JUSTIFY)
- alignment = TASTART;
+ if (endsWithSoftBreak)
+ return alignment;
+
+ if (!RuntimeEnabledFeatures::css3TextEnabled()) {
+ if (alignment == JUSTIFY)
+ alignment = TASTART;
Julien - ping for review 2013/10/22 15:06:06 return TASTART; This could even be written: retu
dw.im 2013/10/23 02:40:58 Oh, it could be.
+ return 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