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

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

Issue 181333003: [CSS Grid Layout] Use Render methods, rather than style, to determine shrink-to-fit behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Some improvements in the test. Created 6 years, 10 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/RenderGrid.h ('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 89119b8a93c5afe8f4e1fed5734a5caf7629ab35..74247ff6924411df5758dae7342ba8d59d8373a1 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -341,9 +341,9 @@ void RenderGrid::computeUsedBreadthOfGridTracks(GridTrackSizingDirection directi
computeUsedBreadthOfGridTracks(direction, sizingData, availableLogicalSpace);
}
-static bool gridElementIsShrinkToFit(const RenderStyle& style)
+bool RenderGrid::gridElementIsShrinkToFit()
{
- return style.isFloating() || style.position() == AbsolutePosition;
+ return isFloatingOrOutOfFlowPositioned();
}
void RenderGrid::computeUsedBreadthOfGridTracks(GridTrackSizingDirection direction, GridSizingData& sizingData, LayoutUnit& availableLogicalSpace)
@@ -379,7 +379,7 @@ void RenderGrid::computeUsedBreadthOfGridTracks(GridTrackSizingDirection directi
availableLogicalSpace -= tracks[i].m_usedBreadth;
}
- const bool hasUndefinedRemainingSpace = (direction == ForRows) ? style()->logicalHeight().isAuto() : gridElementIsShrinkToFit(*style());
+ const bool hasUndefinedRemainingSpace = (direction == ForRows) ? style()->logicalHeight().isAuto() : gridElementIsShrinkToFit();
if (!hasUndefinedRemainingSpace && availableLogicalSpace <= 0)
return;
« no previous file with comments | « Source/core/rendering/RenderGrid.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698