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

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

Issue 1168453002: [CSSGridLayout] Switch from parentheses to brackets for grid line names (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 119ea6bf959ffa64c81bf48d7c10d1bf913d9a73..9e55d7a13c03abd3f622adea1e1180b8e9e89afa 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -3443,27 +3443,26 @@ bool CSSPropertyParser::parseSingleGridAreaLonghand(RefPtrWillBeRawPtr<CSSValue>
void CSSPropertyParser::maybeParseGridLineNames(CSSParserValueList& inputList, CSSValueList& valueList, CSSGridLineNamesValue* previousNamedAreaTrailingLineNames)
{
- if (!inputList.current() || inputList.current()->unit != CSSParserValue::ValueList)
+ if (!inputList.current() || inputList.current()->unit != CSSParserValue::Operator || inputList.current()->iValue != '[')
return;
- CSSParserValueList* identList = inputList.current()->valueList;
- if (!identList->size()) {
- inputList.next();
- return;
- }
-
- // Need to ensure the identList is at the heading index, since the parserList might have been rewound.
- identList->setCurrentIndex(0);
+ // Skip '['
+ inputList.next();
RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = previousNamedAreaTrailingLineNames;
if (!lineNames)
lineNames = CSSGridLineNamesValue::create();
- while (CSSParserValue* identValue = identList->current()) {
+
+ while (CSSParserValue* identValue = inputList.current()) {
+ if (identValue->unit == CSSParserValue::Operator && identValue->iValue == ']')
+ break;
+
if (identValue->unit != CSSPrimitiveValue::CSS_IDENT)
return;
+
RefPtrWillBeRawPtr<CSSPrimitiveValue> lineName = createPrimitiveCustomIdentValue(identValue);
lineNames->append(lineName.release());
- identList->next();
+ inputList.next();
}
if (!previousNamedAreaTrailingLineNames)
valueList.append(lineNames.release());

Powered by Google App Engine
This is Rietveld 408576698