Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: third_party/WebKit/Source/core/svg/SVGInteger.cpp

Issue 1544673003: Refactor propagation of parsing errors for SVG attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 6c822b9054bc487da5988a48ea0e0ff637c1767f..8ccddc5a855811e026c11055afdbce620dac8881 100644
--- a/third_party/WebKit/Source/core/svg/SVGInteger.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGInteger.cpp
@@ -29,8 +29,8 @@
*/
#include "core/svg/SVGInteger.h"
-#include "core/html/parser/HTMLParserIdioms.h"
+#include "core/html/parser/HTMLParserIdioms.h"
#include "core/svg/SVGAnimationElement.h"
namespace blink {
@@ -50,20 +50,21 @@ String SVGInteger::valueAsString() const
return String::number(m_value);
}
-void SVGInteger::setValueAsString(const String& string, ExceptionState& exceptionState)
+SVGParsingError SVGInteger::setValueAsString(const String& string)
{
if (string.isEmpty()) {
m_value = 0;
- return;
+ return NoError;
}
bool valid = true;
m_value = stripLeadingAndTrailingHTMLSpaces(string).toIntStrict(&valid);
if (!valid) {
- exceptionState.throwDOMException(SyntaxError, "The value provided ('" + string + "') is invalid.");
m_value = 0;
+ return ParsingAttributeFailedError;
}
+ return NoError;
}
void SVGInteger::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*)

Powered by Google App Engine
This is Rietveld 408576698