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

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: review fixes 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..b7556242bd8b1a891cde1bf70ae4814b6c0d2549 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 old = target()->valueAsString();
fs 2014/06/11 07:29:07 Nit: s/old/oldValue/ (or something)
Erik Dahlström (inactive) 2014/06/11 08:04:25 Done.
+
target()->setValueAsString(value, exceptionState);
+
+ if (!exceptionState.hadException() && !hasExposedAngleUnit()) {
+ target()->setValueAsString(old, IGNORE_EXCEPTION); // rollback to old value
fs 2014/06/11 07:29:07 Nit: ASSERT_NO_EXCEPTION might be even better?
Erik Dahlström (inactive) 2014/06/11 08:04:25 Done.
+ 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