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

Unified Diff: third_party/WebKit/Source/core/svg/SVGAngle.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/SVGAngle.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGAngle.cpp b/third_party/WebKit/Source/core/svg/SVGAngle.cpp
index 991acb416a822b06681d8426c6750500f71ca8f6..282f645e30d21f1d346803c9784b34e2b8449d21 100644
--- a/third_party/WebKit/Source/core/svg/SVGAngle.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAngle.cpp
@@ -21,9 +21,6 @@
#include "core/svg/SVGAngle.h"
-#include "bindings/core/v8/ExceptionState.h"
-#include "bindings/core/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/ExceptionCode.h"
#include "core/svg/SVGAnimationElement.h"
#include "core/svg/SVGParserUtilities.h"
#include "wtf/MathExtras.h"
@@ -236,22 +233,22 @@ static bool parseValue(const String& value, float& valueInSpecifiedUnits, SVGAng
return true;
}
-void SVGAngle::setValueAsString(const String& value, ExceptionState& exceptionState)
+SVGParsingError SVGAngle::setValueAsString(const String& value)
{
if (value.isEmpty()) {
newValueSpecifiedUnits(SVG_ANGLETYPE_UNSPECIFIED, 0);
- return;
+ return NoError;
}
if (value == "auto") {
newValueSpecifiedUnits(SVG_ANGLETYPE_UNSPECIFIED, 0);
m_orientType->setEnumValue(SVGMarkerOrientAuto);
- return;
+ return NoError;
}
if (value == "auto-start-reverse") {
newValueSpecifiedUnits(SVG_ANGLETYPE_UNSPECIFIED, 0);
m_orientType->setEnumValue(SVGMarkerOrientAutoStartReverse);
- return;
+ return NoError;
}
float valueInSpecifiedUnits = 0;
@@ -259,14 +256,13 @@ void SVGAngle::setValueAsString(const String& value, ExceptionState& exceptionSt
bool success = value.is8Bit() ? parseValue<LChar>(value, valueInSpecifiedUnits, unitType)
: parseValue<UChar>(value, valueInSpecifiedUnits, unitType);
- if (!success) {
- exceptionState.throwDOMException(SyntaxError, "The value provided ('" + value + "') is invalid.");
- return;
- }
+ if (!success)
+ return ParsingAttributeFailedError;
m_orientType->setEnumValue(SVGMarkerOrientAngle);
m_unitType = unitType;
m_valueInSpecifiedUnits = valueInSpecifiedUnits;
+ return NoError;
}
void SVGAngle::newValueSpecifiedUnits(SVGAngleType unitType, float valueInSpecifiedUnits)

Powered by Google App Engine
This is Rietveld 408576698