| Index: Source/core/css/StylePropertySet.cpp
|
| diff --git a/Source/core/css/StylePropertySet.cpp b/Source/core/css/StylePropertySet.cpp
|
| index 11b599a6d725e5e4179937ff7c6b341ce750636b..0039118da28a809b8905ab7cc4c9ec171f7f62bb 100644
|
| --- a/Source/core/css/StylePropertySet.cpp
|
| +++ b/Source/core/css/StylePropertySet.cpp
|
| @@ -137,19 +137,19 @@ MutableStylePropertySet::MutableStylePropertySet(const StylePropertySet& other)
|
|
|
| String StylePropertySet::getPropertyValue(CSSPropertyID propertyID) const
|
| {
|
| - NullableCSSValue value = getPropertyCSSValue(propertyID);
|
| + const NullableCSSValue& value = getPropertyCSSValue(propertyID);
|
| if (value)
|
| return value->cssText();
|
|
|
| return StylePropertySerializer(*this).getPropertyValue(propertyID);
|
| }
|
|
|
| -NullableCSSValue StylePropertySet::getPropertyCSSValue(CSSPropertyID propertyID) const
|
| +const NullableCSSValue StylePropertySet::getPropertyCSSValue(CSSPropertyID propertyID) const
|
| {
|
| int foundPropertyIndex = findPropertyIndex(propertyID);
|
| if (foundPropertyIndex == -1)
|
| return nullptr;
|
| - return propertyAt(foundPropertyIndex).value();
|
| + return *reinterpret_cast<const NullableCSSValue*>(&propertyAt(foundPropertyIndex).value());
|
| }
|
|
|
| DEFINE_TRACE(StylePropertySet)
|
| @@ -250,6 +250,11 @@ bool MutableStylePropertySet::setProperty(CSSPropertyID unresolvedProperty, cons
|
| return CSSParser::parseValue(this, unresolvedProperty, value, important, cssParserMode(), contextStyleSheet);
|
| }
|
|
|
| +void MutableStylePropertySet::setProperty(CSSPropertyID propertyID, const CSSPrimitiveValue& prpValue, bool important)
|
| +{
|
| + setProperty(propertyID, *reinterpret_cast<const CSSValue*>(&prpValue), important);
|
| +}
|
| +
|
| void MutableStylePropertySet::setProperty(CSSPropertyID propertyID, const CSSValue& prpValue, bool important)
|
| {
|
| StylePropertyShorthand shorthand = shorthandForProperty(propertyID);
|
| @@ -434,7 +439,7 @@ PassRefPtrWillBeRawPtr<MutableStylePropertySet> StylePropertySet::copyProperties
|
| WillBeHeapVector<CSSProperty, 256> list;
|
| list.reserveInitialCapacity(properties.size());
|
| for (unsigned i = 0; i < properties.size(); ++i) {
|
| - NullableCSSValue value = getPropertyCSSValue(properties[i]);
|
| + const NullableCSSValue& value = getPropertyCSSValue(properties[i]);
|
| if (value)
|
| list.append(CSSProperty(properties[i], *value, false));
|
| }
|
|
|