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 LegacyStyleInterpolation_h
6 #define LegacyStyleInterpolation_h
8 #include "core/animation/StyleInterpolation.h"
9 #include "core/css/resolver/AnimatedStyleBuilder.h"
13 class LegacyStyleInterpolation : public StyleInterpolation {
15 static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(PassRefPtrWillBeRawPtr<AnimatableValue> start, PassRefPtrWillBeRawPtr<AnimatableValue> end, CSSPropertyID id)
17 return adoptRefWillBeNoop(new LegacyStyleInterpolation(InterpolableAnimatableValue::create(start), InterpolableAnimatableValue::create(end), id));
20 virtual void apply(StyleResolverState& state) const OVERRIDE
22 AnimatedStyleBuilder::applyProperty(m_id, state, currentValue().get());
25 virtual bool isLegacyStyleInterpolation() const OVERRIDE FINAL { return true; }
26 PassRefPtrWillBeRawPtr<AnimatableValue> currentValue() const
28 return toInterpolableAnimatableValue(m_cachedValue.get())->value();
31 virtual void trace(Visitor* visitor) OVERRIDE
33 StyleInterpolation::trace(visitor);
37 LegacyStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, PassOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id)
38 : StyleInterpolation(start, end, id)
43 DEFINE_TYPE_CASTS(LegacyStyleInterpolation, Interpolation, value, value->isLegacyStyleInterpolation(), value.isLegacyStyleInterpolation());