Chromium Code Reviews| Index: Source/core/css/CSSParser.cpp |
| diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp |
| index 431d6c3fb9d44d839c7e62002fbc49ce1104cd74..82502e5e1f7a32dc43138a4621c1e349486bb67f 100644 |
| --- a/Source/core/css/CSSParser.cpp |
| +++ b/Source/core/css/CSSParser.cpp |
| @@ -1415,12 +1415,32 @@ void CSSParser::addPropertyWithPrefixingVariant(CSSPropertyID propId, PassRefPtr |
| CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(propId); |
| if (prefixingVariant == propId) |
| return; |
| - addProperty(prefixingVariant, val.release(), important, implicit); |
| + |
| + if (m_currentShorthand) { |
| + // We can't use ShorthandScope here as we can already be inside one (e.g we are parsing CSSTransition). |
| + m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand); |
| + addProperty(prefixingVariant, val.release(), important, implicit); |
| + m_currentShorthand = prefixingVariantForPropertyId(m_currentShorthand); |
|
Julien - ping for review
2013/06/10 23:29:57
Do we really need to reset m_currentShorthand befo
|
| + } else { |
| + addProperty(prefixingVariant, val.release(), important, implicit); |
| + } |
| } |
| void CSSParser::addProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bool important, bool implicit) |
| { |
| - m_parsedProperties.append(CSSProperty(propId, value, important, m_currentShorthand, m_implicitShorthand || implicit)); |
| + CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? toCSSPrimitiveValue(value.get()) : 0; |
| + // This property doesn't belong to a shorthand or is a CSS variable (which will be resolved later). |
| + if (!m_currentShorthand || (primitiveValue && primitiveValue->isVariableName())) { |
| + m_parsedProperties.append(CSSProperty(propId, value, important, false, CSSPropertyInvalid, m_implicitShorthand || implicit)); |
| + return; |
| + } |
| + |
| + const Vector<StylePropertyShorthand> shorthands = matchingShorthandsForLonghand(propId); |
| + // The longhand does not belong to multiple shorthands. |
| + if (shorthands.size() == 1) |
| + m_parsedProperties.append(CSSProperty(propId, value, important, true, CSSPropertyInvalid, m_implicitShorthand || implicit)); |
| + else |
| + m_parsedProperties.append(CSSProperty(propId, value, important, true, indexOfShorthandForLonghand(m_currentShorthand, shorthands), m_implicitShorthand || implicit)); |
| } |
| void CSSParser::rollbackLastProperties(int num) |