Skip to content

Commit

Permalink
* 修复某些网站css引起的崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
weolar committed Jan 1, 2020
1 parent de5fd39 commit 8d81a24
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import
CSSParserValueList* valueList, const CSSParserContext& context,
WillBeHeapVector<CSSProperty, 256>& parsedProperties, StyleRule::Type ruleType)
{
if (!valueList->size())
return false; // Parser error

int parsedPropertiesSize = parsedProperties.size();

CSSPropertyParser parser(valueList, context, parsedProperties, ruleType);
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 8d81a24

Please sign in to comment.