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

Unified Diff: third_party/WebKit/Source/core/svg/SVGEnumeration.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/SVGEnumeration.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGEnumeration.cpp b/third_party/WebKit/Source/core/svg/SVGEnumeration.cpp
index e6ad2d6837189544ed0f770fb6945339a5bdcc10..ed579acf759a213c14c0cb0031ed9957029b7687 100644
--- a/third_party/WebKit/Source/core/svg/SVGEnumeration.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGEnumeration.cpp
@@ -30,9 +30,6 @@
#include "core/svg/SVGEnumeration.h"
-#include "bindings/core/v8/ExceptionState.h"
-#include "bindings/core/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/ExceptionCode.h"
#include "core/svg/SVGAnimationElement.h"
namespace blink {
@@ -46,7 +43,7 @@ SVGEnumerationBase::~SVGEnumerationBase()
PassRefPtrWillBeRawPtr<SVGPropertyBase> SVGEnumerationBase::cloneForAnimation(const String& value) const
{
RefPtrWillBeRawPtr<SVGEnumerationBase> svgEnumeration = clone();
- svgEnumeration->setValueAsString(value, IGNORE_EXCEPTION);
+ svgEnumeration->setValueAsString(value);
return svgEnumeration.release();
}
@@ -67,7 +64,7 @@ void SVGEnumerationBase::setValue(unsigned short value)
notifyChange();
}
-void SVGEnumerationBase::setValueAsString(const String& string, ExceptionState& exceptionState)
+SVGParsingError SVGEnumerationBase::setValueAsString(const String& string)
{
for (const auto& entry : m_entries) {
if (string == entry.second) {
@@ -75,12 +72,12 @@ void SVGEnumerationBase::setValueAsString(const String& string, ExceptionState&
ASSERT(entry.first);
m_value = entry.first;
notifyChange();
- return;
+ return NoError;
}
}
- exceptionState.throwDOMException(SyntaxError, "The value provided ('" + string + "') is invalid.");
notifyChange();
+ return ParsingAttributeFailedError;
}
void SVGEnumerationBase::add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*)

Powered by Google App Engine
This is Rietveld 408576698