Index: Source/core/animation/LegacyStyleInterpolation.h |
diff --git a/Source/core/animation/LegacyStyleInterpolation.h b/Source/core/animation/LegacyStyleInterpolation.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9ce5c8d419a606d5cfcc40971fe9a17d9bb04501 |
--- /dev/null |
+++ b/Source/core/animation/LegacyStyleInterpolation.h |
@@ -0,0 +1,63 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef LegacyStyleInterpolation_h |
+#define LegacyStyleInterpolation_h |
+ |
+#include "core/animation/Interpolation.h" |
+ |
+namespace WebCore { |
+ |
+class CSSPrimitiveValue; |
+class Element; |
+ |
+class LegacyStyleInterpolation : public StyleInterpolation { |
+public: |
+ static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(CSSValue& start, CSSValue& end, CSSPropertyID, Element&); |
+ static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> start, PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> end, CSSPropertyID id) |
+ { |
+ return adoptRefWillBeNoop(new LegacyStyleInterpolation(start, end, id)); |
+ } |
+ |
+ virtual void apply(StyleResolverState&) const OVERRIDE; |
+ |
+ virtual bool isLegacyStyleInterpolation() const OVERRIDE FINAL { return true; } |
+ |
+ PassRefPtrWillBeRawPtr<AnimatableValue> currentValue() const |
+ { |
+ if (m_interpolationRequiresStyleResolve) |
+ return nullptr; |
+ return toInterpolableAnimatableValue(*m_cachedValue).value(); |
+ } |
+ |
+ static bool interpolationRequiresStyleResolve(const CSSValue&); |
+ static bool interpolationRequiresStyleResolve(const CSSPrimitiveValue&); |
+ |
+ virtual void trace(Visitor*) OVERRIDE; |
+ |
+private: |
+ LegacyStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> start, PassOwnPtrWillBeRawPtr<InterpolableAnimatableValue> end, CSSPropertyID id) |
+ : StyleInterpolation(start, end, id) |
+ , m_interpolationRequiresStyleResolve(false) |
+ { |
+ } |
+ |
+ LegacyStyleInterpolation(PassRefPtrWillBeRawPtr<CSSValue> start, PassRefPtrWillBeRawPtr<CSSValue> end, CSSPropertyID id) |
+ : StyleInterpolation(InterpolableNumber::create(0), InterpolableNumber::create(1), id) |
+ , m_interpolationRequiresStyleResolve(true) |
+ , m_startCSSValue(start) |
+ , m_endCSSValue(end) |
+ { |
+ } |
+ |
+ const bool m_interpolationRequiresStyleResolve; |
+ const RefPtrWillBeMember<CSSValue> m_startCSSValue; |
+ const RefPtrWillBeMember<CSSValue> m_endCSSValue; |
+}; |
+ |
+DEFINE_TYPE_CASTS(LegacyStyleInterpolation, Interpolation, value, value->isLegacyStyleInterpolation(), value.isLegacyStyleInterpolation()); |
+ |
+} |
+ |
+#endif |