| Index: third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
|
| index 4e56ef6b250774a22471ecd668928a39b76a75f5..cd4990512f1dcbecc270d44fce709b25d511d5e7 100644
|
| --- a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
|
| +++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
|
| @@ -51,40 +51,26 @@ class StylePropertyMapIterationSource final
|
|
|
| CSSStyleValue* StylePropertyMap::get(const String& propertyName,
|
| ExceptionState& exceptionState) {
|
| - CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| - if (propertyID == CSSPropertyInvalid || propertyID == CSSPropertyVariable) {
|
| - // TODO(meade): Handle custom properties here.
|
| - exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| - return nullptr;
|
| - }
|
| -
|
| - CSSStyleValueVector styleVector = getAllInternal(propertyID);
|
| - if (styleVector.isEmpty())
|
| - return nullptr;
|
| -
|
| - return styleVector[0];
|
| + CSSStyleValueVector styleVector = getAll(propertyName, exceptionState);
|
| + return styleVector.isEmpty() ? nullptr : styleVector[0];
|
| }
|
|
|
| CSSStyleValueVector StylePropertyMap::getAll(const String& propertyName,
|
| ExceptionState& exceptionState) {
|
| CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| - if (propertyID != CSSPropertyInvalid && propertyID != CSSPropertyVariable)
|
| - return getAllInternal(propertyID);
|
| -
|
| - // TODO(meade): Handle custom properties here.
|
| - exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| - return CSSStyleValueVector();
|
| + if (propertyID == CSSPropertyInvalid) {
|
| + exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| + return CSSStyleValueVector();
|
| + }
|
| + if (propertyID == CSSPropertyVariable) {
|
| + return getAllInternal(AtomicString(propertyName), exceptionState);
|
| + }
|
| + return getAllInternal(propertyID);
|
| }
|
|
|
| bool StylePropertyMap::has(const String& propertyName,
|
| ExceptionState& exceptionState) {
|
| - CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| - if (propertyID != CSSPropertyInvalid && propertyID != CSSPropertyVariable)
|
| - return !getAllInternal(propertyID).isEmpty();
|
| -
|
| - // TODO(meade): Handle custom properties here.
|
| - exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| - return false;
|
| + return !getAll(propertyName, exceptionState).isEmpty();
|
| }
|
|
|
| void StylePropertyMap::set(const String& propertyName,
|
|
|