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
3 // found in the LICENSE file.
5 #ifndef LengthPairStyleInterpolation_h
6 #define LengthPairStyleInterpolation_h
8 #include "core/CoreExport.h"
9 #include "core/animation/StyleInterpolation.h"
10 #include "platform/Length.h"
14 class CORE_EXPORT LengthPairStyleInterpolation
: public StyleInterpolation
{
16 static PassRefPtr
<LengthPairStyleInterpolation
> create(const CSSValue
& start
, const CSSValue
& end
, CSSPropertyID id
, InterpolationRange range
)
18 return adoptRef(new LengthPairStyleInterpolation(lengthPairToInterpolableValue(start
), lengthPairToInterpolableValue(end
), id
, range
));
21 static bool canCreateFrom(const CSSValue
&);
23 void apply(StyleResolverState
&) const override
;
26 LengthPairStyleInterpolation(PassOwnPtr
<InterpolableValue
> start
, PassOwnPtr
<InterpolableValue
> end
, CSSPropertyID id
, InterpolationRange range
)
27 : StyleInterpolation(start
, end
, id
), m_range(range
)
31 static PassOwnPtr
<InterpolableValue
> lengthPairToInterpolableValue(const CSSValue
&);
32 static PassRefPtrWillBeRawPtr
<CSSValue
> interpolableValueToLengthPair(InterpolableValue
*, InterpolationRange
);
34 InterpolationRange m_range
;
36 friend class LengthPairStyleInterpolationTest
;
41 #endif // LengthPairStyleInterpolation_h