diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp index b4e1b014ec..22c0234311 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp @@ -98,6 +98,9 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import CSSParserValueList* valueList, const CSSParserContext& context, WillBeHeapVector& parsedProperties, StyleRule::Type ruleType) { + if (!valueList->size()) + return false; // Parser error + int parsedPropertiesSize = parsedProperties.size(); CSSPropertyParser parser(valueList, context, parsedProperties, ruleType); @@ -444,11 +447,11 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import int num = inShorthand() ? 1 : m_valueList->size(); - if (RuntimeEnabledFeatures::cssVariablesEnabled() && value->id == CSSValueInternalVariableValue) { - // We don't expand the shorthand here because crazypants. - m_parsedProperties.append(CSSProperty(propId, CSSVariableReferenceValue::create(value->variableData), important, false, 0, m_implicitShorthand)); - m_valueList->next(); - return true; + if (RuntimeEnabledFeatures::cssVariablesEnabled() && value->id == CSSValueInternalVariableValue) { + // We don't expand the shorthand here because crazypants. + m_parsedProperties.append(CSSProperty(propId, CSSVariableReferenceValue::create(value->variableData), important, false, 0, m_implicitShorthand)); + m_valueList->next(); + return true; } if (CSSParserFastPaths::isKeywordPropertyID(propId)) {