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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/animation/StringKeyframe.cpp
diff --git a/Source/core/animation/StringKeyframe.cpp b/Source/core/animation/StringKeyframe.cpp
index 90b68cb8b2e85261872802d33c35f5fb5f89f01a..e8a79893c1771dee7bd8ac3bb1ff22a23cda99f4 100644
--- a/Source/core/animation/StringKeyframe.cpp
+++ b/Source/core/animation/StringKeyframe.cpp
@@ -14,8 +14,9 @@
#include "core/animation/LegacyStyleInterpolation.h"
#include "core/animation/LengthBoxStyleInterpolation.h"
#include "core/animation/LengthPairStyleInterpolation.h"
-#include "core/animation/LengthPoint3DStyleInterpolation.h"
#include "core/animation/LengthStyleInterpolation.h"
+#include "core/animation/ListStyleInterpolation.h"
+#include "core/animation/ShadowStyleInterpolation.h"
#include "core/animation/VisibilityStyleInterpolation.h"
#include "core/animation/css/CSSAnimations.h"
#include "core/css/CSSPropertyMetadata.h"
@@ -213,23 +214,40 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
case CSSPropertyObjectPosition:
if (LengthPairStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthPairStyleInterpolation::canCreateFrom(*toCSSValue))
return LengthPairStyleInterpolation::create(*fromCSSValue, *toCSSValue, property, range);
-
- // FIXME: Handle CSSValueLists.
- fallBackToLegacy = true;
break;
+
case CSSPropertyPerspectiveOrigin:
case CSSPropertyTransformOrigin:
- if (LengthPoint3DStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthPoint3DStyleInterpolation::canCreateFrom(*toCSSValue))
- return LengthPoint3DStyleInterpolation::create(*fromCSSValue, *toCSSValue, property);
+ {
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.
+ RefPtrWillBeRawPtr<Interpolation> interpolation = ListStyleInterpolation<LengthStyleInterpolation>::maybeCreateFromList(*fromCSSValue, *toCSSValue, property, range);
+ if (interpolation)
+ return interpolation.release();
+ break;
+ }
+
+ case CSSPropertyBoxShadow:
+ case CSSPropertyTextShadow:
+ case CSSPropertyWebkitBoxShadow:
+ {
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.
+ RefPtrWillBeRawPtr<Interpolation> interpolation = ListStyleInterpolation<ShadowStyleInterpolation>::maybeCreateFromList(*fromCSSValue, *toCSSValue, property);
+ if (interpolation)
+ return interpolation.release();
+
+ // Interpolation between inset and non-inset ShadowValues should fall back to DefaultStyleInterpolation
+ if (ShadowStyleInterpolation::usesDefaultStyleInterpolation(*fromCSSValue, *toCSSValue))
+ return DefaultStyleInterpolation::create(fromCSSValue, toCSSValue, property);
+
+ // FIXME: Handle interpolation from/to none
+ fallBackToLegacy = true;
+
+ break;
+ }
- // FIXME: Handle percentages and 2D origins.
- fallBackToLegacy = true;
- break;
case CSSPropertyWebkitMaskBoxImageSlice:
if (LengthBoxStyleInterpolation::matchingFill(*toCSSValue, *fromCSSValue) && LengthBoxStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthStyleInterpolation::canCreateFrom(*toCSSValue))
return LengthBoxStyleInterpolation::createFromBorderImageSlice(*fromCSSValue, *toCSSValue, property);
-
break;
+
default:
// Fall back to LegacyStyleInterpolation.
fallBackToLegacy = true;

Powered by Google App Engine
This is Rietveld 408576698