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

Unified Diff: third_party/WebKit/Source/core/animation/CSSTimeInterpolationType.cpp

Issue 2694103009: Support animating <time> custom properties (Closed)
Patch Set: Undo git fail Created 3 years, 10 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 | « third_party/WebKit/Source/core/animation/CSSTimeInterpolationType.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/CSSTimeInterpolationType.cpp
diff --git a/third_party/WebKit/Source/core/animation/CSSTimeInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSTimeInterpolationType.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..05c59e684833a4b1df944c943eaff471025b2dd1
--- /dev/null
+++ b/third_party/WebKit/Source/core/animation/CSSTimeInterpolationType.cpp
@@ -0,0 +1,35 @@
+// Copyright 2017 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.
+
+#include "core/animation/CSSTimeInterpolationType.h"
+
+#include "core/css/CSSPrimitiveValue.h"
+
+namespace blink {
+
+InterpolationValue CSSTimeInterpolationType::maybeConvertNeutral(
+ const InterpolationValue&,
+ ConversionCheckers&) const {
+ return InterpolationValue(InterpolableNumber::create(0));
+}
+
+InterpolationValue CSSTimeInterpolationType::maybeConvertValue(
+ const CSSValue& value,
+ const StyleResolverState*,
+ ConversionCheckers&) const {
+ if (!value.isPrimitiveValue() || !toCSSPrimitiveValue(value).isTime())
+ return nullptr;
+ return InterpolationValue(
+ InterpolableNumber::create(toCSSPrimitiveValue(value).computeSeconds()));
+}
+
+const CSSValue* CSSTimeInterpolationType::createCSSValue(
+ const InterpolableValue& value,
+ const NonInterpolableValue*,
+ const StyleResolverState&) const {
+ return CSSPrimitiveValue::create(toInterpolableNumber(value).value(),
+ CSSPrimitiveValue::UnitType::Seconds);
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/animation/CSSTimeInterpolationType.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698