| Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
|
| index 248e6348211de4b237d18a57cf198ffb8ae325a8..20b6ef6130790b67c3f7686fdb93ad9ba183fb85 100644
|
| --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
|
| +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
|
| @@ -25,6 +25,7 @@
|
| #include "core/css/CSSInitialValue.h"
|
| #include "core/css/CSSPaintValue.h"
|
| #include "core/css/CSSPathValue.h"
|
| +#include "core/css/CSSPendingSubstitutionValue.h"
|
| #include "core/css/CSSPrimitiveValueMappings.h"
|
| #include "core/css/CSSQuadValue.h"
|
| #include "core/css/CSSReflectValue.h"
|
| @@ -151,8 +152,10 @@ bool CSSPropertyParser::parseValueStart(CSSPropertyID unresolvedProperty, bool i
|
|
|
| CSSParserTokenRange originalRange = m_range;
|
| CSSPropertyID propertyId = resolveCSSPropertyID(unresolvedProperty);
|
| + bool isShorthand = isShorthandProperty(propertyId);
|
|
|
| - if (isShorthandProperty(propertyId)) {
|
| + if (isShorthand) {
|
| + // Variable references will fail to parse here and will fall out to the variable ref parser below.
|
| if (parseShorthand(unresolvedProperty, important))
|
| return true;
|
| } else {
|
| @@ -165,9 +168,14 @@ bool CSSPropertyParser::parseValueStart(CSSPropertyID unresolvedProperty, bool i
|
| }
|
|
|
| if (RuntimeEnabledFeatures::cssVariablesEnabled() && CSSVariableParser::containsValidVariableReferences(originalRange)) {
|
| - // We don't expand the shorthand here because crazypants.
|
| CSSVariableReferenceValue* variable = CSSVariableReferenceValue::create(CSSVariableData::create(originalRange));
|
| - addProperty(propertyId, CSSPropertyInvalid, variable, important);
|
| +
|
| + if (isShorthand) {
|
| + CSSPendingSubstitutionValue* pendingValue = CSSPendingSubstitutionValue::create(propertyId, variable);
|
| + addExpandedPropertyForValue(propertyId, pendingValue, important);
|
| + } else {
|
| + addProperty(propertyId, CSSPropertyInvalid, variable, important);
|
| + }
|
| return true;
|
| }
|
|
|
|
|