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

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

Issue 1885353004: Add ComputedStyle constructor and getter to InterpolationEnvironment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_transformInterpolationType
Patch Set: Rebased Created 4 years, 4 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/InterpolationEnvironment.h
diff --git a/third_party/WebKit/Source/core/animation/InterpolationEnvironment.h b/third_party/WebKit/Source/core/animation/InterpolationEnvironment.h
index b89c91a228f9e647e734296c3141a757e8b873cf..ea8e2bdcf149db5acdb20116f8865fc0e289eb5b 100644
--- a/third_party/WebKit/Source/core/animation/InterpolationEnvironment.h
+++ b/third_party/WebKit/Source/core/animation/InterpolationEnvironment.h
@@ -10,6 +10,7 @@
namespace blink {
+class ComputedStyle;
class StyleResolverState;
class SVGPropertyBase;
class SVGElement;
@@ -17,28 +18,36 @@ class SVGElement;
class InterpolationEnvironment {
STACK_ALLOCATED();
public:
- explicit InterpolationEnvironment(StyleResolverState& state)
- : m_state(&state)
+ explicit InterpolationEnvironment(const ComputedStyle& style)
+ : m_state(nullptr)
+ , m_style(&style)
, m_svgElement(nullptr)
, m_svgBaseValue(nullptr)
{ }
+ explicit InterpolationEnvironment(StyleResolverState&);
+
explicit InterpolationEnvironment(SVGElement& svgElement, const SVGPropertyBase& svgBaseValue)
: m_state(nullptr)
+ , m_style(nullptr)
, m_svgElement(&svgElement)
, m_svgBaseValue(&svgBaseValue)
{ }
- StyleResolverState& state() { ASSERT(m_state); return *m_state; }
- const StyleResolverState& state() const { ASSERT(m_state); return *m_state; }
+ StyleResolverState& state() { DCHECK(m_state); return *m_state; }
+ const StyleResolverState& state() const { DCHECK(m_state); return *m_state; }
+
+ ComputedStyle& style();
+ const ComputedStyle& style() const { DCHECK(m_style); return *m_style; }
- SVGElement& svgElement() { ASSERT(m_svgElement); return *m_svgElement; }
- const SVGElement& svgElement() const { ASSERT(m_svgElement); return *m_svgElement; }
+ SVGElement& svgElement() { DCHECK(m_svgElement); return *m_svgElement; }
+ const SVGElement& svgElement() const { DCHECK(m_svgElement); return *m_svgElement; }
- const SVGPropertyBase& svgBaseValue() const { ASSERT(m_svgBaseValue); return *m_svgBaseValue; }
+ const SVGPropertyBase& svgBaseValue() const { DCHECK(m_svgBaseValue); return *m_svgBaseValue; }
private:
StyleResolverState* m_state;
+ const ComputedStyle* m_style;
Member<SVGElement> m_svgElement;
Member<const SVGPropertyBase> m_svgBaseValue;
};

Powered by Google App Engine
This is Rietveld 408576698