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

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

Issue 644953003: Store [-webkit-]transform-origin as a TransformOrigin. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Almost forgot: drop unused ctor. (+ rebase). Created 6 years, 2 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/core/css/resolver/StyleBuilderConverter.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 aa6f88295b5eafbb4665ebe02a2ca30e13ea04e8..c87dac309e9df75198dc35fe09a4114b54311af6 100644
--- a/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -118,6 +118,16 @@ LengthPoint animatableValueToLengthPoint(const AnimatableValue* value, const Sty
animatableValueToLength(animatableLengthPoint->y(), state, range));
}
+TransformOrigin animatableValueToTransformOrigin(const AnimatableValue* value, const StyleResolverState& state, ValueRange range = ValueRangeAll)
+{
+ const AnimatableLengthPoint3D* animatableLengthPoint3D = toAnimatableLengthPoint3D(value);
+ return TransformOrigin(
+ animatableValueToLength(animatableLengthPoint3D->x(), state),
+ animatableValueToLength(animatableLengthPoint3D->y(), state),
+ clampTo<float>(toAnimatableDouble(animatableLengthPoint3D->z())->toDouble())
+ );
+}
+
LengthSize animatableValueToLengthSize(const AnimatableValue* value, const StyleResolverState& state, ValueRange range)
{
const AnimatableLengthSize* animatableLengthSize = toAnimatableLengthSize(value);
@@ -582,13 +592,9 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setTransform(operations.size() ? operations : TransformOperations(true));
return;
}
- case CSSPropertyTransformOrigin: {
- const AnimatableLengthPoint3D* animatableLengthPoint3D = toAnimatableLengthPoint3D(value);
- style->setTransformOriginX(animatableValueToLength(animatableLengthPoint3D->x(), state));
- style->setTransformOriginY(animatableValueToLength(animatableLengthPoint3D->y(), state));
- style->setTransformOriginZ(clampTo<float>(toAnimatableDouble(animatableLengthPoint3D->z())->toDouble()));
+ case CSSPropertyTransformOrigin:
+ style->setTransformOrigin(animatableValueToTransformOrigin(value, state));
return;
- }
case CSSPropertyWidows:
style->setWidows(animatableValueRoundClampTo<unsigned short>(value, 1));
return;
« no previous file with comments | « Source/core/css/CSSProperties.in ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698