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

Unified Diff: third_party/WebKit/Source/core/svg/SVGAngleTearOff.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/SVGAngleTearOff.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp b/third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp
index d20417cfc65dd707bd16e1c4e14cc994ce87d9b7..ee043be0c9bf62eebd295cb999d37db13d95ebcc 100644
--- a/third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGAngleTearOff.cpp
@@ -114,10 +114,13 @@ void SVGAngleTearOff::setValueAsString(const String& value, ExceptionState& exce
String oldValue = target()->valueAsString();
- target()->setValueAsString(value, exceptionState);
+ SVGParsingError status = target()->setValueAsString(value);
- if (!exceptionState.hadException() && !hasExposedAngleUnit()) {
- target()->setValueAsString(oldValue, ASSERT_NO_EXCEPTION); // rollback to old value
pdr. 2015/12/23 04:00:08 Is this rollback behavior spec'd? Not a big deal e
fs 2015/12/23 10:04:17 As I recall this was subject of discussion in the
fs 2015/12/23 12:54:47 After some mild digging I found: http://www.w3.or
+ if (status == NoError && !hasExposedAngleUnit()) {
+ target()->setValueAsString(oldValue); // rollback to old value
+ status = ParsingAttributeFailedError;
+ }
+ if (status != NoError) {
exceptionState.throwDOMException(SyntaxError, "The value provided ('" + value + "') is invalid.");
return;
}

Powered by Google App Engine
This is Rietveld 408576698