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

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

Issue 1682083004: Add additive animation support for CSS property transform-origin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_radiusInterpolationType
Patch Set: Rebased Created 4 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
Index: third_party/WebKit/Source/core/animation/CSSTransformOriginInterpolationType.h
diff --git a/third_party/WebKit/Source/core/animation/CSSTransformOriginInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSTransformOriginInterpolationType.h
new file mode 100644
index 0000000000000000000000000000000000000000..38baf41b4eb2c3ce084568b3045dcf044fc5be5c
--- /dev/null
+++ b/third_party/WebKit/Source/core/animation/CSSTransformOriginInterpolationType.h
@@ -0,0 +1,38 @@
+// Copyright 2016 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 CSSTransformOriginInterpolationType_h
+#define CSSTransformOriginInterpolationType_h
+
+#include "core/animation/CSSLengthInterpolationType.h"
+#include "core/animation/CSSLengthListInterpolationType.h"
+#include "core/animation/CSSPositionAxisListInterpolationType.h"
+#include "core/animation/ListInterpolationFunctions.h"
+#include "core/css/CSSValueList.h"
+
+namespace blink {
+
+class CSSTransformOriginInterpolationType : public CSSLengthListInterpolationType {
+public:
+ CSSTransformOriginInterpolationType(CSSPropertyID property)
+ : CSSLengthListInterpolationType(property)
+ { }
+
+private:
+ InterpolationValue maybeConvertValue(const CSSValue& value, const StyleResolverState&, ConversionCheckers&) const final
+ {
+ const CSSValueList& list = toCSSValueList(value);
+ ASSERT(list.length() == 3);
+ return ListInterpolationFunctions::createList(list.length(), [&list](size_t index) {
+ const CSSValue& item = *list.item(index);
+ if (index < 2)
+ return CSSPositionAxisListInterpolationType::convertPositionAxisCSSValue(item);
+ return CSSLengthInterpolationType::maybeConvertCSSValue(item);
+ });
+ }
+};
+
+} // namespace blink
+
+#endif // CSSTransformOriginInterpolationType_h

Powered by Google App Engine
This is Rietveld 408576698