OLD | NEW |
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 30 matching lines...) Expand all Loading... |
41 if (align == SVG_PRESERVEASPECTRATIO_UNKNOWN || align > SVG_PRESERVEASPECTRA
TIO_XMAXYMAX) { | 41 if (align == SVG_PRESERVEASPECTRATIO_UNKNOWN || align > SVG_PRESERVEASPECTRA
TIO_XMAXYMAX) { |
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 } | 52 } |
52 | 53 |
53 void SVGPreserveAspectRatioTearOff::setMeetOrSlice(unsigned short meetOrSlice, E
xceptionState& exceptionState) | 54 void SVGPreserveAspectRatioTearOff::setMeetOrSlice(unsigned short meetOrSlice, E
xceptionState& exceptionState) |
54 { | 55 { |
55 if (meetOrSlice == SVG_MEETORSLICE_UNKNOWN || meetOrSlice > SVG_MEETORSLICE_
SLICE) { | 56 if (meetOrSlice == SVG_MEETORSLICE_UNKNOWN || meetOrSlice > SVG_MEETORSLICE_
SLICE) { |
56 exceptionState.throwDOMException(NotSupportedError, "The meetOrSlice pro
vided is invalid."); | 57 exceptionState.throwDOMException(NotSupportedError, "The meetOrSlice pro
vided is invalid."); |
57 return; | 58 return; |
58 } | 59 } |
59 if (isImmutable()) { | 60 if (isImmutable()) { |
60 exceptionState.throwDOMException(NoModificationAllowedError, "The attrib
ute is read-only."); | 61 exceptionState.throwDOMException(NoModificationAllowedError, "The attrib
ute is read-only."); |
61 return; | 62 return; |
62 } | 63 } |
63 | 64 |
64 target()->setMeetOrSlice(static_cast<SVGPreserveAspectRatio::SVGMeetOrSliceT
ype>(meetOrSlice)); | 65 target()->setMeetOrSlice(static_cast<SVGPreserveAspectRatio::SVGMeetOrSliceT
ype>(meetOrSlice)); |
| 66 commitChange(); |
65 } | 67 } |
66 | 68 |
67 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) |
68 : SVGPropertyTearOff<SVGPreserveAspectRatio>(target, contextElement, propert
yIsAnimVal, attributeName) | 70 : SVGPropertyTearOff<SVGPreserveAspectRatio>(target, contextElement, propert
yIsAnimVal, attributeName) |
69 { | 71 { |
70 } | 72 } |
71 | 73 |
72 DEFINE_TRACE_WRAPPERS(SVGPreserveAspectRatioTearOff) | 74 DEFINE_TRACE_WRAPPERS(SVGPreserveAspectRatioTearOff) |
73 { | 75 { |
74 visitor->traceWrappers(contextElement()); | 76 visitor->traceWrappers(contextElement()); |
75 } | 77 } |
76 | 78 |
77 } // namespace blink | 79 } // namespace blink |
OLD | NEW |