From 8d81a24fdaef4d6b9808e9263a6239fc006029db Mon Sep 17 00:00:00 2001 From: weolar <405360001@qq.com> Date: Wed, 1 Jan 2020 14:13:04 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E7=BD=91=E7=AB=99css=E5=BC=95=E8=B5=B7=E7=9A=84=E5=B4=A9?= =?UTF-8?q?=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/core/css/parser/CSSPropertyParser.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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)) {