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 910db6378df34c11b7fa85e5d53bfbd53b4bd523..715afc267d7435cb565251458a315e7a25ae38c7 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
@@ -3218,6 +3218,27 @@ static PassRefPtrWillBeRawPtr<CSSValue> consumeGridTemplatesRowsOrColumns(CSSPar |
return consumeGridTrackList(range, cssParserMode); |
} |
+static PassRefPtrWillBeRawPtr<CSSValue> consumeGridTemplateAreas(CSSParserTokenRange& range) |
+{ |
+ if (range.peek().id() == CSSValueNone) |
+ return consumeIdent(range); |
+ |
+ NamedGridAreaMap gridAreaMap; |
+ size_t rowCount = 0; |
+ size_t columnCount = 0; |
+ |
+ while (range.peek().type() == StringToken) { |
+ if (!parseGridTemplateAreasRow(range.consumeIncludingWhitespace().value(), gridAreaMap, rowCount, columnCount)) |
+ return nullptr; |
+ ++rowCount; |
+ } |
+ |
+ if (rowCount == 0) |
+ return nullptr; |
+ ASSERT(columnCount); |
+ return CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount); |
+} |
+ |
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty) |
{ |
CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); |
@@ -3594,6 +3615,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSProperty |
case CSSPropertyGridTemplateRows: |
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
return consumeGridTemplatesRowsOrColumns(m_range, m_context.mode()); |
+ case CSSPropertyGridTemplateAreas: |
+ ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
+ return consumeGridTemplateAreas(m_range); |
default: |
CSSParserValueList valueList(m_range); |
if (valueList.size()) { |