Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutGrid.cpp

Issue 2543193002: [css-grid] Use child's marginLogicalWidth to compute content-sized track (Closed)
Patch Set: Compute margins if child needs layout. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698