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; |
} |