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

Unified Diff: Source/core/svg/SVGAngleTearOff.cpp

Issue 303263008: [SVG2] Add support for the 'turn' unit in <angle>. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixups for MathExtras Created 6 years, 6 months 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
« no previous file with comments | « Source/core/svg/SVGAngleTearOff.h ('k') | Source/wtf/MathExtras.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAngleTearOff.cpp
diff --git a/Source/core/svg/SVGAngleTearOff.cpp b/Source/core/svg/SVGAngleTearOff.cpp
index 8a5f832ace8e6ee456c1aa82d5aebe6f3d21c665..33145fce03db9f490deee4cff18a76626afd1fed 100644
--- a/Source/core/svg/SVGAngleTearOff.cpp
+++ b/Source/core/svg/SVGAngleTearOff.cpp
@@ -32,6 +32,7 @@
#include "core/svg/SVGAngleTearOff.h"
#include "bindings/v8/ExceptionState.h"
+#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "core/dom/ExceptionCode.h"
namespace WebCore {
@@ -108,7 +109,16 @@ void SVGAngleTearOff::setValueAsString(const String& value, ExceptionState& exce
return;
}
+ String oldValue = target()->valueAsString();
+
target()->setValueAsString(value, exceptionState);
+
+ if (!exceptionState.hadException() && !hasExposedAngleUnit()) {
+ target()->setValueAsString(oldValue, ASSERT_NO_EXCEPTION); // rollback to old value
+ exceptionState.throwDOMException(SyntaxError, "The value provided ('" + value + "') is invalid.");
+ return;
+ }
+
commitChange();
}
« no previous file with comments | « Source/core/svg/SVGAngleTearOff.h ('k') | Source/wtf/MathExtras.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698