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

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

Issue 2811253003: Make InterpolationEnvironment virutal (Closed)
Patch Set: protected Created 3 years, 7 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/CSSInterpolationType.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/CSSInterpolationEnvironment.h
diff --git a/third_party/WebKit/Source/core/animation/CSSInterpolationEnvironment.h b/third_party/WebKit/Source/core/animation/CSSInterpolationEnvironment.h
new file mode 100644
index 0000000000000000000000000000000000000000..27e3caf49b1f64a0a488ea37806980a9f17edcbb
--- /dev/null
+++ b/third_party/WebKit/Source/core/animation/CSSInterpolationEnvironment.h
@@ -0,0 +1,54 @@
+// 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.
+
+#ifndef CSSInterpolationEnvironment_h
+#define CSSInterpolationEnvironment_h
+
+#include "core/animation/InterpolationEnvironment.h"
+#include "core/css/resolver/StyleResolverState.h"
+
+namespace blink {
+
+class ComputedStyle;
+
+class CSSInterpolationEnvironment : public InterpolationEnvironment {
+ public:
+ explicit CSSInterpolationEnvironment(const InterpolationTypesMap& map,
+ StyleResolverState& state)
+ : InterpolationEnvironment(map), state_(&state), style_(state.Style()) {}
+
+ explicit CSSInterpolationEnvironment(const InterpolationTypesMap& map,
+ const ComputedStyle& style)
+ : InterpolationEnvironment(map), style_(&style) {}
+
+ bool IsCSS() const final { return true; }
+
+ StyleResolverState& GetState() {
+ DCHECK(state_);
+ return *state_;
+ }
+ const StyleResolverState& GetState() const {
+ DCHECK(state_);
+ return *state_;
+ }
+
+ const ComputedStyle& Style() const {
+ DCHECK(style_);
+ return *style_;
+ }
+
+ private:
+ StyleResolverState* state_ = nullptr;
+ const ComputedStyle* style_ = nullptr;
+};
+
+DEFINE_TYPE_CASTS(CSSInterpolationEnvironment,
+ InterpolationEnvironment,
+ value,
+ value->IsCSS(),
+ value.IsCSS());
+
+} // namespace blink
+
+#endif // CSSInterpolationEnvironment_h
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CSSInterpolationType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698