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

Side by Side Diff: Source/core/animation/StringKeyframe.cpp

Issue 851633002: Animation: Add template for ListStyleInterpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Create new methods in ShadowStyleInterpolation Created 5 years, 10 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 // 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 break; 207 break;
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);
217 break;
216 218
217 // FIXME: Handle CSSValueLists.
218 fallBackToLegacy = true;
219 break;
220 case CSSPropertyPerspectiveOrigin: 219 case CSSPropertyPerspectiveOrigin:
221 case CSSPropertyTransformOrigin: 220 case CSSPropertyTransformOrigin:
222 if (LengthPoint3DStyleInterpolation::canCreateFrom(*fromCSSValue) && Len gthPoint3DStyleInterpolation::canCreateFrom(*toCSSValue)) 221 {
Eric Willigers 2015/01/28 02:21:23 Move brace to end of previous line. Following 5 li
evemj (not active) 2015/01/28 23:01:53 Done.
223 return LengthPoint3DStyleInterpolation::create(*fromCSSValue, *toCSS Value, property); 222 RefPtrWillBeRawPtr<Interpolation> interpolation = ListStyleInterpola tion<LengthStyleInterpolation>::maybeCreateFromList(*fromCSSValue, *toCSSValue, property, range);
223 if (interpolation)
224 return interpolation.release();
225 break;
226 }
224 227
225 // FIXME: Handle percentages and 2D origins. 228 case CSSPropertyBoxShadow:
226 fallBackToLegacy = true; 229 case CSSPropertyTextShadow:
227 break; 230 case CSSPropertyWebkitBoxShadow:
231 {
Eric Willigers 2015/01/28 02:21:23 Move brace to end of previous line. Following line
evemj (not active) 2015/01/28 23:01:53 Done.
232 RefPtrWillBeRawPtr<Interpolation> interpolation = ListStyleInterpola tion<ShadowStyleInterpolation>::maybeCreateFromList(*fromCSSValue, *toCSSValue, property);
233 if (interpolation)
234 return interpolation.release();
235
236 // Interpolation between inset and non-inset ShadowValues should fal l back to DefaultStyleInterpolation
237 if (ShadowStyleInterpolation::usesDefaultStyleInterpolation(*fromCSS Value, *toCSSValue))
238 return DefaultStyleInterpolation::create(fromCSSValue, toCSSValu e, property);
239
240 // FIXME: Handle interpolation from/to none
241 fallBackToLegacy = true;
242
243 break;
244 }
245
228 case CSSPropertyWebkitMaskBoxImageSlice: 246 case CSSPropertyWebkitMaskBoxImageSlice:
229 if (LengthBoxStyleInterpolation::matchingFill(*toCSSValue, *fromCSSValue ) && LengthBoxStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthStyleInt erpolation::canCreateFrom(*toCSSValue)) 247 if (LengthBoxStyleInterpolation::matchingFill(*toCSSValue, *fromCSSValue ) && LengthBoxStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthStyleInt erpolation::canCreateFrom(*toCSSValue))
230 return LengthBoxStyleInterpolation::createFromBorderImageSlice(*from CSSValue, *toCSSValue, property); 248 return LengthBoxStyleInterpolation::createFromBorderImageSlice(*from CSSValue, *toCSSValue, property);
249 break;
231 250
232 break;
233 default: 251 default:
234 // Fall back to LegacyStyleInterpolation. 252 // Fall back to LegacyStyleInterpolation.
235 fallBackToLegacy = true; 253 fallBackToLegacy = true;
236 break; 254 break;
237 } 255 }
238 256
239 if (fromCSSValue->isUnsetValue() || fromCSSValue->isInheritedValue() || from CSSValue->isInitialValue() 257 if (fromCSSValue->isUnsetValue() || fromCSSValue->isInheritedValue() || from CSSValue->isInitialValue()
240 || toCSSValue->isUnsetValue() || toCSSValue->isInheritedValue() || toCSS Value->isInitialValue()) 258 || toCSSValue->isUnsetValue() || toCSSValue->isInheritedValue() || toCSS Value->isInitialValue())
241 fallBackToLegacy = true; 259 fallBackToLegacy = true;
242 260
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } 305 }
288 306
289 void StringKeyframe::PropertySpecificKeyframe::trace(Visitor* visitor) 307 void StringKeyframe::PropertySpecificKeyframe::trace(Visitor* visitor)
290 { 308 {
291 visitor->trace(m_value); 309 visitor->trace(m_value);
292 visitor->trace(m_animatableValueCache); 310 visitor->trace(m_animatableValueCache);
293 Keyframe::PropertySpecificKeyframe::trace(visitor); 311 Keyframe::PropertySpecificKeyframe::trace(visitor);
294 } 312 }
295 313
296 } 314 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698