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

Unified Diff: third_party/WebKit/Source/core/svg/SVGStringListTearOff.h

Issue 2357463002: Consolidate read-only exception throwing for SVG*TearOffs (Closed)
Patch Set: Baseline updates Created 4 years, 3 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
Index: third_party/WebKit/Source/core/svg/SVGStringListTearOff.h
diff --git a/third_party/WebKit/Source/core/svg/SVGStringListTearOff.h b/third_party/WebKit/Source/core/svg/SVGStringListTearOff.h
index db15f2d70ad5b6a087850f9823119cfb58510a62..f9909683be6fe3f83762e3b9c65e4be2ea405c81 100644
--- a/third_party/WebKit/Source/core/svg/SVGStringListTearOff.h
+++ b/third_party/WebKit/Source/core/svg/SVGStringListTearOff.h
@@ -31,7 +31,7 @@
#ifndef SVGStringListTearOff_h
#define SVGStringListTearOff_h
-#include "core/dom/ExceptionCode.h"
+#include "bindings/core/v8/ScriptWrappable.h"
#include "core/svg/SVGStringList.h"
#include "core/svg/properties/SVGPropertyTearOff.h"
@@ -56,10 +56,9 @@ public:
void clear(ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The object is read-only.");
+ throwReadOnly(exceptionState);
return;
}
-
target()->clear();
commitChange();
}
@@ -67,13 +66,11 @@ public:
String initialize(const String& item, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The object is read-only.");
+ throwReadOnly(exceptionState);
return String();
}
-
target()->initialize(item);
commitChange();
-
return item;
}
@@ -85,26 +82,22 @@ public:
String insertItemBefore(const String& item, unsigned long index, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The object is read-only.");
+ throwReadOnly(exceptionState);
return String();
}
-
target()->insertItemBefore(item, index);
commitChange();
-
return item;
}
String replaceItem(const String& item, unsigned long index, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The object is read-only.");
+ throwReadOnly(exceptionState);
return String();
}
-
target()->replaceItem(item, index, exceptionState);
commitChange();
-
return item;
}
@@ -117,26 +110,22 @@ public:
String removeItem(unsigned long index, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The object is read-only.");
+ throwReadOnly(exceptionState);
return String();
}
-
String removedItem = target()->removeItem(index, exceptionState);
commitChange();
-
return removedItem;
}
String appendItem(const String& item, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The object is read-only.");
+ throwReadOnly(exceptionState);
return String();
}
-
target()->appendItem(item);
commitChange();
-
return item;
}
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGRectTearOff.cpp ('k') | third_party/WebKit/Source/core/svg/SVGTransformListTearOff.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698