Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: third_party/WebKit/Source/core/animation/CSSInterpolationType.h

Issue 1394343003: Web Animations: Remove CSS dependence from InterpolationType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_specialCase0and1
Patch Set: NIVs Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CSSValueInterpolationType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/CSSInterpolationType.h
diff --git a/third_party/WebKit/Source/core/animation/CSSInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSInterpolationType.h
new file mode 100644
index 0000000000000000000000000000000000000000..e4df886a16be9454749bfb9bddf7e710e1eb8ef7
--- /dev/null
+++ b/third_party/WebKit/Source/core/animation/CSSInterpolationType.h
@@ -0,0 +1,44 @@
+// Copyright 2015 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 CSSInterpolationType_h
+#define CSSInterpolationType_h
+
+#include "core/animation/InterpolationEnvironment.h"
+#include "core/animation/InterpolationType.h"
+#include "core/animation/StringKeyframe.h"
+#include "core/css/CSSPropertyMetadata.h"
+
+namespace blink {
+
+class CSSInterpolationType : public InterpolationType {
+protected:
+ CSSInterpolationType(CSSPropertyID property)
+ : InterpolationType(PropertyHandle(property))
+ { }
+
+ CSSPropertyID cssProperty() const { return property().cssProperty(); }
+
+ virtual PassOwnPtr<InterpolationValue> maybeConvertSingle(const PropertySpecificKeyframe& keyframe, const InterpolationEnvironment* environment, const UnderlyingValue& underlyingValue, ConversionCheckers& conversionCheckers) const
+ {
+ const CSSValue* value = toCSSPropertySpecificKeyframe(keyframe).value();
+ const StyleResolverState* state = environment ? &environment->state() : nullptr;
+ if (!value)
+ return maybeConvertNeutral(underlyingValue, conversionCheckers);
+ if (value->isInitialValue() || (value->isUnsetValue() && !CSSPropertyMetadata::isInheritedProperty(cssProperty())))
+ return maybeConvertInitial();
+ if (value->isInheritedValue() || (value->isUnsetValue() && CSSPropertyMetadata::isInheritedProperty(cssProperty())))
+ return maybeConvertInherit(state, conversionCheckers);
+ return maybeConvertValue(*value, state, conversionCheckers);
+ }
+
+ virtual PassOwnPtr<InterpolationValue> maybeConvertNeutral(const UnderlyingValue&, ConversionCheckers&) const { ASSERT_NOT_REACHED(); return nullptr; }
+ virtual PassOwnPtr<InterpolationValue> maybeConvertInitial() const { ASSERT_NOT_REACHED(); return nullptr; }
+ virtual PassOwnPtr<InterpolationValue> maybeConvertInherit(const StyleResolverState*, ConversionCheckers& conversionCheckers) const { ASSERT_NOT_REACHED(); return nullptr; }
+ virtual PassOwnPtr<InterpolationValue> maybeConvertValue(const CSSValue& value, const StyleResolverState*, ConversionCheckers& conversionCheckers) const { ASSERT_NOT_REACHED(); return nullptr; }
+};
+
+} // namespace blink
+
+#endif // CSSInterpolationType_h
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CSSValueInterpolationType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698