| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 3 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 #include "core/page/animation/CSSPropertyAnimation.h" | 31 #include "core/page/animation/CSSPropertyAnimation.h" |
| 32 | 32 |
| 33 #include <algorithm> | 33 #include <algorithm> |
| 34 #include "CSSPropertyNames.h" | 34 #include "CSSPropertyNames.h" |
| 35 #include "StylePropertyShorthand.h" | 35 #include "StylePropertyShorthand.h" |
| 36 #include "core/animation/css/CSSAnimations.h" |
| 36 #include "core/css/CSSCrossfadeValue.h" | 37 #include "core/css/CSSCrossfadeValue.h" |
| 37 #include "core/css/CSSImageValue.h" | 38 #include "core/css/CSSImageValue.h" |
| 38 #include "core/css/CSSPrimitiveValue.h" | 39 #include "core/css/CSSPrimitiveValue.h" |
| 39 #include "core/fetch/ImageResource.h" | 40 #include "core/fetch/ImageResource.h" |
| 40 #include "core/page/animation/AnimationBase.h" | 41 #include "core/page/animation/AnimationBase.h" |
| 41 #include "core/platform/FloatConversion.h" | 42 #include "core/platform/FloatConversion.h" |
| 42 #include "core/rendering/ClipPathOperation.h" | 43 #include "core/rendering/ClipPathOperation.h" |
| 43 #include "core/rendering/RenderBox.h" | 44 #include "core/rendering/RenderBox.h" |
| 44 #include "core/rendering/style/RenderStyle.h" | 45 #include "core/rendering/style/RenderStyle.h" |
| 45 #include "core/rendering/style/StyleFetchedImage.h" | 46 #include "core/rendering/style/StyleFetchedImage.h" |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 // CSSPropertyWebkitBoxReflect | 1205 // CSSPropertyWebkitBoxReflect |
| 1205 | 1206 |
| 1206 // Make sure unused slots have a value | 1207 // Make sure unused slots have a value |
| 1207 for (unsigned int i = 0; i < static_cast<unsigned int>(numCSSProperties); ++
i) | 1208 for (unsigned int i = 0; i < static_cast<unsigned int>(numCSSProperties); ++
i) |
| 1208 gPropertyWrapperMap[i] = cInvalidPropertyWrapperIndex; | 1209 gPropertyWrapperMap[i] = cInvalidPropertyWrapperIndex; |
| 1209 | 1210 |
| 1210 // First we put the non-shorthand property wrappers into the map, so the sho
rthand-building | 1211 // First we put the non-shorthand property wrappers into the map, so the sho
rthand-building |
| 1211 // code can find them. | 1212 // code can find them. |
| 1212 size_t n = gPropertyWrappers->size(); | 1213 size_t n = gPropertyWrappers->size(); |
| 1213 for (unsigned int i = 0; i < n; ++i) { | 1214 for (unsigned int i = 0; i < n; ++i) { |
| 1214 ASSERT((*gPropertyWrappers)[i]->property() - firstCSSProperty < numCSSPr
operties); | 1215 CSSPropertyID property = (*gPropertyWrappers)[i]->property(); |
| 1215 gPropertyWrapperMap[(*gPropertyWrappers)[i]->property() - firstCSSProper
ty] = i; | 1216 ASSERT_WITH_MESSAGE(CSSAnimations::isAnimatableProperty(property), "%s i
s not whitelisted for animation", getPropertyNameString(property).utf8().data())
; |
| 1217 ASSERT(property - firstCSSProperty < numCSSProperties); |
| 1218 gPropertyWrapperMap[property - firstCSSProperty] = i; |
| 1216 } | 1219 } |
| 1217 | 1220 |
| 1218 // Now add the shorthand wrappers. | 1221 // Now add the shorthand wrappers. |
| 1219 addShorthandProperties(); | 1222 addShorthandProperties(); |
| 1220 } | 1223 } |
| 1221 | 1224 |
| 1222 // Returns true if we need to start animation timers | 1225 // Returns true if we need to start animation timers |
| 1223 bool CSSPropertyAnimation::blendProperties(const AnimationBase* anim, CSSPropert
yID prop, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double p
rogress) | 1226 bool CSSPropertyAnimation::blendProperties(const AnimationBase* anim, CSSPropert
yID prop, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double p
rogress) |
| 1224 { | 1227 { |
| 1225 ASSERT(prop != CSSPropertyInvalid); | 1228 ASSERT(prop != CSSPropertyInvalid); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 } | 1268 } |
| 1266 | 1269 |
| 1267 int CSSPropertyAnimation::getNumProperties() | 1270 int CSSPropertyAnimation::getNumProperties() |
| 1268 { | 1271 { |
| 1269 ensurePropertyMap(); | 1272 ensurePropertyMap(); |
| 1270 | 1273 |
| 1271 return gPropertyWrappers->size(); | 1274 return gPropertyWrappers->size(); |
| 1272 } | 1275 } |
| 1273 | 1276 |
| 1274 } | 1277 } |
| OLD | NEW |