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

Unified Diff: third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.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/SVGPreserveAspectRatio.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp b/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp
index 04c5d5a990a51bc54bb5d1afc29920b42f3936b4..5ec1b4f06e72be04ab704861bc9485675642bab8 100644
--- a/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.cpp
@@ -21,9 +21,6 @@
#include "core/svg/SVGPreserveAspectRatio.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 "platform/geometry/FloatRect.h"
@@ -151,12 +148,12 @@ bool SVGPreserveAspectRatio::parseInternal(const CharType*& ptr, const CharType*
return true;
}
-void SVGPreserveAspectRatio::setValueAsString(const String& string, ExceptionState& exceptionState)
+SVGParsingError SVGPreserveAspectRatio::setValueAsString(const String& string)
{
setDefault();
if (string.isEmpty())
- return;
+ return NoError;
bool valid = false;
if (string.is8Bit()) {
@@ -168,10 +165,7 @@ void SVGPreserveAspectRatio::setValueAsString(const String& string, ExceptionSta
const UChar* end = ptr + string.length();
valid = parseInternal(ptr, end, true);
}
-
- if (!valid) {
- exceptionState.throwDOMException(SyntaxError, "The value provided ('" + string + "') is invalid.");
- }
+ return valid ? NoError : ParsingAttributeFailedError;
}
bool SVGPreserveAspectRatio::parse(const LChar*& ptr, const LChar* end, bool validate)

Powered by Google App Engine
This is Rietveld 408576698