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

Unified Diff: third_party/WebKit/Source/core/svg/SVGPreserveAspectRatioTearOff.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/SVGPreserveAspectRatioTearOff.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatioTearOff.cpp b/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatioTearOff.cpp
index 059f35b388e618bfc840908ea092def40544027c..708d7d3347f55331e3a6eccef3066a7680a6503f 100644
--- a/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatioTearOff.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatioTearOff.cpp
@@ -38,30 +38,28 @@ namespace blink {
void SVGPreserveAspectRatioTearOff::setAlign(unsigned short align, ExceptionState& exceptionState)
{
- if (align == kSvgPreserveaspectratioUnknown || align > kSvgPreserveaspectratioXmaxymax) {
- exceptionState.throwDOMException(NotSupportedError, "The alignment provided is invalid.");
+ if (isImmutable()) {
+ throwReadOnly(exceptionState);
return;
}
- if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ if (align == kSvgPreserveaspectratioUnknown || align > kSvgPreserveaspectratioXmaxymax) {
+ exceptionState.throwDOMException(NotSupportedError, "The alignment provided is invalid.");
return;
}
-
target()->setAlign(static_cast<SVGPreserveAspectRatio::SVGPreserveAspectRatioType>(align));
commitChange();
}
void SVGPreserveAspectRatioTearOff::setMeetOrSlice(unsigned short meetOrSlice, ExceptionState& exceptionState)
{
- if (meetOrSlice == kSvgMeetorsliceUnknown || meetOrSlice > kSvgMeetorsliceSlice) {
- exceptionState.throwDOMException(NotSupportedError, "The meetOrSlice provided is invalid.");
+ if (isImmutable()) {
+ throwReadOnly(exceptionState);
return;
}
- if (isImmutable()) {
- exceptionState.throwDOMException(NoModificationAllowedError, "The attribute is read-only.");
+ if (meetOrSlice == kSvgMeetorsliceUnknown || meetOrSlice > kSvgMeetorsliceSlice) {
+ exceptionState.throwDOMException(NotSupportedError, "The meetOrSlice provided is invalid.");
return;
}
-
target()->setMeetOrSlice(static_cast<SVGPreserveAspectRatio::SVGMeetOrSliceType>(meetOrSlice));
commitChange();
}
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPointTearOff.cpp ('k') | third_party/WebKit/Source/core/svg/SVGRectTearOff.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698