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

Unified Diff: Source/core/frame/animation/CSSPropertyAnimation.cpp

Issue 55813002: Convert animation and renderer code to know about BorderImageLength (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@length-relative-die-step-1-4
Patch Set: Rebased to latest master Created 7 years, 1 month 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
« no previous file with comments | « Source/core/css/resolver/AnimatedStyleBuilder.cpp ('k') | Source/core/rendering/style/BorderImageLength.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/animation/CSSPropertyAnimation.cpp
diff --git a/Source/core/frame/animation/CSSPropertyAnimation.cpp b/Source/core/frame/animation/CSSPropertyAnimation.cpp
index 1acb4ea41c007831ba0388c38c51f5aa23048103..60c7ca07eae2275a031285040bfc4ebc166e47c7 100644
--- a/Source/core/frame/animation/CSSPropertyAnimation.cpp
+++ b/Source/core/frame/animation/CSSPropertyAnimation.cpp
@@ -71,10 +71,34 @@ 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));
+
+ // FIXME: Converting numbers to lengths using the computed border
+ // width would make it possible to interpolate between numbers and
+ // lengths.
+ // https://code.google.com/p/chromium/issues/detail?id=316164
+ return to;
+}
+
+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)
@@ -959,8 +983,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));
« no previous file with comments | « Source/core/css/resolver/AnimatedStyleBuilder.cpp ('k') | Source/core/rendering/style/BorderImageLength.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698