Chromium Code Reviews| Index: Source/core/animation/StringKeyframe.cpp |
| diff --git a/Source/core/animation/StringKeyframe.cpp b/Source/core/animation/StringKeyframe.cpp |
| index c3495a6bf3a069ae1aa8c3eae0c28b6e854c6a81..10e5e2b52196a2033e01ef44bad69b5c634171c5 100644 |
| --- a/Source/core/animation/StringKeyframe.cpp |
| +++ b/Source/core/animation/StringKeyframe.cpp |
| @@ -78,6 +78,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); |
| @@ -86,13 +87,14 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe:: |
| switch (property) { |
| case CSSPropertyLineHeight: |
| - // FIXME: Handle numbers. |
| - useDefaultStyleInterpolation = false; |
| + if (DoubleStyleInterpolation::canCreateFrom(*fromCSSValue) && DoubleStyleInterpolation::canCreateFrom(*toCSSValue)) |
| + return DoubleStyleInterpolation::create(*fromCSSValue, *toCSSValue, property, ClampZero); |
| // Fall through |
| case CSSPropertyBorderBottomWidth: |
| case CSSPropertyBorderLeftWidth: |
| case CSSPropertyBorderRightWidth: |
| case CSSPropertyBorderTopWidth: |
| + case CSSPropertyFlexBasis: |
| case CSSPropertyFontSize: |
| case CSSPropertyHeight: |
| case CSSPropertyMaxHeight: |
| @@ -107,6 +109,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 |
| @@ -128,6 +134,47 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe:: |
| if (property == CSSPropertyPerspective) |
| useDefaultStyleInterpolation = false; |
| break; |
| + |
| + case CSSPropertyOrphans: |
| + if (clamp == NoClamp) |
| + clamp = ClampOrphans; |
| + // Fall through |
| + case CSSPropertyWebkitColumnCount: |
| + case CSSPropertyZIndex: |
| + if (clamp == NoClamp) |
| + clamp = ClampInteger; |
| + // Fall through |
| + case CSSPropertyFillOpacity: |
| + case CSSPropertyFloodOpacity: |
| + case CSSPropertyOpacity: |
| + case CSSPropertyShapeImageThreshold: |
| + case CSSPropertyStopOpacity: |
| + case CSSPropertyStrokeOpacity: |
| + if (clamp == NoClamp) |
| + clamp = ClampOpacity; |
| + // Fall through |
| + case CSSPropertyStrokeMiterlimit: |
| + case CSSPropertyWidows: |
| + if (clamp == NoClamp) |
| + clamp = ClampOne; |
| + // Fall through |
| + case CSSPropertyZoom: |
| + if (clamp == NoClamp) |
| + clamp = ClampZoom; |
| + // Fall through |
| + case CSSPropertyFlexGrow: |
| + case CSSPropertyFlexShrink: |
| + case CSSPropertyWebkitColumnRuleWidth: |
| + if (DoubleStyleInterpolation::canCreateFrom(*fromCSSValue) && DoubleStyleInterpolation::canCreateFrom(*toCSSValue)) { |
| + if (property == CSSPropertyOpacity) { |
| + m_animatableValueCache = StyleResolver::createAnimatableValueSnapshot(*element, property, *fromCSSValue); |
| + RefPtrWillBeRawPtr<AnimatableValue> to = StyleResolver::createAnimatableValueSnapshot(*element, property, *toCSSValue); |
| + toStringPropertySpecificKeyframe(end)->m_animatableValueCache = to; |
|
alancutter (OOO until 2018)
2015/01/19 02:52:30
This code is identical to the code below. This sho
jadeg
2015/01/22 22:14:23
Done.
|
| + } |
| + return DoubleStyleInterpolation::create(*fromCSSValue, *toCSSValue, property, clamp); |
| + } |
| + break; |
| + |
| case CSSPropertyMotionRotation: { |
| RefPtrWillBeRawPtr<Interpolation> interpolation = DoubleStyleInterpolation::maybeCreateFromMotionRotation(*fromCSSValue, *toCSSValue, property); |
| if (interpolation) |