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

Unified Diff: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
index ac6476947d2d4b96e830cd4d4c46017713f04943..9ce8c804876ceecbdc7f8c117dfd705323539658 100644
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
@@ -265,11 +265,6 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::legacyParseValue(CSSProperty
parsedValue = parseGridAutoFlow(*m_valueList);
break;
- case CSSPropertyGridTemplateAreas:
- ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
- parsedValue = parseGridTemplateAreas();
- break;
-
// Everything else is handled in CSSPropertyParser.cpp
default:
return nullptr;
@@ -342,8 +337,12 @@ bool CSSPropertyParser::parseGridTemplateRowsAndAreasAndColumns(bool important)
return false;
// Handle a template-area's row.
- if (!parseGridTemplateAreasRow(gridAreaMap, rowCount, columnCount))
+ CSSParserValue* currentValue = m_valueList->current();
+ if (!currentValue || currentValue->m_unit != CSSParserValue::String)
+ return false;
+ if (!parseGridTemplateAreasRow(currentValue->string, gridAreaMap, rowCount, columnCount))
return false;
+ m_valueList->next();
++rowCount;
// Handle template-rows's track-size.
@@ -767,13 +766,8 @@ static Vector<String> parseGridTemplateAreasColumnNames(const String& gridRowNam
return columnNames;
}
-bool CSSPropertyParser::parseGridTemplateAreasRow(NamedGridAreaMap& gridAreaMap, const size_t rowCount, size_t& columnCount)
+bool parseGridTemplateAreasRow(const String& gridRowNames, NamedGridAreaMap& gridAreaMap, const size_t rowCount, size_t& columnCount)
{
- CSSParserValue* currentValue = m_valueList->current();
- if (!currentValue || currentValue->m_unit != CSSParserValue::String)
- return false;
-
- String gridRowNames = currentValue->string;
if (gridRowNames.isEmpty() || gridRowNames.containsOnlyWhitespace())
return false;
@@ -824,33 +818,9 @@ bool CSSPropertyParser::parseGridTemplateAreasRow(NamedGridAreaMap& gridAreaMap,
currentCol = lookAheadCol - 1;
}
- m_valueList->next();
return true;
}
-PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTemplateAreas()
-{
- if (m_valueList->current() && m_valueList->current()->id == CSSValueNone) {
- m_valueList->next();
- return cssValuePool().createIdentifierValue(CSSValueNone);
- }
-
- NamedGridAreaMap gridAreaMap;
- size_t rowCount = 0;
- size_t columnCount = 0;
-
- while (m_valueList->current()) {
- if (!parseGridTemplateAreasRow(gridAreaMap, rowCount, columnCount))
- return nullptr;
- ++rowCount;
- }
-
- if (!rowCount || !columnCount)
- return nullptr;
-
- return CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount);
-}
-
PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridAutoFlow(CSSParserValueList& list)
{
// [ row | column ] || dense
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698