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

Unified Diff: Source/core/animation/AnimatableValue.cpp

Issue 186463002: Web Animations: define distance for AnimatableColor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove blank line Created 6 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 | « Source/core/animation/AnimatableValue.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimatableValue.cpp
diff --git a/Source/core/animation/AnimatableValue.cpp b/Source/core/animation/AnimatableValue.cpp
index 1c9d1751ca0e3f590d09d652469a178946219624..a8b9557f2dc6868209555e7efac2bc85482af7f9 100644
--- a/Source/core/animation/AnimatableValue.cpp
+++ b/Source/core/animation/AnimatableValue.cpp
@@ -34,6 +34,12 @@
#include "wtf/StdLibExtras.h"
#include <algorithm>
+namespace {
+
+const double defaultDistance = 1;
+
+} // namespace
+
namespace WebCore {
const AnimatableValue* AnimatableValue::neutralValue()
@@ -76,4 +82,20 @@ PassRefPtr<AnimatableValue> AnimatableValue::addWith(const AnimatableValue* valu
return defaultAddWith(this, value);
}
+double AnimatableValue::distance(const AnimatableValue* left, const AnimatableValue* right)
+{
+ ASSERT(left);
+ ASSERT(right);
+
+ if (left->isSameType(right))
+ return left->distanceTo(right);
+
+ return defaultDistance;
+}
+
+double AnimatableValue::distanceTo(const AnimatableValue*) const
+{
+ return defaultDistance;
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/animation/AnimatableValue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698