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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGPreserveAspectRatioTearOff.cpp

Issue 2068053002: Rename Blink constants generated from IDL files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 #include "core/svg/SVGPreserveAspectRatioTearOff.h" 31 #include "core/svg/SVGPreserveAspectRatioTearOff.h"
32 32
33 #include "bindings/core/v8/ExceptionState.h" 33 #include "bindings/core/v8/ExceptionState.h"
34 #include "core/dom/ExceptionCode.h" 34 #include "core/dom/ExceptionCode.h"
35 #include "core/svg/SVGElement.h" 35 #include "core/svg/SVGElement.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 void SVGPreserveAspectRatioTearOff::setAlign(unsigned short align, ExceptionStat e& exceptionState) 39 void SVGPreserveAspectRatioTearOff::setAlign(unsigned short align, ExceptionStat e& exceptionState)
40 { 40 {
41 if (align == SVG_PRESERVEASPECTRATIO_UNKNOWN || align > SVG_PRESERVEASPECTRA TIO_XMAXYMAX) { 41 if (align == kSvgPreserveaspectratioUnknown || align > kSvgPreserveaspectrat ioXmaxymax) {
42 exceptionState.throwDOMException(NotSupportedError, "The alignment provi ded is invalid."); 42 exceptionState.throwDOMException(NotSupportedError, "The alignment provi ded is invalid.");
43 return; 43 return;
44 } 44 }
45 if (isImmutable()) { 45 if (isImmutable()) {
46 exceptionState.throwDOMException(NoModificationAllowedError, "The attrib ute is read-only."); 46 exceptionState.throwDOMException(NoModificationAllowedError, "The attrib ute is read-only.");
47 return; 47 return;
48 } 48 }
49 49
50 target()->setAlign(static_cast<SVGPreserveAspectRatio::SVGPreserveAspectRati oType>(align)); 50 target()->setAlign(static_cast<SVGPreserveAspectRatio::SVGPreserveAspectRati oType>(align));
51 commitChange(); 51 commitChange();
52 } 52 }
53 53
54 void SVGPreserveAspectRatioTearOff::setMeetOrSlice(unsigned short meetOrSlice, E xceptionState& exceptionState) 54 void SVGPreserveAspectRatioTearOff::setMeetOrSlice(unsigned short meetOrSlice, E xceptionState& exceptionState)
55 { 55 {
56 if (meetOrSlice == SVG_MEETORSLICE_UNKNOWN || meetOrSlice > SVG_MEETORSLICE_ SLICE) { 56 if (meetOrSlice == kSvgMeetorsliceUnknown || meetOrSlice > kSvgMeetorsliceSl ice) {
57 exceptionState.throwDOMException(NotSupportedError, "The meetOrSlice pro vided is invalid."); 57 exceptionState.throwDOMException(NotSupportedError, "The meetOrSlice pro vided is invalid.");
58 return; 58 return;
59 } 59 }
60 if (isImmutable()) { 60 if (isImmutable()) {
61 exceptionState.throwDOMException(NoModificationAllowedError, "The attrib ute is read-only."); 61 exceptionState.throwDOMException(NoModificationAllowedError, "The attrib ute is read-only.");
62 return; 62 return;
63 } 63 }
64 64
65 target()->setMeetOrSlice(static_cast<SVGPreserveAspectRatio::SVGMeetOrSliceT ype>(meetOrSlice)); 65 target()->setMeetOrSlice(static_cast<SVGPreserveAspectRatio::SVGMeetOrSliceT ype>(meetOrSlice));
66 commitChange(); 66 commitChange();
67 } 67 }
68 68
69 SVGPreserveAspectRatioTearOff::SVGPreserveAspectRatioTearOff(SVGPreserveAspectRa tio* target, SVGElement* contextElement, PropertyIsAnimValType propertyIsAnimVal , const QualifiedName& attributeName) 69 SVGPreserveAspectRatioTearOff::SVGPreserveAspectRatioTearOff(SVGPreserveAspectRa tio* target, SVGElement* contextElement, PropertyIsAnimValType propertyIsAnimVal , const QualifiedName& attributeName)
70 : SVGPropertyTearOff<SVGPreserveAspectRatio>(target, contextElement, propert yIsAnimVal, attributeName) 70 : SVGPropertyTearOff<SVGPreserveAspectRatio>(target, contextElement, propert yIsAnimVal, attributeName)
71 { 71 {
72 } 72 }
73 73
74 DEFINE_TRACE_WRAPPERS(SVGPreserveAspectRatioTearOff) 74 DEFINE_TRACE_WRAPPERS(SVGPreserveAspectRatioTearOff)
75 { 75 {
76 visitor->traceWrappers(contextElement()); 76 visitor->traceWrappers(contextElement());
77 } 77 }
78 78
79 } // namespace blink 79 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698