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

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

Issue 60633008: [CSS Grid Layout] Percentages of indefinite sizes should compute to "auto" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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
Index: Source/core/rendering/RenderGrid.cpp
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index 68f2e3e6d425ab54323c3128dda9775cc08c2d17..9fe86f921f9566bfb7e9c5cd7b3757c302739b49 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -488,7 +488,17 @@ const GridTrackSize& RenderGrid::gridTrackSize(GridTrackSizingDirection directio
if (i >= trackStyles.size())
return (direction == ForColumns) ? style()->gridAutoColumns() : style()->gridAutoRows();
- return trackStyles[i];
+ const GridTrackSize& trackSize = trackStyles[i];
+ // If the logical width/height of the grid container is indefinite, percentage values are treated as <auto>.
+ if (trackSize.isPercentage()) {
+ Length logicalSize = direction == ForColumns ? style()->logicalWidth() : style()->logicalHeight();
+ if (!logicalSize.isSpecified()) {
Julien - ping for review 2013/11/07 18:18:26 This is not totally right but a good beginning. i
svillar 2013/11/07 18:44:29 I don't really get what you mean with "when indefi
+ DEFINE_STATIC_LOCAL(GridTrackSize, autoTrackSize, (Auto));
+ return autoTrackSize;
+ }
+ }
+
+ return trackSize;
}
size_t RenderGrid::explicitGridColumnCount() const

Powered by Google App Engine
This is Rietveld 408576698