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

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2166393002: [css-grid] grid-auto-flow|row should take a <track-size>+ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing v2 Created 4 years, 5 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
Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index ae4ba1fd6cbb8a3239efef6b9faa7b805dbb654d..471af30929ff5d6420635f39064832ff3af47e3e 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -818,6 +818,16 @@ static void addValuesForNamedGridLinesAtIndex(OrderedNamedLinesCollector& collec
list.append(*lineNames);
}
+static CSSValue* valueForGridTrackSizeList(GridTrackSizingDirection direction, const ComputedStyle& style)
+{
+ const Vector<GridTrackSize>& autoTrackSizes = direction == ForColumns ? style.gridAutoColumns() : style.gridAutoRows();
+
+ CSSValueList* list = CSSValueList::createSpaceSeparated();
+ for (auto& trackSize : autoTrackSizes)
+ list->append(*specifiedValueForGridTrackSize(trackSize, style));
+ return list;
+}
+
static CSSValue* valueForGridTrackList(GridTrackSizingDirection direction, const LayoutObject* layoutObject, const ComputedStyle& style)
{
bool isRowAxis = direction == ForColumns;
@@ -1967,14 +1977,14 @@ const CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, cons
return list;
}
// Specs mention that getComputedStyle() should return the used value of the property instead of the computed
- // one for grid-definition-{rows|columns} but not for the grid-auto-{rows|columns} as things like
+ // one for grid-template-{rows|columns} but not for the grid-auto-{rows|columns} as things like
// grid-auto-columns: 2fr; cannot be resolved to a value in pixels as the '2fr' means very different things
// depending on the size of the explicit grid or the number of implicit tracks added to the grid. See
// http://lists.w3.org/Archives/Public/www-style/2013Nov/0014.html
case CSSPropertyGridAutoColumns:
- return specifiedValueForGridTrackSize(style.gridAutoColumns(), style);
+ return valueForGridTrackSizeList(ForColumns, style);
case CSSPropertyGridAutoRows:
- return specifiedValueForGridTrackSize(style.gridAutoRows(), style);
+ return valueForGridTrackSizeList(ForRows, style);
case CSSPropertyGridTemplateColumns:
return valueForGridTrackList(ForColumns, layoutObject, style);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.in ('k') | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698