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

Unified Diff: third_party/WebKit/Source/core/svg/SVGTransformTearOff.cpp

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/SVGTransformTearOff.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGTransformTearOff.cpp b/third_party/WebKit/Source/core/svg/SVGTransformTearOff.cpp
index c97c6afd33ff68cb4e9f657d142c3b9061aca5fe..7ac5b81ffa785009a89cbd4458f8910b9f75645f 100644
--- a/third_party/WebKit/Source/core/svg/SVGTransformTearOff.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGTransformTearOff.cpp
@@ -30,8 +30,6 @@
#include "core/svg/SVGTransformTearOff.h"
-#include "bindings/core/v8/ExceptionState.h"
-#include "core/dom/ExceptionCode.h"
#include "core/svg/SVGElement.h"
namespace blink {
@@ -53,20 +51,17 @@ DEFINE_TRACE(SVGTransformTearOff)
SVGMatrixTearOff* SVGTransformTearOff::matrix()
{
- if (!m_matrixTearoff) {
+ if (!m_matrixTearoff)
m_matrixTearoff = SVGMatrixTearOff::create(this);
- }
-
return m_matrixTearoff.get();
}
void SVGTransformTearOff::setMatrix(SVGMatrixTearOff* matrix, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ throwReadOnly(exceptionState);
return;
}
-
target()->setMatrix(matrix->value());
commitChange();
}
@@ -74,10 +69,9 @@ void SVGTransformTearOff::setMatrix(SVGMatrixTearOff* matrix, ExceptionState& ex
void SVGTransformTearOff::setTranslate(float tx, float ty, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ throwReadOnly(exceptionState);
return;
}
-
target()->setTranslate(tx, ty);
commitChange();
}
@@ -85,10 +79,9 @@ void SVGTransformTearOff::setTranslate(float tx, float ty, ExceptionState& excep
void SVGTransformTearOff::setScale(float sx, float sy, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ throwReadOnly(exceptionState);
return;
}
-
target()->setScale(sx, sy);
commitChange();
}
@@ -96,10 +89,9 @@ void SVGTransformTearOff::setScale(float sx, float sy, ExceptionState& exception
void SVGTransformTearOff::setRotate(float angle, float cx, float cy, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ throwReadOnly(exceptionState);
return;
}
-
target()->setRotate(angle, cx, cy);
commitChange();
}
@@ -107,10 +99,9 @@ void SVGTransformTearOff::setRotate(float angle, float cx, float cy, ExceptionSt
void SVGTransformTearOff::setSkewX(float x, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ throwReadOnly(exceptionState);
return;
}
-
target()->setSkewX(x);
commitChange();
}
@@ -118,10 +109,9 @@ void SVGTransformTearOff::setSkewX(float x, ExceptionState& exceptionState)
void SVGTransformTearOff::setSkewY(float y, ExceptionState& exceptionState)
{
if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ throwReadOnly(exceptionState);
return;
}
-
target()->setSkewY(y);
commitChange();
}

Powered by Google App Engine
This is Rietveld 408576698