Chromium Code Reviews| Index: Source/core/animation/css/CSSAnimatableValueFactory.cpp |
| diff --git a/Source/core/animation/css/CSSAnimatableValueFactory.cpp b/Source/core/animation/css/CSSAnimatableValueFactory.cpp |
| index 61306fa81bb36e144f1f3ee08f890762f7ec6557..8e39b60ddace70ba67517fcba356240687b92b93 100644 |
| --- a/Source/core/animation/css/CSSAnimatableValueFactory.cpp |
| +++ b/Source/core/animation/css/CSSAnimatableValueFactory.cpp |
| @@ -33,10 +33,11 @@ |
| #include "CSSValueKeywords.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/AnimatableTransform.h" |
| #include "core/animation/AnimatableUnknown.h" |
| #include "core/animation/AnimatableVisibility.h" |
| @@ -52,20 +53,18 @@ namespace WebCore { |
| static PassRefPtr<AnimatableValue> createFromLength(const Length& length, const RenderStyle* style) |
| { |
| switch (length.type()) { |
| - case Relative: |
| - return AnimatableNumber::create(length.value(), AnimatableNumber::UnitTypeNumber); |
| case Fixed: |
| - return AnimatableNumber::create(adjustFloatForAbsoluteZoom(length.value(), style), AnimatableNumber::UnitTypeLength); |
| + return AnimatableLength::create(adjustFloatForAbsoluteZoom(length.value(), style), AnimatableLength::UnitTypeLength); |
| case Percent: |
| - return AnimatableNumber::create(length.value(), AnimatableNumber::UnitTypePercentage); |
| + return AnimatableLength::create(length.value(), AnimatableLength::UnitTypePercentage); |
| case ViewportPercentageWidth: |
| - return AnimatableNumber::create(length.value(), AnimatableNumber::UnitTypeViewportWidth); |
| + return AnimatableLength::create(length.value(), AnimatableLength::UnitTypeViewportWidth); |
| case ViewportPercentageHeight: |
| - return AnimatableNumber::create(length.value(), AnimatableNumber::UnitTypeViewportHeight); |
| + return AnimatableLength::create(length.value(), AnimatableLength::UnitTypeViewportHeight); |
| case ViewportPercentageMin: |
| - return AnimatableNumber::create(length.value(), AnimatableNumber::UnitTypeViewportMin); |
| + return AnimatableLength::create(length.value(), AnimatableLength::UnitTypeViewportMin); |
| case ViewportPercentageMax: |
| - return AnimatableNumber::create(length.value(), AnimatableNumber::UnitTypeViewportMax); |
| + return AnimatableLength::create(length.value(), AnimatableLength::UnitTypeViewportMax); |
| case Calculated: |
| // FIXME: Convert platform calcs to CSS calcs. |
| ASSERT_WITH_MESSAGE(false, "Web Animations not yet implemented: Convert platform CalculationValue to AnimatableValue"); |
| @@ -81,6 +80,7 @@ static PassRefPtr<AnimatableValue> createFromLength(const Length& length, const |
| case Undefined: |
| return AnimatableUnknown::create(CSSPrimitiveValue::create(CSSValueNone)); |
| case ExtendToZoom: // Does not apply to elements. |
| + case Relative: |
|
dstockwell
2013/09/30 22:01:58
Need a comment about why we don't expect this.
alancutter (OOO until 2018)
2013/09/30 23:04:43
Done.
|
| ASSERT_NOT_REACHED(); |
| return 0; |
| } |
| @@ -90,7 +90,7 @@ static PassRefPtr<AnimatableValue> createFromLength(const Length& length, const |
| inline static PassRefPtr<AnimatableValue> createFromDouble(double value) |
| { |
| - return AnimatableNumber::create(value, AnimatableNumber::UnitTypeNumber); |
| + return AnimatableDouble::create(value); |
| } |
| inline static PassRefPtr<AnimatableValue> createFromLengthBox(const LengthBox lengthBox, const RenderStyle* style) |