Chromium Code Reviews| Index: Source/core/rendering/RenderBox.cpp |
| diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp |
| index d08b3e586e7a1029c8b6f54e29794111935075af..c7b81bda82fd98fd1d4e20790a27ebbe9764fa49 100644 |
| --- a/Source/core/rendering/RenderBox.cpp |
| +++ b/Source/core/rendering/RenderBox.cpp |
| @@ -2100,15 +2100,19 @@ void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const |
| return; |
| } |
| + |
| + |
|
mstensho (USE GERRIT)
2014/12/09 09:54:41
Couple of extraneous blank lines.
Kyungtae Kim
2014/12/09 11:36:32
Done.
|
| + bool hasInvertedDirection = containingBlockStyle->isLeftToRightDirection() != style()->isLeftToRightDirection(); |
| + bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_LEFT) |
| + || (containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_RIGHT)); |
| + |
| // CSS 2.1: "If there is exactly one value specified as 'auto', its used value follows from the equality." |
| - if (marginEndLength.isAuto() && marginBoxWidth < availableWidth) { |
| + if ((marginEndLength.isAuto() && marginBoxWidth < availableWidth) || (pushToEndFromTextAlign && hasInvertedDirection)) { |
| marginStart = marginStartWidth; |
| marginEnd = availableWidth - childWidth - marginStart; |
| return; |
| } |
| - bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_LEFT) |
| - || (containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_RIGHT)); |
| if ((marginStartLength.isAuto() && marginBoxWidth < availableWidth) || pushToEndFromTextAlign) { |
| marginEnd = marginEndWidth; |
| marginStart = availableWidth - childWidth - marginEnd; |