Chromium Code Reviews| 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..73695208086be4898684353f0e0c81fd7907b195 100644 |
| --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
| +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
| @@ -3218,6 +3218,26 @@ 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 || !columnCount) |
|
Timothy Loh
2016/03/31 00:22:46
Might be able to ASSERT(columnCount) below this ch
|
| + return nullptr; |
| + return CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount); |
| +} |
| + |
| PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty) |
| { |
| CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); |
| @@ -3594,6 +3614,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()) { |