OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef LengthStyleInterpolation_h | 5 #ifndef LengthStyleInterpolation_h |
6 #define LengthStyleInterpolation_h | 6 #define LengthStyleInterpolation_h |
7 | 7 |
8 #include "core/animation/StyleInterpolation.h" | 8 #include "core/animation/StyleInterpolation.h" |
9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
10 #include "platform/Length.h" | 10 #include "platform/Length.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class LengthStyleInterpolation : public StyleInterpolation { | 14 class LengthStyleInterpolation : public StyleInterpolation { |
15 public: | 15 public: |
| 16 |
| 17 typedef void NonInterpolableType; |
| 18 |
16 static PassRefPtrWillBeRawPtr<LengthStyleInterpolation> create(const CSSValu
e& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range) | 19 static PassRefPtrWillBeRawPtr<LengthStyleInterpolation> create(const CSSValu
e& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range) |
17 { | 20 { |
18 return adoptRefWillBeNoop(new LengthStyleInterpolation(lengthToInterpola
bleValue(start), lengthToInterpolableValue(end), id, range)); | 21 return adoptRefWillBeNoop(new LengthStyleInterpolation(toInterpolableVal
ue(start), toInterpolableValue(end), id, range)); |
19 } | 22 } |
20 | 23 |
21 static bool canCreateFrom(const CSSValue&); | 24 static bool canCreateFrom(const CSSValue&); |
22 | 25 |
23 virtual void apply(StyleResolverState&) const override; | 26 virtual void apply(StyleResolverState&) const override; |
24 | 27 |
25 virtual void trace(Visitor*) override; | 28 virtual void trace(Visitor*) override; |
26 | 29 |
| 30 static PassOwnPtrWillBeRawPtr<InterpolableValue> toInterpolableValue(const C
SSValue&); |
| 31 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> fromInterpolableValue(const
InterpolableValue&, InterpolationRange); |
| 32 |
27 private: | 33 private: |
28 LengthStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pa
ssOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id, InterpolationRan
ge range) | 34 LengthStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pa
ssOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id, InterpolationRan
ge range) |
29 : StyleInterpolation(start, end, id) | 35 : StyleInterpolation(start, end, id) |
30 , m_range(range) | 36 , m_range(range) |
31 { } | 37 { } |
32 | 38 |
33 static PassOwnPtrWillBeRawPtr<InterpolableValue> lengthToInterpolableValue(c
onst CSSValue&); | |
34 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> interpolableValueToLength(c
onst InterpolableValue*, InterpolationRange); | |
35 | |
36 InterpolationRange m_range; | 39 InterpolationRange m_range; |
37 | |
38 friend class AnimationLengthStyleInterpolationTest; | |
39 friend class LengthBoxStyleInterpolation; | |
40 friend class ShadowStyleInterpolation; | |
41 friend class LengthPairStyleInterpolation; | |
42 friend class LengthPoint3DStyleInterpolation; | |
43 }; | 40 }; |
44 | 41 |
45 } | 42 } |
46 | 43 |
47 #endif | 44 #endif |
OLD | NEW |