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

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

Issue 25082007: Web Animations CSS: Split AnimatableNumber into AnimatableDouble and AnimatableLength (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review changes Created 7 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/core.gypi ('k') | Source/core/css/resolver/StyleResolver.cpp » ('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 a89d1868882f9451945319c55ab9689d0bfbb22a..cd5de94e4578e6f85472c0267ef71f05f84494b6 100644
--- a/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -33,10 +33,11 @@
#include "core/animation/AnimatableClipPathOperation.h"
#include "core/animation/AnimatableColor.h"
+#include "core/animation/AnimatableDouble.h"
#include "core/animation/AnimatableImage.h"
+#include "core/animation/AnimatableLength.h"
#include "core/animation/AnimatableLengthBox.h"
#include "core/animation/AnimatableLengthSize.h"
-#include "core/animation/AnimatableNumber.h"
#include "core/animation/AnimatableShapeValue.h"
#include "core/animation/AnimatableTransform.h"
#include "core/animation/AnimatableUnknown.h"
@@ -57,8 +58,8 @@ namespace {
Length animatableValueToLength(const AnimatableValue* value, const StyleResolverState& state, NumberRange range = AllValues)
{
const RenderStyle* style = state.style();
- if (value->isNumber())
- return toAnimatableNumber(value)->toLength(style, state.rootElementStyle(), style->effectiveZoom(), range);
+ if (value->isLength())
+ return toAnimatableLength(value)->toLength(style, state.rootElementStyle(), style->effectiveZoom(), range);
RefPtr<CSSValue> cssValue = toAnimatableUnknown(value)->toCSSValue();
CSSPrimitiveValue* cssPrimitiveValue = toCSSPrimitiveValue(cssValue.get());
return cssPrimitiveValue->convertToLength<AnyConversion>(style, state.rootElementStyle(), style->effectiveZoom());
@@ -67,7 +68,7 @@ Length animatableValueToLength(const AnimatableValue* value, const StyleResolver
template<typename T> T animatableValueRoundClampTo(const AnimatableValue* value)
{
COMPILE_ASSERT(WTF::IsInteger<T>::value, ShouldUseIntegralTypeTWhenRoundingValues);
- return clampTo<T>(round(toAnimatableNumber(value)->toDouble()));
+ return clampTo<T>(round(toAnimatableDouble(value)->toDouble()));
}
LengthBox animatableValueToLengthBox(const AnimatableValue* value, const StyleResolverState& state)
@@ -166,7 +167,7 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyFillOpacity:
- style->setFillOpacity(clampTo<float>(toAnimatableNumber(value)->toDouble(), 0, 1));
+ style->setFillOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, 1));
return;
case CSSPropertyHeight:
style->setHeight(animatableValueToLength(value, state));
@@ -202,7 +203,7 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setMinWidth(animatableValueToLength(value, state));
return;
case CSSPropertyOpacity:
- style->setOpacity(toAnimatableNumber(value)->toDouble());
+ style->setOpacity(toAnimatableDouble(value)->toDouble());
return;
case CSSPropertyOutlineColor:
style->setOutlineColor(toAnimatableColor(value)->color());
@@ -230,7 +231,7 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setRight(animatableValueToLength(value, state));
return;
case CSSPropertyStrokeOpacity:
- style->setStrokeOpacity(clampTo<float>(toAnimatableNumber(value)->toDouble(), 0, 1));
+ style->setStrokeOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, 1));
return;
case CSSPropertyTextDecorationColor:
style->setTextDecorationColor(toAnimatableColor(value)->color());
@@ -265,7 +266,7 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setMaskImage(toAnimatableImage(value)->toStyleImage());
return;
case CSSPropertyWebkitPerspective:
- style->setPerspective(clampTo<float>(toAnimatableNumber(value)->toDouble()));
+ style->setPerspective(clampTo<float>(toAnimatableDouble(value)->toDouble()));
return;
case CSSPropertyWebkitPerspectiveOriginX:
style->setPerspectiveOriginX(animatableValueToLength(value, state));
@@ -298,13 +299,13 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setTransformOriginY(animatableValueToLength(value, state));
return;
case CSSPropertyWebkitTransformOriginZ:
- style->setTransformOriginZ(toAnimatableNumber(value)->toDouble());
+ style->setTransformOriginZ(toAnimatableDouble(value)->toDouble());
return;
case CSSPropertyWidth:
style->setWidth(animatableValueToLength(value, state));
return;
case CSSPropertyWordSpacing:
- style->setWordSpacing(clampTo<float>(toAnimatableNumber(value)->toDouble()));
+ style->setWordSpacing(clampTo<float>(toAnimatableDouble(value)->toDouble()));
return;
case CSSPropertyVisibility:
style->setVisibility(toAnimatableVisibility(value)->visibility());
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698