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

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

Issue 98663004: Add support for unprefixed CSS Transforms (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 years, 9 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/css/resolver/AnimatedStyleBuilder.cpp
diff --git a/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index 776946880ed245c14328a35c99bddc7b6fa869c6..cf81fddd76584756458a5fd4324929b05423689b 100644
--- a/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -40,6 +40,7 @@
#include "core/animation/AnimatableLengthBox.h"
#include "core/animation/AnimatableLengthBoxAndBool.h"
#include "core/animation/AnimatableLengthPoint.h"
+#include "core/animation/AnimatableLengthPoint3D.h"
#include "core/animation/AnimatableLengthSize.h"
#include "core/animation/AnimatableRepeatable.h"
#include "core/animation/AnimatableSVGLength.h"
@@ -553,13 +554,22 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
case CSSPropertyWebkitMaskSize:
setOnFillLayers<CSSPropertyWebkitMaskSize>(style->accessMaskLayers(), value, state);
return;
- case CSSPropertyWebkitPerspective:
Julien - ping for review 2014/03/21 03:57:25 Don't we still need to handle this value?
dstockwell 2014/03/24 21:40:56 No. In the animation system to avoid animating suc
+ case CSSPropertyPerspective:
style->setPerspective(clampTo<float>(toAnimatableDouble(value)->toDouble()));
return;
+ case CSSPropertyPerspectiveOrigin: {
+ ASSERT(RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
+ const AnimatableLengthPoint* animatableLengthPoint = toAnimatableLengthPoint(value);
+ style->setPerspectiveOriginX(animatableValueToLength(animatableLengthPoint->x(), state));
+ style->setPerspectiveOriginY(animatableValueToLength(animatableLengthPoint->y(), state));
+ return;
+ }
case CSSPropertyWebkitPerspectiveOriginX:
+ ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
style->setPerspectiveOriginX(animatableValueToLength(value, state));
return;
case CSSPropertyWebkitPerspectiveOriginY:
+ ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
style->setPerspectiveOriginY(animatableValueToLength(value, state));
return;
case CSSPropertyShapeInside:
@@ -578,19 +588,30 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setTextStrokeColor(toAnimatableColor(value)->color());
style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLinkColor());
return;
- case CSSPropertyWebkitTransform: {
Julien - ping for review 2014/03/21 03:57:25 Ditto?
dstockwell 2014/03/24 21:40:56 As above.
+ case CSSPropertyTransform: {
const TransformOperations& operations = toAnimatableTransform(value)->transformOperations();
// FIXME: This normalization (handling of 'none') should be performed at input in AnimatableValueFactory.
style->setTransform(operations.size() ? operations : TransformOperations(true));
return;
}
+ case CSSPropertyTransformOrigin: {
+ ASSERT(RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
+ 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()));
+ return;
+ }
case CSSPropertyWebkitTransformOriginX:
+ ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
style->setTransformOriginX(animatableValueToLength(value, state));
return;
case CSSPropertyWebkitTransformOriginY:
+ ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
style->setTransformOriginY(animatableValueToLength(value, state));
return;
case CSSPropertyWebkitTransformOriginZ:
+ ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
style->setTransformOriginZ(toAnimatableDouble(value)->toDouble());
return;
case CSSPropertyWidows:

Powered by Google App Engine
This is Rietveld 408576698