Chromium Code Reviews| 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 68bfe8094181344a7dbcff8c5b65680fdaff3b7f..ff41b145a401e61f8b3fa6bdffe6cdbae38aaedc 100644 |
| --- a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp |
| +++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp |
| @@ -17,27 +17,55 @@ StyleValue* StylePropertyMap::get(const String& propertyName) |
| HeapVector<Member<StyleValue>> StylePropertyMap::getAll(const String& propertyName) |
| { |
| - return getAll(cssPropertyID(propertyName)); |
| + CSSPropertyID propertyID = cssPropertyID(propertyName); |
| + if (propertyID != CSSPropertyInvalid) { |
| + return getAll(propertyID); |
| + } |
| + // TODO(meade): Handle custom properties here. |
| + return HeapVector<Member<StyleValue>>(); |
| } |
| bool StylePropertyMap::has(const String& propertyName) |
| { |
| - return has(cssPropertyID(propertyName)); |
| + CSSPropertyID propertyID = cssPropertyID(propertyName); |
| + if (propertyID != CSSPropertyInvalid) { |
| + return has(cssPropertyID(propertyName)); |
|
Timothy Loh
2016/02/09 07:29:32
You probably meant to use propertyID here and all
meade_UTC10
2016/02/10 05:55:39
Done.
|
| + } |
| + // TODO(meade): Handle custom properties here. |
| + return false; |
| } |
| void StylePropertyMap::set(const String& propertyName, StyleValueOrStyleValueSequenceOrString& item, ExceptionState& exceptionState) |
| { |
| - set(cssPropertyID(propertyName), item, exceptionState); |
| + CSSPropertyID propertyID = cssPropertyID(propertyName); |
| + if (propertyID != CSSPropertyInvalid) { |
| + set(cssPropertyID(propertyName), item, exceptionState); |
| + return; |
| + } |
| + // TODO(meade): Handle custom properties here. |
| + exceptionState.throwTypeError("Invalid propertyName: " + propertyName); |
| } |
| void StylePropertyMap::append(const String& propertyName, StyleValueOrStyleValueSequenceOrString& item, ExceptionState& exceptionState) |
| { |
| - append(cssPropertyID(propertyName), item, exceptionState); |
| + CSSPropertyID propertyID = cssPropertyID(propertyName); |
| + if (propertyID != CSSPropertyInvalid) { |
| + append(cssPropertyID(propertyName), item, exceptionState); |
| + return; |
| + } |
| + // TODO(meade): Handle custom properties here. |
| + exceptionState.throwTypeError("Invalid propertyName: " + propertyName); |
| } |
| void StylePropertyMap::remove(const String& propertyName, ExceptionState& exceptionState) |
| { |
| - remove(cssPropertyID(propertyName), exceptionState); |
| + CSSPropertyID propertyID = cssPropertyID(propertyName); |
| + if (propertyID != CSSPropertyInvalid) { |
| + remove(cssPropertyID(propertyName), exceptionState); |
| + return; |
| + } |
| + // TODO(meade): Handle custom properties here. |
| + exceptionState.throwTypeError("Invalid propertyName: " + propertyName); |
| } |
| } // namespace blink |