Index: third_party/WebKit/Source/core/svg/SVGAnimatedEnumerationBase.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimatedEnumerationBase.cpp b/third_party/WebKit/Source/core/svg/SVGAnimatedEnumerationBase.cpp |
index 394e71629da21ba5082f6b811c7a4ae1a7ac0997..0e8c333076cc4157ef48183edeeb52e2386e49e4 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGAnimatedEnumerationBase.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGAnimatedEnumerationBase.cpp |
@@ -29,7 +29,6 @@ |
*/ |
#include "config.h" |
- |
#include "core/svg/SVGAnimatedEnumerationBase.h" |
#include "core/svg/SVGElement.h" |
@@ -47,9 +46,17 @@ void SVGAnimatedEnumerationBase::setBaseVal(unsigned short value, ExceptionState |
return; |
} |
- baseValue()->setValue(value, exceptionState); |
- if (exceptionState.hadException()) |
+ if (!value) { |
+ exceptionState.throwTypeError("The enumeration value provided is 0, which is not settable."); |
+ return; |
+ } |
+ |
+ if (value > baseValue()->maxExposedEnumValue()) { |
+ exceptionState.throwTypeError("The enumeration value provided (" + String::number(value) + ") is larger than the largest allowed value (" + String::number(baseValue()->maxExposedEnumValue()) + ")."); |
return; |
+ } |
+ |
+ baseValue()->setValue(value); |
m_baseValueUpdated = true; |