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

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: Rebase 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..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()) {

Powered by Google App Engine
This is Rietveld 408576698