OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/animation/StringKeyframe.h" | 6 #include "core/animation/StringKeyframe.h" |
7 | 7 |
8 #include "core/animation/ColorStyleInterpolation.h" | 8 #include "core/animation/ColorStyleInterpolation.h" |
9 #include "core/animation/ConstantStyleInterpolation.h" | 9 #include "core/animation/ConstantStyleInterpolation.h" |
10 #include "core/animation/DefaultStyleInterpolation.h" | 10 #include "core/animation/DefaultStyleInterpolation.h" |
11 #include "core/animation/DeferredLegacyStyleInterpolation.h" | 11 #include "core/animation/DeferredLegacyStyleInterpolation.h" |
12 #include "core/animation/DoubleStyleInterpolation.h" | 12 #include "core/animation/DoubleStyleInterpolation.h" |
13 #include "core/animation/ImageStyleInterpolation.h" | 13 #include "core/animation/ImageStyleInterpolation.h" |
14 #include "core/animation/LegacyStyleInterpolation.h" | 14 #include "core/animation/LegacyStyleInterpolation.h" |
15 #include "core/animation/LengthBoxStyleInterpolation.h" | 15 #include "core/animation/LengthBoxStyleInterpolation.h" |
16 #include "core/animation/LengthPairStyleInterpolation.h" | 16 #include "core/animation/LengthPairStyleInterpolation.h" |
17 #include "core/animation/LengthPoint3DStyleInterpolation.h" | |
18 #include "core/animation/LengthStyleInterpolation.h" | 17 #include "core/animation/LengthStyleInterpolation.h" |
18 #include "core/animation/ListStyleInterpolation.h" | |
19 #include "core/animation/ShadowStyleInterpolation.h" | |
19 #include "core/animation/VisibilityStyleInterpolation.h" | 20 #include "core/animation/VisibilityStyleInterpolation.h" |
20 #include "core/animation/css/CSSAnimations.h" | 21 #include "core/animation/css/CSSAnimations.h" |
21 #include "core/css/CSSPropertyMetadata.h" | 22 #include "core/css/CSSPropertyMetadata.h" |
22 #include "core/css/resolver/StyleResolver.h" | 23 #include "core/css/resolver/StyleResolver.h" |
23 #include "core/rendering/style/RenderStyle.h" | 24 #include "core/rendering/style/RenderStyle.h" |
24 | 25 |
25 namespace blink { | 26 namespace blink { |
26 | 27 |
27 StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom) | 28 StringKeyframe::StringKeyframe(const StringKeyframe& copyFrom) |
28 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing) | 29 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing) |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 case CSSPropertyBorderBottomLeftRadius: | 208 case CSSPropertyBorderBottomLeftRadius: |
208 case CSSPropertyBorderBottomRightRadius: | 209 case CSSPropertyBorderBottomRightRadius: |
209 case CSSPropertyBorderTopLeftRadius: | 210 case CSSPropertyBorderTopLeftRadius: |
210 case CSSPropertyBorderTopRightRadius: | 211 case CSSPropertyBorderTopRightRadius: |
211 range = RangeNonNegative; | 212 range = RangeNonNegative; |
212 // Fall through | 213 // Fall through |
213 case CSSPropertyObjectPosition: | 214 case CSSPropertyObjectPosition: |
214 if (LengthPairStyleInterpolation::canCreateFrom(*fromCSSValue) && Length PairStyleInterpolation::canCreateFrom(*toCSSValue)) | 215 if (LengthPairStyleInterpolation::canCreateFrom(*fromCSSValue) && Length PairStyleInterpolation::canCreateFrom(*toCSSValue)) |
215 return LengthPairStyleInterpolation::create(*fromCSSValue, *toCSSVal ue, property, range); | 216 return LengthPairStyleInterpolation::create(*fromCSSValue, *toCSSVal ue, property, range); |
216 | 217 |
217 // FIXME: Handle CSSValueLists. | 218 // FIXME: Handle CSSValueLists. |
samli
2015/01/23 03:23:36
Is this something we can fix now? Maybe in another
evemj (not active)
2015/01/28 01:29:13
Done.
| |
218 fallBackToLegacy = true; | 219 fallBackToLegacy = true; |
219 break; | 220 break; |
220 case CSSPropertyPerspectiveOrigin: | 221 case CSSPropertyPerspectiveOrigin: |
221 case CSSPropertyTransformOrigin: | 222 case CSSPropertyTransformOrigin: |
222 if (LengthPoint3DStyleInterpolation::canCreateFrom(*fromCSSValue) && Len gthPoint3DStyleInterpolation::canCreateFrom(*toCSSValue)) | 223 { |
223 return LengthPoint3DStyleInterpolation::create(*fromCSSValue, *toCSS Value, property); | 224 RefPtrWillBeRawPtr<Interpolation> interpolation = ListStyleInterpola tion<LengthStyleInterpolation>::maybeCreateFromList(*fromCSSValue, *toCSSValue, property, range); |
225 if (interpolation) | |
226 return interpolation.release(); | |
samli
2015/01/23 03:23:36
Fix indentation please.
evemj (not active)
2015/01/28 00:41:14
Done.
| |
227 break; | |
228 } | |
224 | 229 |
225 // FIXME: Handle percentages and 2D origins. | 230 case CSSPropertyBoxShadow: |
226 fallBackToLegacy = true; | 231 case CSSPropertyTextShadow: |
227 break; | 232 case CSSPropertyWebkitBoxShadow: |
233 { | |
234 RefPtrWillBeRawPtr<Interpolation> interpolation = ListStyleInterpola tion<ShadowStyleInterpolation>::maybeCreateFromList(*fromCSSValue, *toCSSValue, property); | |
235 if (interpolation) | |
236 return interpolation.release(); | |
237 | |
238 // Interpolation between inset and non-inset ShadowValues should fal l back to DefaultStyleInterpolation | |
239 if (ShadowStyleInterpolation::usesDefaultStyleInterpolation(*fromCSS Value, *toCSSValue)) | |
240 return DefaultStyleInterpolation::create(fromCSSValue, toCSSValu e, property); | |
241 | |
242 // FIXME: Handle interpolation from/to none | |
243 fallBackToLegacy = true; | |
244 | |
245 break; | |
246 } | |
247 | |
228 case CSSPropertyWebkitMaskBoxImageSlice: | 248 case CSSPropertyWebkitMaskBoxImageSlice: |
229 if (LengthBoxStyleInterpolation::matchingFill(*toCSSValue, *fromCSSValue ) && LengthBoxStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthStyleInt erpolation::canCreateFrom(*toCSSValue)) | 249 if (LengthBoxStyleInterpolation::matchingFill(*toCSSValue, *fromCSSValue ) && LengthBoxStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthStyleInt erpolation::canCreateFrom(*toCSSValue)) |
230 return LengthBoxStyleInterpolation::createFromBorderImageSlice(*from CSSValue, *toCSSValue, property); | 250 return LengthBoxStyleInterpolation::createFromBorderImageSlice(*from CSSValue, *toCSSValue, property); |
251 break; | |
231 | 252 |
232 break; | |
233 default: | 253 default: |
234 // Fall back to LegacyStyleInterpolation. | 254 // Fall back to LegacyStyleInterpolation. |
235 fallBackToLegacy = true; | 255 fallBackToLegacy = true; |
236 break; | 256 break; |
237 } | 257 } |
238 | 258 |
239 if (fromCSSValue->isUnsetValue() || fromCSSValue->isInheritedValue() || from CSSValue->isInitialValue() | 259 if (fromCSSValue->isUnsetValue() || fromCSSValue->isInheritedValue() || from CSSValue->isInitialValue() |
240 || toCSSValue->isUnsetValue() || toCSSValue->isInheritedValue() || toCSS Value->isInitialValue()) | 260 || toCSSValue->isUnsetValue() || toCSSValue->isInheritedValue() || toCSS Value->isInitialValue()) |
241 fallBackToLegacy = true; | 261 fallBackToLegacy = true; |
242 | 262 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 } | 307 } |
288 | 308 |
289 void StringKeyframe::PropertySpecificKeyframe::trace(Visitor* visitor) | 309 void StringKeyframe::PropertySpecificKeyframe::trace(Visitor* visitor) |
290 { | 310 { |
291 visitor->trace(m_value); | 311 visitor->trace(m_value); |
292 visitor->trace(m_animatableValueCache); | 312 visitor->trace(m_animatableValueCache); |
293 Keyframe::PropertySpecificKeyframe::trace(visitor); | 313 Keyframe::PropertySpecificKeyframe::trace(visitor); |
294 } | 314 } |
295 | 315 |
296 } | 316 } |
OLD | NEW |