| Index: sky/engine/core/rendering/RenderBox.cpp
|
| diff --git a/sky/engine/core/rendering/RenderBox.cpp b/sky/engine/core/rendering/RenderBox.cpp
|
| index 2fbfd0ccfa979c2051a4560190bfe6a0397d5ae4..4dc64d5af2b5b2ce94e368bb31380b405c0f8fe3 100644
|
| --- a/sky/engine/core/rendering/RenderBox.cpp
|
| +++ b/sky/engine/core/rendering/RenderBox.cpp
|
| @@ -1861,9 +1861,8 @@ void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const
|
|
|
| // CSS 2.1: "If both 'margin-left' and 'margin-right' are 'auto', their used values are equal. This horizontally centers the element
|
| // with respect to the edges of the containing block."
|
| - const RenderStyle* containingBlockStyle = containingBlock->style();
|
| if ((marginStartLength.isAuto() && marginEndLength.isAuto() && marginBoxWidth < containerWidth)
|
| - || (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlockStyle->textAlign() == WEBKIT_CENTER)) {
|
| + || (!marginStartLength.isAuto() && !marginEndLength.isAuto())) {
|
| // Other browsers center the margin box for align=center elements so we match them here.
|
| LayoutUnit centeredMarginBoxStart = std::max<LayoutUnit>(0, (containerWidth - childWidth - marginStartWidth - marginEndWidth) / 2);
|
| marginStart = centeredMarginBoxStart + marginStartWidth;
|
| @@ -1878,9 +1877,7 @@ void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const
|
| return;
|
| }
|
|
|
| - bool pushToEndFromTextAlign = !marginEndLength.isAuto() && ((!containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_LEFT)
|
| - || (containingBlockStyle->isLeftToRightDirection() && containingBlockStyle->textAlign() == WEBKIT_RIGHT));
|
| - if ((marginStartLength.isAuto() && marginBoxWidth < containerWidth) || pushToEndFromTextAlign) {
|
| + if (marginStartLength.isAuto() && marginBoxWidth < containerWidth) {
|
| marginEnd = marginEndWidth;
|
| marginStart = containerWidth - childWidth - marginEnd;
|
| return;
|
|
|