Index: Source/core/rendering/RenderBox.cpp |
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp |
index d08b3e586e7a1029c8b6f54e29794111935075af..374712aed83b2523a6bee622b05802a0cd97b518 100644 |
--- a/Source/core/rendering/RenderBox.cpp |
+++ b/Source/core/rendering/RenderBox.cpp |
@@ -2110,8 +2110,13 @@ void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const |
bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_LEFT) |
|| (containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_RIGHT)); |
if ((marginStartLength.isAuto() && marginBoxWidth < availableWidth) || pushToEndFromTextAlign) { |
mstensho (USE GERRIT)
2014/12/08 10:01:21
Now handling of regular auto margins will be broke
Kyungtae Kim
2014/12/09 04:53:08
I included autoMargin cases in a new test case
|
- marginEnd = marginEndWidth; |
- marginStart = availableWidth - childWidth - marginEnd; |
+ if (containingBlockStyle->isLeftToRightDirection() != style()->isLeftToRightDirection()) { |
+ marginStart = marginStartWidth; |
+ marginEnd = availableWidth - childWidth - marginStart; |
+ } else { |
+ marginEnd = marginEndWidth; |
+ marginStart = availableWidth - childWidth - marginEnd; |
+ } |
return; |
} |