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

Unified Diff: Source/core/rendering/RenderGrid.cpp

Issue 24031007: RenderGrid should include grid items' margins in its intrinsic size (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months 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 | « Source/core/rendering/RenderFlexibleBox.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderGrid.cpp
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index 20183d4dfbcff6f4b490374b0e1ab6faa268153e..7bcacc8e134beca355e1eba28c51c24c86897ffd 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -333,20 +333,18 @@ LayoutUnit RenderGrid::computePreferredTrackWidth(const GridLength& gridLength,
if (length.isMinContent()) {
LayoutUnit minContentSize = 0;
GridIterator iterator(m_grid, ForColumns, trackIndex);
- while (RenderBox* gridItem = iterator.nextGridItem()) {
- // FIXME: We should include the child's fixed margins like RenderFlexibleBox.
- minContentSize = std::max(minContentSize, gridItem->minPreferredLogicalWidth());
- }
+ while (RenderBox* gridItem = iterator.nextGridItem())
+ minContentSize = std::max(minContentSize, gridItem->minPreferredLogicalWidth() + marginIntrinsicLogicalWidthForChild(gridItem));
+
return minContentSize;
}
if (length.isMaxContent()) {
LayoutUnit maxContentSize = 0;
GridIterator iterator(m_grid, ForColumns, trackIndex);
- while (RenderBox* gridItem = iterator.nextGridItem()) {
- // FIXME: We should include the child's fixed margins like RenderFlexibleBox.
- maxContentSize = std::max(maxContentSize, gridItem->maxPreferredLogicalWidth());
- }
+ while (RenderBox* gridItem = iterator.nextGridItem())
+ maxContentSize = std::max(maxContentSize, gridItem->maxPreferredLogicalWidth() + marginIntrinsicLogicalWidthForChild(gridItem));
+
return maxContentSize;
}
« no previous file with comments | « Source/core/rendering/RenderFlexibleBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698