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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp

Issue 1829723002: Move grid-template-areas into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 9 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/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()) {

Powered by Google App Engine
This is Rietveld 408576698