Index: third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
index 65737726ec1058d94d672d2ac6575009d267aca6..7f3e35d282c71a7fa94cca6ed01a0649e23fec11 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp |
@@ -1381,8 +1381,11 @@ LayoutUnit LayoutGrid::minContentForChild(LayoutBox& child, |
// FIXME: It's unclear if we should return the intrinsic width or the |
// preferred width. |
// See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html |
- return child.minPreferredLogicalWidth() + |
- marginIntrinsicLogicalWidthForChild(child); |
+ LayoutUnit marginLogicalWidth = |
+ child.needsLayout() |
+ ? computeMarginLogicalSizeForChild(InlineDirection, child) |
+ : child.marginLogicalWidth(); |
+ return child.minPreferredLogicalWidth() + marginLogicalWidth; |
} |
// All orthogonal flow boxes were already laid out during an early layout |
@@ -1421,8 +1424,11 @@ LayoutUnit LayoutGrid::maxContentForChild(LayoutBox& child, |
// FIXME: It's unclear if we should return the intrinsic width or the |
// preferred width. |
// See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html |
- return child.maxPreferredLogicalWidth() + |
- marginIntrinsicLogicalWidthForChild(child); |
+ LayoutUnit marginLogicalWidth = |
+ child.needsLayout() |
+ ? computeMarginLogicalSizeForChild(InlineDirection, child) |
+ : child.marginLogicalWidth(); |
+ return child.maxPreferredLogicalWidth() + marginLogicalWidth; |
} |
// All orthogonal flow boxes were already laid out during an early layout |
@@ -2877,12 +2883,10 @@ LayoutUnit LayoutGrid::computeMarginLogicalSizeForChild( |
LayoutUnit marginEnd; |
LayoutUnit logicalSize = |
isRowAxis ? child.logicalWidth() : child.logicalHeight(); |
- Length marginStartLength = isRowAxis |
- ? child.styleRef().marginStart() |
- : child.styleRef().marginBeforeUsing(style()); |
- Length marginEndLength = isRowAxis |
- ? child.styleRef().marginEnd() |
- : child.styleRef().marginAfterUsing(style()); |
+ Length marginStartLength = isRowAxis ? child.styleRef().marginStart() |
+ : child.styleRef().marginBefore(); |
+ Length marginEndLength = |
+ isRowAxis ? child.styleRef().marginEnd() : child.styleRef().marginAfter(); |
child.computeMarginsForDirection( |
forDirection, this, child.containingBlockLogicalWidthForContent(), |
logicalSize, marginStart, marginEnd, marginStartLength, marginEndLength); |