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

Unified Diff: third_party/WebKit/Source/core/svg/SVGMatrixTearOff.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/SVGMatrixTearOff.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGMatrixTearOff.cpp b/third_party/WebKit/Source/core/svg/SVGMatrixTearOff.cpp
index bc157eff7b77bd4ec50ab45320c97e4d6fe023d0..c2a28840b22a20fb54360be9642ed2e9f5af8aab 100644
--- a/third_party/WebKit/Source/core/svg/SVGMatrixTearOff.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGMatrixTearOff.cpp
@@ -77,7 +77,7 @@ void SVGMatrixTearOff::commitChange()
void SVGMatrixTearOff::set##ATTRIBUTE(double f, ExceptionState& exceptionState) \
{ \
if (m_contextTransform && m_contextTransform->isImmutable()) { \
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only."); \
+ SVGPropertyTearOffBase::throwReadOnly(exceptionState); \
return; \
} \
mutableValue()->set##ATTRIBUTE(f); \
@@ -158,18 +158,19 @@ SVGMatrixTearOff* SVGMatrixTearOff::multiply(SVGMatrixTearOff* other)
SVGMatrixTearOff* SVGMatrixTearOff::inverse(ExceptionState& exceptionState)
{
- AffineTransform transform = value().inverse();
- if (!value().isInvertible())
+ if (!value().isInvertible()) {
exceptionState.throwDOMException(InvalidStateError, "The matrix is not invertible.");
-
- return create(transform);
+ return nullptr;
+ }
+ return create(value().inverse());
}
SVGMatrixTearOff* SVGMatrixTearOff::rotateFromVector(double x, double y, ExceptionState& exceptionState)
{
- if (!x || !y)
+ if (!x || !y) {
exceptionState.throwDOMException(InvalidAccessError, "Arguments cannot be zero.");
-
+ return nullptr;
+ }
AffineTransform copy = value();
copy.rotateFromVector(x, y);
return create(copy);
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGMatrixTearOff.h ('k') | third_party/WebKit/Source/core/svg/SVGNumberTearOff.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698