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

Unified Diff: Source/core/animation/StringKeyframe.cpp

Issue 811993002: Animation: Implement DoubleStyleInterpolation in StringKeyframe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add length Prtoperty 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 9403348131ed8bf747a046424fc9ad799c933e79..d423a4d395684b7db4ddce12fc3b9d355c28200a 100644
--- a/Source/core/animation/StringKeyframe.cpp
+++ b/Source/core/animation/StringKeyframe.cpp
@@ -76,6 +76,7 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
CSSValue* fromCSSValue = m_value.get();
CSSValue* toCSSValue = toStringPropertySpecificKeyframe(end)->value();
ValueRange range = ValueRangeAll;
+ ClampRange clamp = NoClamp;
if (!CSSPropertyMetadata::isAnimatableProperty(property))
return DefaultStyleInterpolation::create(fromCSSValue, toCSSValue, property);
@@ -84,13 +85,13 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
switch (property) {
case CSSPropertyLineHeight:
- // FIXME: Handle numbers.
- useDefaultStyleInterpolation = false;
- // Fall through
+ if (DoubleStyleInterpolation::canCreateFrom(*fromCSSValue) && DoubleStyleInterpolation::canCreateFrom(*toCSSValue))
+ return DoubleStyleInterpolation::create(*fromCSSValue, *toCSSValue, property, ClampZero);
Eric Willigers 2015/01/14 01:43:36 Do we need a break?
jadeg 2015/01/18 22:59:41 No if it's not a double then it will be a length
Eric Willigers 2015/01/18 23:16:14 OK, then we need // Fall through
case CSSPropertyBorderBottomWidth:
case CSSPropertyBorderLeftWidth:
case CSSPropertyBorderRightWidth:
case CSSPropertyBorderTopWidth:
+ case CSSPropertyFlexBasis:
case CSSPropertyFontSize:
case CSSPropertyHeight:
case CSSPropertyMaxHeight:
@@ -105,6 +106,10 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
case CSSPropertyPaddingTop:
case CSSPropertyPerspective:
case CSSPropertyShapeMargin:
+ case CSSPropertyWebkitBorderHorizontalSpacing:
+ case CSSPropertyWebkitBorderVerticalSpacing:
+ case CSSPropertyWebkitColumnGap:
+ case CSSPropertyWebkitColumnWidth:
case CSSPropertyWidth:
range = ValueRangeNonNegative;
// Fall through
@@ -126,6 +131,36 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
if (property == CSSPropertyPerspective)
useDefaultStyleInterpolation = false;
break;
+
+ case CSSPropertyOrphans:
+ if (clamp == NoClamp)
+ clamp = ClampOrphans;
Eric Willigers 2015/01/14 01:43:36 // Fall through
jadeg 2015/01/18 22:59:41 Done.
+ case CSSPropertyWebkitColumnCount:
+ case CSSPropertyZIndex:
+ if (clamp == NoClamp)
+ clamp = ClampInteger;
+ case CSSPropertyFillOpacity:
+ case CSSPropertyFloodOpacity:
+ case CSSPropertyOpacity:
+ case CSSPropertyShapeImageThreshold:
+ case CSSPropertyStopOpacity:
+ case CSSPropertyStrokeOpacity:
+ if (clamp == NoClamp)
+ clamp = ClampOpacity;
+ case CSSPropertyStrokeMiterlimit:
+ case CSSPropertyWidows:
+ if (clamp == NoClamp)
+ clamp = ClampOne;
+ case CSSPropertyZoom:
+ if (clamp == NoClamp)
+ clamp = ClampZoom;
Eric Willigers 2015/01/14 01:43:36 // Fall through
jadeg 2015/01/18 22:59:41 Done.
+ case CSSPropertyFlexGrow:
+ case CSSPropertyFlexShrink:
+ case CSSPropertyWebkitColumnRuleWidth:
+ if (DoubleStyleInterpolation::canCreateFrom(*fromCSSValue) && DoubleStyleInterpolation::canCreateFrom(*toCSSValue))
+ return DoubleStyleInterpolation::create(*fromCSSValue, *toCSSValue, property, clamp);
+ break;
+
case CSSPropertyMotionRotation: {
RefPtrWillBeRawPtr<Interpolation> interpolation = DoubleStyleInterpolation::maybeCreateFromMotionRotation(*fromCSSValue, *toCSSValue, property);
if (interpolation)

Powered by Google App Engine
This is Rietveld 408576698