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

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: Remove Compositor Animations and add tests for inherit and initial 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..151a8547567d0a845a8ccf71fae0267cd1db7be0 100644
--- a/Source/core/animation/css/CSSAnimatableValueFactory.cpp
+++ b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
@@ -258,6 +258,17 @@ static PassRefPtrWillBeRawPtr<AnimatableValue> createFromFontStretch(FontStretch
return createFromDouble(fontStretchToDouble(fontStretch));
}
+static PassRefPtrWillBeRawPtr<AnimatableValue> createFromTransformProperties(PassRefPtr<TransformOperation> transform, PassRefPtr<TransformOperation> initialTransform)
+{
+ TransformOperations operation;
+ if (transform) {
+ operation.operations().append(transform);
+ } else {
+ operation.operations().append(initialTransform);
+ }
alancutter (OOO until 2018) 2015/06/24 01:17:09 This could use a ternary.
soonm 2015/06/24 02:53:19 Done - Changed to use ternary operation
+ return AnimatableTransform::create(operation);
+}
+
static double fontWeightToDouble(FontWeight fontWeight)
{
switch (fontWeight) {
@@ -523,6 +534,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