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

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

Issue 1215563002: Implement left property animation on InvalidatableStyleInterpolation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 6 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
Index: Source/core/animation/LengthPropertyFunctions.cpp
diff --git a/Source/core/animation/LengthPropertyFunctions.cpp b/Source/core/animation/LengthPropertyFunctions.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..943f14607c9c93b3202321bd49df97ae61949060
--- /dev/null
+++ b/Source/core/animation/LengthPropertyFunctions.cpp
@@ -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.
+
+#include "config.h"
+#include "core/animation/LengthPropertyFunctions.h"
+
+#include "core/style/ComputedStyle.h"
+
+namespace blink {
+
+// TODO(alancutter): Generate these functions.
+
+ValueRange LengthPropertyFunctions::valueRange(CSSPropertyID property)
+{
+ ASSERT(property == CSSPropertyLeft);
+ return ValueRangeAll;
+}
+
+LengthPropertyFunctions::LengthSetter LengthPropertyFunctions::computedStyleSetter(CSSPropertyID property)
+{
+ ASSERT(property == CSSPropertyLeft);
+ return &ComputedStyle::setLeft;
+}
+
+bool LengthPropertyFunctions::getPixelsForKeyword(CSSPropertyID property, CSSValueID valueID, double& result)
+{
+ ASSERT(property == CSSPropertyLeft);
+ return false;
+}
+
+bool LengthPropertyFunctions::getLength(CSSPropertyID property, const ComputedStyle& style, Length& result)
+{
+ ASSERT(property == CSSPropertyLeft);
+ result = style.left();
+ return true;
+}
+
+bool LengthPropertyFunctions::getInitialLength(CSSPropertyID property, Length& result)
+{
+ return getLength(property, *ComputedStyle::initialStyle(), result);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698