OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SVGLengthStyleInterpolation_h | |
6 #define SVGLengthStyleInterpolation_h | |
7 | |
8 #include "core/animation/StyleInterpolation.h" | |
9 #include "core/css/CSSPrimitiveValue.h" | |
10 #include "platform/Length.h" | |
11 | |
12 namespace blink { | |
13 | |
14 class SVGLengthStyleInterpolation : public StyleInterpolation { | |
15 public: | |
16 static PassRefPtrWillBeRawPtr<SVGLengthStyleInterpolation> maybeCreate(const
CSSValue& start, const CSSValue& end, CSSPropertyID, InterpolationRange); | |
17 | |
18 virtual void apply(StyleResolverState&) const override; | |
19 | |
20 DEFINE_INLINE_VIRTUAL_TRACE() | |
21 { | |
22 StyleInterpolation::trace(visitor); | |
23 } | |
24 | |
25 private: | |
26 SVGLengthStyleInterpolation(const CSSPrimitiveValue& start, const CSSPrimiti
veValue& end, CSSPropertyID, CSSPrimitiveValue::UnitType, InterpolationRange); | |
27 | |
28 static bool canCreateFrom(const CSSValue&); | |
29 static CSSPrimitiveValue::UnitType commonUnitType(const CSSPrimitiveValue& s
tart, const CSSPrimitiveValue& end); | |
30 static PassOwnPtrWillBeRawPtr<InterpolableValue> lengthToInterpolableValue(c
onst CSSPrimitiveValue&); | |
31 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> interpolableValueToLength(c
onst InterpolableValue&, CSSPrimitiveValue::UnitType, InterpolationRange); | |
32 | |
33 CSSPrimitiveValue::UnitType m_type; | |
34 InterpolationRange m_range; | |
35 | |
36 friend class AnimationSVGLengthStyleInterpolationTest; | |
37 friend class SVGStrokeDasharrayStyleInterpolation; | |
38 }; | |
39 | |
40 } | |
41 | |
42 #endif // SVGLengthStyleInterpolation_h | |
OLD | NEW |