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

Unified Diff: Source/core/css/parser/BisonCSSParser-in.cpp

Issue 179383003: [CSS Grid Layout] Disallow using <ident> and function names as <custom-ident> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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/BisonCSSParser-in.cpp
diff --git a/Source/core/css/parser/BisonCSSParser-in.cpp b/Source/core/css/parser/BisonCSSParser-in.cpp
index 73a5712156f54c545bdbdce012b57830ce16695a..e84bd49a08ee68862b248716903e3a090dd08a00 100644
--- a/Source/core/css/parser/BisonCSSParser-in.cpp
+++ b/Source/core/css/parser/BisonCSSParser-in.cpp
@@ -4664,19 +4664,24 @@ bool CSSPropertyParser::parseSingleGridAreaLonghand(RefPtrWillBeRawPtr<CSSValue>
return true;
}
-void CSSPropertyParser::parseGridLineNames(CSSParserValueList* parserValueList, CSSValueList& valueList)
+bool CSSPropertyParser::parseGridLineNames(CSSParserValueList* parserValueList, CSSValueList& valueList)
{
ASSERT(parserValueList->current() && parserValueList->current()->unit == CSSParserValue::ValueList);
CSSParserValueList* identList = parserValueList->current()->valueList;
if (!identList->size()) {
parserValueList->next();
- return;
+ return true;
}
RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create();
while (CSSParserValue* identValue = identList->current()) {
ASSERT(identValue->unit == CSSPrimitiveValue::CSS_IDENT);
+ if (equalIgnoringCase(identValue->string, "auto")
+ || equalIgnoringCase(identValue->string, "minmax")
+ || equalIgnoringCase(identValue->string, "subgrid"))
Julien - ping for review 2014/03/01 00:42:21 subgrid will be moved to level 2 (http://lists.w3.
+ return false;
+
RefPtrWillBeRawPtr<CSSPrimitiveValue> lineName = createPrimitiveStringValue(identValue);
lineNames->append(lineName.release());
identList->next();
@@ -4684,6 +4689,7 @@ void CSSPropertyParser::parseGridLineNames(CSSParserValueList* parserValueList,
valueList.append(lineNames.release());
parserValueList->next();
+ return true;
}
bool CSSPropertyParser::parseGridTrackList(CSSPropertyID propId, bool important)
@@ -4702,8 +4708,10 @@ bool CSSPropertyParser::parseGridTrackList(CSSPropertyID propId, bool important)
RefPtrWillBeRawPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
// Handle leading <ident>*.
value = m_valueList->current();
- if (value && value->unit == CSSParserValue::ValueList)
- parseGridLineNames(m_valueList.get(), *values);
+ if (value && value->unit == CSSParserValue::ValueList) {
+ if (!parseGridLineNames(m_valueList.get(), *values))
+ return false;
+ }
bool seenTrackSizeOrRepeatFunction = false;
while (CSSParserValue* currentValue = m_valueList->current()) {
@@ -4720,8 +4728,10 @@ bool CSSPropertyParser::parseGridTrackList(CSSPropertyID propId, bool important)
}
// This will handle the trailing <ident>* in the grammar.
value = m_valueList->current();
- if (value && value->unit == CSSParserValue::ValueList)
- parseGridLineNames(m_valueList.get(), *values);
+ if (value && value->unit == CSSParserValue::ValueList) {
+ if (!parseGridLineNames(m_valueList.get(), *values))
+ return false;
+ }
}
// We should have found a <track-size> or else it is not a valid <track-list>
@@ -4746,8 +4756,10 @@ bool CSSPropertyParser::parseGridTrackRepeatFunction(CSSValueList& list)
// Handle leading <ident>*.
CSSParserValue* currentValue = arguments->current();
- if (currentValue && currentValue->unit == CSSParserValue::ValueList)
- parseGridLineNames(arguments, *repeatedValues);
+ if (currentValue && currentValue->unit == CSSParserValue::ValueList) {
+ if (!parseGridLineNames(arguments, *repeatedValues))
+ return false;
+ }
while (arguments->current()) {
RefPtrWillBeRawPtr<CSSValue> trackSize = parseGridTrackSize(*arguments);
@@ -4758,8 +4770,10 @@ bool CSSPropertyParser::parseGridTrackRepeatFunction(CSSValueList& list)
// This takes care of any trailing <ident>* in the grammar.
currentValue = arguments->current();
- if (currentValue && currentValue->unit == CSSParserValue::ValueList)
- parseGridLineNames(arguments, *repeatedValues);
+ if (currentValue && currentValue->unit == CSSParserValue::ValueList) {
+ if (!parseGridLineNames(arguments, *repeatedValues))
+ return false;
+ }
}
for (size_t i = 0; i < repetitions; ++i) {

Powered by Google App Engine
This is Rietveld 408576698