Chromium Code Reviews| Index: third_party/WebKit/Source/core/svg/SVGNumber.cpp |
| diff --git a/third_party/WebKit/Source/core/svg/SVGNumber.cpp b/third_party/WebKit/Source/core/svg/SVGNumber.cpp |
| index 3393b60c358c26454869f46837d6d3aeffad517b..a20b3642132510d7a32bb19f55378cb536a33cdb 100644 |
| --- a/third_party/WebKit/Source/core/svg/SVGNumber.cpp |
| +++ b/third_party/WebKit/Source/core/svg/SVGNumber.cpp |
| @@ -66,11 +66,11 @@ bool SVGNumber::parse(const CharType*& ptr, const CharType* end) |
| return true; |
| } |
| -void SVGNumber::setValueAsString(const String& string, ExceptionState& exceptionState) |
| +SVGParsingError SVGNumber::setValueAsString(const String& string) |
| { |
| if (string.isEmpty()) { |
| m_value = 0; |
| - return; |
| + return NoError; |
| } |
| bool valid = false; |
| @@ -85,9 +85,10 @@ void SVGNumber::setValueAsString(const String& string, ExceptionState& exception |
| } |
| if (!valid) { |
| - exceptionState.throwDOMException(SyntaxError, "The value provided ('" + string + "') is invalid."); |
| m_value = 0; |
|
pdr.
2015/12/23 04:00:08
Nit for contemplation: this isn't required, but we
fs
2015/12/23 10:04:17
Yes, I've been noticing these things here and ther
|
| + return ParsingAttributeFailedError; |
| } |
| + return NoError; |
| } |
| void SVGNumber::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*) |
| @@ -116,14 +117,13 @@ PassRefPtrWillBeRawPtr<SVGNumber> SVGNumberAcceptPercentage::clone() const |
| return create(m_value); |
| } |
| -void SVGNumberAcceptPercentage::setValueAsString(const String& string, ExceptionState& exceptionState) |
| +SVGParsingError SVGNumberAcceptPercentage::setValueAsString(const String& string) |
| { |
| - bool valid = parseNumberOrPercentage(string, m_value); |
| + if (parseNumberOrPercentage(string, m_value)) |
| + return NoError; |
| - if (!valid) { |
| - exceptionState.throwDOMException(SyntaxError, "The value provided ('" + string + "') is invalid."); |
| - m_value = 0; |
| - } |
| + m_value = 0; |
| + return ParsingAttributeFailedError; |
| } |
| SVGNumberAcceptPercentage::SVGNumberAcceptPercentage(float value) |