| Index: third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
|
| index a3226026b0a924bdf64975802d7d1f65247bc9aa..585de1ad6b8ba7ed1f7cf9ce3d413f5e98cc7b28 100644
|
| --- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
|
| +++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
|
| @@ -15,43 +15,22 @@
|
|
|
| namespace blink {
|
|
|
| -StyleValue* InlineStylePropertyMap::get(CSSPropertyID propertyID)
|
| -{
|
| - StyleValueVector styleVector = getAll(propertyID);
|
| - if (styleVector.isEmpty())
|
| - return nullptr;
|
| -
|
| - return styleVector.at(0);
|
| -}
|
| -
|
| -StyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID)
|
| +StylePropertyMap::StyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID)
|
| {
|
| CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue(propertyID);
|
| if (!cssValue)
|
| return StyleValueVector();
|
|
|
| - StyleValueVector styleValueVector;
|
| -
|
| - if (!cssValue->isValueList()) {
|
| - StyleValue* styleValue = StyleValueFactory::create(propertyID, *cssValue);
|
| - if (styleValue)
|
| - styleValueVector.append(styleValue);
|
| - return styleValueVector;
|
| - }
|
| -
|
| - for (CSSValue* value : *toCSSValueList(cssValue)) {
|
| - StyleValue* styleValue = StyleValueFactory::create(propertyID, *value);
|
| - if (!styleValue) {
|
| - return StyleValueVector();
|
| - }
|
| - styleValueVector.append(styleValue);
|
| - }
|
| - return styleValueVector;
|
| + return cssValueToStyleValueVector(propertyID, *cssValue);
|
| }
|
|
|
| bool InlineStylePropertyMap::has(CSSPropertyID propertyID)
|
| {
|
| - return !getAll(propertyID).isEmpty();
|
| + CSSValue* cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue(propertyID);
|
| + if (!cssValue)
|
| + return false;
|
| +
|
| + return (!cssValue->isValueList() || toCSSValueList(cssValue)->length() > 0);
|
| }
|
|
|
| Vector<String> InlineStylePropertyMap::getProperties()
|
| @@ -97,6 +76,7 @@ void InlineStylePropertyMap::set(CSSPropertyID propertyID, StyleValueOrStyleValu
|
| ASSERT(item.isString());
|
| // TODO(meade): Implement this.
|
| exceptionState.throwTypeError("Not implemented yet");
|
| + return;
|
| }
|
| }
|
|
|
|
|