Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
index 0f5aeb289c198a450a9306f4753bed370b5770cd..cb5dc259b66287c0a59c62d1324ce9fce2690378 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
@@ -2937,6 +2937,23 @@ static CSSValue* consumeBackgroundSize(CSSPropertyID unresolvedProperty, CSSPars |
return CSSValuePair::create(horizontal, vertical, CSSValuePair::KeepIdenticalValues); |
} |
+CSSValueList* consumeGridAutoFlow(CSSParserTokenRange& range) |
+{ |
+ CSSPrimitiveValue* rowOrColumnValue = consumeIdent<CSSValueRow, CSSValueColumn>(range); |
+ CSSPrimitiveValue* denseAlgorithm = consumeIdent<CSSValueDense>(range); |
+ if (!rowOrColumnValue) { |
+ rowOrColumnValue = consumeIdent<CSSValueRow, CSSValueColumn>(range); |
+ if (!rowOrColumnValue && !denseAlgorithm) |
+ return nullptr; |
+ } |
+ CSSValueList* parsedValues = CSSValueList::createSpaceSeparated(); |
+ if (rowOrColumnValue) |
+ parsedValues->append(rowOrColumnValue); |
+ if (denseAlgorithm) |
+ parsedValues->append(denseAlgorithm); |
+ return parsedValues; |
+} |
+ |
static CSSValue* consumeBackgroundComponent(CSSPropertyID unresolvedProperty, CSSParserTokenRange& range, const CSSParserContext& context) |
{ |
switch (unresolvedProperty) { |
@@ -3115,7 +3132,7 @@ static CSSPrimitiveValue* consumeGridBreadth(CSSParserTokenRange& range, CSSPars |
} |
// TODO(rob.buis): This needs a bool parameter so we can disallow <auto-track-list> for the grid shorthand. |
-static CSSValue* consumeGridTrackSize(CSSParserTokenRange& range, CSSParserMode cssParserMode, TrackSizeRestriction restriction = AllowAll) |
+CSSValue* consumeGridTrackSize(CSSParserTokenRange& range, CSSParserMode cssParserMode, TrackSizeRestriction restriction) |
{ |
const CSSParserToken& token = range.peek(); |
if (restriction == AllowAll && identMatches<CSSValueAuto>(token.id())) |
@@ -3650,16 +3667,10 @@ CSSValue* CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty) |
case CSSPropertyGridTemplateAreas: |
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
return consumeGridTemplateAreas(m_range); |
+ case CSSPropertyGridAutoFlow: |
+ ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
+ return consumeGridAutoFlow(m_range); |
default: |
- CSSParserValueList valueList(m_range); |
- if (valueList.size()) { |
- m_valueList = &valueList; |
- if (CSSValue* result = legacyParseValue(unresolvedProperty)) { |
- while (!m_range.atEnd()) |
- m_range.consume(); |
- return result; |
- } |
- } |
return nullptr; |
} |
} |