Index: third_party/WebKit/Source/core/svg/SVGInteger.cpp |
diff --git a/third_party/WebKit/Source/core/svg/SVGInteger.cpp b/third_party/WebKit/Source/core/svg/SVGInteger.cpp |
index efb998050f82cc85c88c72c7cf10f2ee771ae59c..4586c976779ebb67dc39a958b6390fbb871b2b7b 100644 |
--- a/third_party/WebKit/Source/core/svg/SVGInteger.cpp |
+++ b/third_party/WebKit/Source/core/svg/SVGInteger.cpp |
@@ -52,19 +52,15 @@ String SVGInteger::valueAsString() const |
SVGParsingError SVGInteger::setValueAsString(const String& string) |
{ |
- if (string.isEmpty()) { |
- m_value = 0; |
+ m_value = 0; |
+ |
+ if (string.isEmpty()) |
return SVGParseStatus::NoError; |
- } |
bool valid = true; |
m_value = stripLeadingAndTrailingHTMLSpaces(string).toIntStrict(&valid); |
- |
- if (!valid) { |
- m_value = 0; |
- return SVGParseStatus::ParsingFailed; |
- } |
- return SVGParseStatus::NoError; |
+ // toIntStrict returns 0 if valid == false. |
+ return valid ? SVGParseStatus::NoError : SVGParseStatus::ExpectedInteger; |
} |
void SVGInteger::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*) |