Chromium Code Reviews| 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 8c9d1e0e22f86c8fa1b84bdb59ab665e7f70f37e..125c93d33eef059ed9bad24edfffdf30399bcaa6 100644 |
| --- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp |
| +++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp |
| @@ -15,17 +15,6 @@ |
| namespace blink { |
| -StyleValue* InlineStylePropertyMap::get(CSSPropertyID propertyID) |
| -{ |
| - ASSERT(propertyID != CSSPropertyInvalid); |
| - |
| - StyleValueVector styleVector = getAll(propertyID); |
| - if (styleVector.isEmpty()) |
| - return nullptr; |
| - |
| - return styleVector.at(0); |
| -} |
| - |
| StyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID) |
| { |
| ASSERT(propertyID != CSSPropertyInvalid); |
| @@ -34,28 +23,18 @@ StyleValueVector InlineStylePropertyMap::getAll(CSSPropertyID propertyID) |
| if (!cssValue) |
| return StyleValueVector(); |
| - StyleValueVector styleValueVector; |
| - |
| - if (!cssValue->isValueList()) { |
| - StyleValue* styleValue = StyleValueFactory::create(propertyID, *cssValue); |
| - if (styleValue) |
| - styleValueVector.append(styleValue); |
| - return styleValueVector; |
| - } |
| - |
| - for (auto& value : *toCSSValueList(cssValue.get())) { |
| - StyleValue* styleValue = StyleValueFactory::create(propertyID, *value); |
| - if (styleValue) |
| - styleValueVector.append(styleValue); |
| - } |
| - |
| - return styleValueVector; |
| + return cssValueToStyleValueVector(propertyID, *cssValue); |
| } |
| bool InlineStylePropertyMap::has(CSSPropertyID propertyID) |
| { |
| ASSERT(propertyID != CSSPropertyInvalid); |
| - return !getAll(propertyID).isEmpty(); |
| + |
| + RefPtrWillBeRawPtr<CSSValue> cssValue = m_ownerElement->ensureMutableInlineStyle().getPropertyCSSValue(propertyID); |
| + if (!cssValue) |
| + return false; |
| + |
| + return (!cssValue->isValueList() || toCSSValueList(cssValue)->length() > 0); |
|
Timothy Loh
2016/03/31 06:59:25
CSSValueLists are never empty (if you're setting e
meade_UTC10
2016/04/04 03:32:41
Acknowledged. Seems best to look at that case thou
Timothy Loh
2016/04/15 04:16:07
Why would this function care about whether the val
|
| } |
| Vector<String> InlineStylePropertyMap::getProperties() |