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

Unified Diff: Source/core/animation/css/CSSAnimatableValueFactory.cpp

Issue 1196913005: Implement animations for Independent CSS Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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/css/CSSAnimatableValueFactory.cpp
diff --git a/Source/core/animation/css/CSSAnimatableValueFactory.cpp b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
index ef85980db41a9fb1fd67366133e7ec685f1ae792..cd4539861b35d4a5924e6568175bf01d4f17a78f 100644
--- a/Source/core/animation/css/CSSAnimatableValueFactory.cpp
+++ b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
@@ -258,6 +258,13 @@ static PassRefPtrWillBeRawPtr<AnimatableValue> createFromFontStretch(FontStretch
return createFromDouble(fontStretchToDouble(fontStretch));
}
+static PassRefPtrWillBeRawPtr<AnimatableValue> createFromTransformProperties(PassRefPtr<TransformOperation> transform, PassRefPtr<TransformOperation> initialTransform)
+{
+ TransformOperations operation;
+ operation.operations().append(transform ? transform : initialTransform);
+ return AnimatableTransform::create(operation);
+}
+
static double fontWeightToDouble(FontWeight fontWeight)
{
switch (fontWeight) {
@@ -523,6 +530,12 @@ PassRefPtrWillBeRawPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPro
return createFromColor(property, style);
case CSSPropertyTransform:
return AnimatableTransform::create(style.transform());
+ case CSSPropertyTranslate:
+ return createFromTransformProperties(style.translate(), style.initialTranslate());
+ case CSSPropertyRotate:
+ return createFromTransformProperties(style.rotate(), style.initialRotate());
+ case CSSPropertyScale:
+ return createFromTransformProperties(style.scale(), style.initialScale());
case CSSPropertyTransformOrigin:
return createFromTransformOrigin(style.transformOrigin(), style);
case CSSPropertyMotionOffset:

Powered by Google App Engine
This is Rietveld 408576698