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

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

Issue 2652063003: Remove dependency on StyleResolverState in CSSInterpolationType::maybeConvertUnderlyingValue() (Closed)
Patch Set: Rebased Created 3 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 | « third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/InterpolationEnvironment.h
diff --git a/third_party/WebKit/Source/core/animation/InterpolationEnvironment.h b/third_party/WebKit/Source/core/animation/InterpolationEnvironment.h
index 61d76add65e9a2bc2949e2ed977a794166c3f401..313793edbdab42f9c63ee35be2b7551ece765c12 100644
--- a/third_party/WebKit/Source/core/animation/InterpolationEnvironment.h
+++ b/third_party/WebKit/Source/core/animation/InterpolationEnvironment.h
@@ -6,12 +6,13 @@
#define InterpolationEnvironment_h
#include "core/animation/InterpolationTypesMap.h"
+#include "core/css/resolver/StyleResolverState.h"
#include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
namespace blink {
-class StyleResolverState;
+class ComputedStyle;
class SVGPropertyBase;
class SVGElement;
@@ -21,16 +22,16 @@ class InterpolationEnvironment {
public:
explicit InterpolationEnvironment(const InterpolationTypesMap& map,
StyleResolverState& state)
- : m_interpolationTypesMap(map),
- m_state(&state),
- m_svgElement(nullptr),
- m_svgBaseValue(nullptr) {}
+ : m_interpolationTypesMap(map), m_state(&state), m_style(state.style()) {}
+
+ explicit InterpolationEnvironment(const InterpolationTypesMap& map,
+ const ComputedStyle& style)
+ : m_interpolationTypesMap(map), m_style(&style) {}
explicit InterpolationEnvironment(const InterpolationTypesMap& map,
SVGElement& svgElement,
const SVGPropertyBase& svgBaseValue)
: m_interpolationTypesMap(map),
- m_state(nullptr),
m_svgElement(&svgElement),
m_svgBaseValue(&svgBaseValue) {}
@@ -47,6 +48,11 @@ class InterpolationEnvironment {
return *m_state;
}
+ const ComputedStyle& style() const {
+ DCHECK(m_style);
+ return *m_style;
+ }
+
SVGElement& svgElement() {
DCHECK(m_svgElement);
return *m_svgElement;
@@ -63,9 +69,14 @@ class InterpolationEnvironment {
private:
const InterpolationTypesMap& m_interpolationTypesMap;
- StyleResolverState* m_state;
- Member<SVGElement> m_svgElement;
- Member<const SVGPropertyBase> m_svgBaseValue;
+
+ // CSSInterpolationType environment
+ StyleResolverState* m_state = nullptr;
+ const ComputedStyle* m_style = nullptr;
+
+ // SVGInterpolationType environment
+ Member<SVGElement> m_svgElement = nullptr;
+ Member<const SVGPropertyBase> m_svgBaseValue = nullptr;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698