Chromium Code Reviews| Index: Source/core/frame/animation/CSSPropertyAnimation.cpp |
| diff --git a/Source/core/frame/animation/CSSPropertyAnimation.cpp b/Source/core/frame/animation/CSSPropertyAnimation.cpp |
| index 4479e657ef0e3de32f0c946b5c9fe427e32a6ff7..48ca03f4cf6022e2aa24c2dea7713eff633bdca6 100644 |
| --- a/Source/core/frame/animation/CSSPropertyAnimation.cpp |
| +++ b/Source/core/frame/animation/CSSPropertyAnimation.cpp |
| @@ -71,10 +71,30 @@ static inline Length blendFunc(const AnimationBase*, const Length& from, const L |
| return to.blend(from, progress, ValueRangeAll); |
| } |
| +static inline BorderImageLength blendFunc(const AnimationBase* anim, const BorderImageLength& from, const BorderImageLength& to, double progress) |
| +{ |
| + if (from.isNumber() && to.isNumber()) |
| + return BorderImageLength(blendFunc(anim, from.number(), to.number(), progress)); |
| + |
| + if (from.isLength() && to.isLength()) |
| + return BorderImageLength(blendFunc(anim, from.length(), to.length(), progress)); |
| + |
| + return to; |
|
Julien - ping for review
2013/11/04 18:15:54
This is missing a FIXME per our discussion.
davve
2013/11/07 13:18:45
OK.
|
| +} |
| + |
| +static inline BorderImageLengthBox blendFunc(const AnimationBase* anim, const BorderImageLengthBox& from, |
| + const BorderImageLengthBox& to, double progress) |
| +{ |
| + return BorderImageLengthBox(blendFunc(anim, from.top(), to.top(), progress), |
| + blendFunc(anim, from.right(), to.right(), progress), |
| + blendFunc(anim, from.bottom(), to.bottom(), progress), |
| + blendFunc(anim, from.left(), to.left(), progress)); |
| +} |
| + |
| static inline LengthSize blendFunc(const AnimationBase* anim, const LengthSize& from, const LengthSize& to, double progress) |
| { |
| return LengthSize(blendFunc(anim, from.width(), to.width(), progress), |
| - blendFunc(anim, from.height(), to.height(), progress)); |
| + blendFunc(anim, from.height(), to.height(), progress)); |
| } |
| static inline LengthPoint blendFunc(const AnimationBase* anim, const LengthPoint& from, const LengthPoint& to, double progress) |
| @@ -85,7 +105,7 @@ static inline LengthPoint blendFunc(const AnimationBase* anim, const LengthPoint |
| static inline IntSize blendFunc(const AnimationBase* anim, const IntSize& from, const IntSize& to, double progress) |
| { |
| return IntSize(blendFunc(anim, from.width(), to.width(), progress), |
| - blendFunc(anim, from.height(), to.height(), progress)); |
| + blendFunc(anim, from.height(), to.height(), progress)); |
| } |
| static inline TransformOperations blendFunc(const AnimationBase* anim, const TransformOperations& from, const TransformOperations& to, double progress) |
| @@ -964,8 +984,8 @@ void CSSPropertyAnimation::ensurePropertyMap() |
| gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource)); |
| gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderImageSlice, &RenderStyle::borderImageSlices, &RenderStyle::setBorderImageSlices)); |
| - gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderImageWidth, &RenderStyle::borderImageWidth, &RenderStyle::setBorderImageWidth)); |
| - gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyBorderImageOutset, &RenderStyle::borderImageOutset, &RenderStyle::setBorderImageOutset)); |
| + gPropertyWrappers->append(new PropertyWrapper<const BorderImageLengthBox&>(CSSPropertyBorderImageWidth, &RenderStyle::borderImageWidth, &RenderStyle::setBorderImageWidth)); |
| + gPropertyWrappers->append(new PropertyWrapper<const BorderImageLengthBox&>(CSSPropertyBorderImageOutset, &RenderStyle::borderImageOutset, &RenderStyle::setBorderImageOutset)); |
| gPropertyWrappers->append(new StyleImagePropertyWrapper(CSSPropertyWebkitMaskBoxImageSource, &RenderStyle::maskBoxImageSource, &RenderStyle::setMaskBoxImageSource)); |
| gPropertyWrappers->append(new PropertyWrapper<const NinePieceImage&>(CSSPropertyWebkitMaskBoxImage, &RenderStyle::maskBoxImage, &RenderStyle::setMaskBoxImage)); |