Chromium Code Reviews| Index: Source/core/css/StylePropertySet.cpp |
| diff --git a/Source/core/css/StylePropertySet.cpp b/Source/core/css/StylePropertySet.cpp |
| index 3ae5c7ff49385b3ac4ce583e91f063ec13d9867f..5ff406d418f5aa58ec6c7dae5685b09135e60182 100644 |
| --- a/Source/core/css/StylePropertySet.cpp |
| +++ b/Source/core/css/StylePropertySet.cpp |
| @@ -258,21 +258,32 @@ void MutableStylePropertySet::setProperty(const CSSProperty& property, CSSProper |
| appendPrefixingVariantProperty(property); |
| } |
| +unsigned getShorthandIDForPrefixingVariant(const CSSProperty& property, CSSPropertyID prefixingVariant) |
| +{ |
| + unsigned shorthandID = 0; |
| + if (property.isSetFromShorthand()) { |
|
Julien - ping for review
2013/06/14 20:09:07
We usually prefer early returns.
if (!property.is
|
| + CSSPropertyID prefixedShorthand = prefixingVariantForPropertyId(property.shorthandID()); |
| + shorthandID = indexOfShorthandForLonghand(prefixedShorthand, matchingShorthandsForLonghand(prefixingVariant)); |
| + } |
| + return shorthandID; |
| +} |
| + |
| void MutableStylePropertySet::appendPrefixingVariantProperty(const CSSProperty& property) |
| { |
| m_propertyVector.append(property); |
| CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id()); |
| if (prefixingVariant == property.id()) |
| return; |
| - m_propertyVector.append(CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.shorthandID(), property.metadata().m_implicit)); |
| + |
| + m_propertyVector.append(CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.isSetFromShorthand(), getShorthandIDForPrefixingVariant(property, prefixingVariant), property.metadata().m_implicit)); |
| } |
| void MutableStylePropertySet::setPrefixingVariantProperty(const CSSProperty& property) |
| { |
| CSSPropertyID prefixingVariant = prefixingVariantForPropertyId(property.id()); |
| CSSProperty* toReplace = findCSSPropertyWithID(prefixingVariant); |
| - if (toReplace) |
| - *toReplace = CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.shorthandID(), property.metadata().m_implicit); |
| + if (toReplace && prefixingVariant != property.id()) |
| + *toReplace = CSSProperty(prefixingVariant, property.value(), property.isImportant(), property.isSetFromShorthand(), getShorthandIDForPrefixingVariant(property, prefixingVariant), property.metadata().m_implicit); |
| } |
| bool MutableStylePropertySet::setProperty(CSSPropertyID propertyID, CSSValueID identifier, bool important) |