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 | 16 |
17 typedef void NonInterpolableType; | 17 typedef void NonInterpolableType; |
18 | 18 |
19 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) |
20 { | 20 { |
21 return adoptRefWillBeNoop(new LengthStyleInterpolation(toInterpolableVal
ue(start), toInterpolableValue(end), id, range)); | 21 return adoptRefWillBeNoop(new LengthStyleInterpolation(toInterpolableVal
ue(start, id), toInterpolableValue(end, id), id, range)); |
22 } | 22 } |
23 | 23 |
24 static bool canCreateFrom(const CSSValue&); | 24 static bool canCreateFrom(const CSSValue&, CSSPropertyID = CSSPropertyInvali
d); |
25 | 25 |
26 virtual void apply(StyleResolverState&) const override; | 26 virtual void apply(StyleResolverState&) const override; |
27 | 27 |
28 DECLARE_VIRTUAL_TRACE(); | 28 DECLARE_VIRTUAL_TRACE(); |
29 | 29 |
30 static PassOwnPtrWillBeRawPtr<InterpolableValue> toInterpolableValue(const C
SSValue&); | 30 static PassOwnPtrWillBeRawPtr<InterpolableValue> toInterpolableValue(const C
SSValue&, CSSPropertyID = CSSPropertyInvalid); |
31 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> fromInterpolableValue(const
InterpolableValue&, InterpolationRange); | 31 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> fromInterpolableValue(const
InterpolableValue&, InterpolationRange); |
32 | 32 |
33 private: | 33 private: |
34 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) |
35 : StyleInterpolation(start, end, id) | 35 : StyleInterpolation(start, end, id) |
36 , m_range(range) | 36 , m_range(range) |
37 { } | 37 { } |
38 | 38 |
39 InterpolationRange m_range; | 39 InterpolationRange m_range; |
40 }; | 40 }; |
41 | 41 |
42 } | 42 } |
43 | 43 |
44 #endif | 44 #endif |
OLD | NEW |