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

Unified Diff: third_party/WebKit/Source/core/svg/SVGNumberOptionalNumber.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/SVGNumberOptionalNumber.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGNumberOptionalNumber.cpp b/third_party/WebKit/Source/core/svg/SVGNumberOptionalNumber.cpp
index e7dad4aa2f3be4fa9019f4f102f727cf9ab19f56..6e9007612ce0e9113e41dba086f40645955f019d 100644
--- a/third_party/WebKit/Source/core/svg/SVGNumberOptionalNumber.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGNumberOptionalNumber.cpp
@@ -73,16 +73,18 @@ String SVGNumberOptionalNumber::valueAsString() const
return String::number(m_firstNumber->value()) + " " + String::number(m_secondNumber->value());
}
-void SVGNumberOptionalNumber::setValueAsString(const String& value, ExceptionState& exceptionState)
+SVGParsingError SVGNumberOptionalNumber::setValueAsString(const String& value)
{
float x, y;
+ SVGParsingError parseStatus = NoError;
if (!parseNumberOptionalNumber(value, x, y)) {
- exceptionState.throwDOMException(SyntaxError, "The value provided ('" + value + "') is invalid.");
+ parseStatus = ParsingAttributeFailedError;
x = y = 0;
}
m_firstNumber->setValue(x);
m_secondNumber->setValue(y);
+ return parseStatus;
}
void SVGNumberOptionalNumber::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*)

Powered by Google App Engine
This is Rietveld 408576698