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

Unified Diff: Source/core/css/resolver/AnimatedStyleBuilder.cpp

Issue 1196913005: Implement animations for Independent CSS Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix rotate-interpolation test 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
« no previous file with comments | « Source/core/css/CSSProperties.in ('k') | Source/platform/transforms/RotateTransformOperation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/AnimatedStyleBuilder.cpp
diff --git a/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index d810f0bf0832edb452b78a5b8e6986bf369fbb45..71dd52413d17f9935cb7404d768140e6407ff00f 100644
--- a/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -263,6 +263,14 @@ FontDescription::Size animatableValueToFontSize(const AnimatableValue* value)
return FontDescription::Size(0, size, true);
}
+TransformOperation* animatableValueToTransformOperation(const AnimatableValue* value, TransformOperation::OperationType type)
+{
+ const TransformOperations& transformList = toAnimatableTransform(value)->transformOperations();
+ ASSERT(transformList.size() == 1);
+ ASSERT(transformList.operations()[0]->type() == type);
+ return transformList.operations()[0].get();
+}
+
} // namespace
// FIXME: Generate this function.
@@ -597,6 +605,18 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setTransform(operations.size() ? operations : TransformOperations(true));
return;
}
+ case CSSPropertyTranslate: {
+ style->setTranslate(toTranslateTransformOperation(animatableValueToTransformOperation(value, TransformOperation::Translate3D)));
+ return;
+ }
+ case CSSPropertyRotate: {
+ style->setRotate(toRotateTransformOperation(animatableValueToTransformOperation(value, TransformOperation::Rotate3D)));
+ return;
+ }
+ case CSSPropertyScale: {
+ style->setScale(toScaleTransformOperation(animatableValueToTransformOperation(value, TransformOperation::Scale3D)));
+ return;
+ }
case CSSPropertyTransformOrigin:
style->setTransformOrigin(animatableValueToTransformOrigin(value, state));
return;
« no previous file with comments | « Source/core/css/CSSProperties.in ('k') | Source/platform/transforms/RotateTransformOperation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698