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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CSSInterpolationType.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CSSInterpolationEnvironment_h
6 #define CSSInterpolationEnvironment_h
7
8 #include "core/animation/InterpolationEnvironment.h"
9 #include "core/css/resolver/StyleResolverState.h"
10
11 namespace blink {
12
13 class ComputedStyle;
14
15 class CSSInterpolationEnvironment : public InterpolationEnvironment {
16 public:
17 explicit CSSInterpolationEnvironment(const InterpolationTypesMap& map,
18 StyleResolverState& state)
19 : InterpolationEnvironment(map), state_(&state), style_(state.Style()) {}
20
21 explicit CSSInterpolationEnvironment(const InterpolationTypesMap& map,
22 const ComputedStyle& style)
23 : InterpolationEnvironment(map), style_(&style) {}
24
25 bool IsCSS() const final { return true; }
26
27 StyleResolverState& GetState() {
28 DCHECK(state_);
29 return *state_;
30 }
31 const StyleResolverState& GetState() const {
32 DCHECK(state_);
33 return *state_;
34 }
35
36 const ComputedStyle& Style() const {
37 DCHECK(style_);
38 return *style_;
39 }
40
41 private:
42 StyleResolverState* state_ = nullptr;
43 const ComputedStyle* style_ = nullptr;
44 };
45
46 DEFINE_TYPE_CASTS(CSSInterpolationEnvironment,
47 InterpolationEnvironment,
48 value,
49 value->IsCSS(),
50 value.IsCSS());
51
52 } // namespace blink
53
54 #endif // CSSInterpolationEnvironment_h
OLDNEW
« 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