| 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..5f4bcc3cd22f339823ee21d6b6b19639906215c4 100644
|
| --- a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
|
| +++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
|
| @@ -10,34 +10,70 @@
|
|
|
| namespace blink {
|
|
|
| -StyleValue* StylePropertyMap::get(const String& propertyName)
|
| +StyleValue* StylePropertyMap::get(const String& propertyName, ExceptionState& exceptionState)
|
| {
|
| - return get(cssPropertyID(propertyName));
|
| + CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| + if (propertyID != CSSPropertyInvalid)
|
| + return get(propertyID);
|
| +
|
| + // TODO(meade): Handle custom properties here.
|
| + exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| + return nullptr;
|
| }
|
|
|
| -HeapVector<Member<StyleValue>> StylePropertyMap::getAll(const String& propertyName)
|
| +HeapVector<Member<StyleValue>> StylePropertyMap::getAll(const String& propertyName, ExceptionState& exceptionState)
|
| {
|
| - return getAll(cssPropertyID(propertyName));
|
| + CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| + if (propertyID != CSSPropertyInvalid)
|
| + return getAll(propertyID);
|
| +
|
| + // TODO(meade): Handle custom properties here.
|
| + exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| + return HeapVector<Member<StyleValue>>();
|
| }
|
|
|
| -bool StylePropertyMap::has(const String& propertyName)
|
| +bool StylePropertyMap::has(const String& propertyName, ExceptionState& exceptionState)
|
| {
|
| - return has(cssPropertyID(propertyName));
|
| + CSSPropertyID propertyID = cssPropertyID(propertyName);
|
| + if (propertyID != CSSPropertyInvalid)
|
| + return has(propertyID);
|
| +
|
| + // TODO(meade): Handle custom properties here.
|
| + exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| + 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(propertyID, 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(propertyID, 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(propertyID, exceptionState);
|
| + return;
|
| + }
|
| + // TODO(meade): Handle custom properties here.
|
| + exceptionState.throwTypeError("Invalid propertyName: " + propertyName);
|
| }
|
|
|
| } // namespace blink
|
|
|