Index: sky/engine/core/rendering/RenderBox.cpp |
diff --git a/sky/engine/core/rendering/RenderBox.cpp b/sky/engine/core/rendering/RenderBox.cpp |
index eaa4339067fb77e435fceb07a6b0be5f6ff4e79e..54cad1a3609de3dc55af6adfa3dd705d5452a31c 100644 |
--- a/sky/engine/core/rendering/RenderBox.cpp |
+++ b/sky/engine/core/rendering/RenderBox.cpp |
@@ -1648,8 +1648,7 @@ 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." |
- if ((marginStartLength.isAuto() && marginEndLength.isAuto() && marginBoxWidth < containerWidth) |
- || (!marginStartLength.isAuto() && !marginEndLength.isAuto())) { |
+ if (marginStartLength.isAuto() && marginEndLength.isAuto() && marginBoxWidth < containerWidth) { |
// 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; |