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

Unified Diff: Source/core/animation/StringKeyframe.h

Issue 194733002: Web Animations: Use StringKeyframes for element.animate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 9 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: Source/core/animation/StringKeyframe.h
diff --git a/Source/core/animation/StringKeyframe.h b/Source/core/animation/StringKeyframe.h
index fb8a452b00ade9774190302cc8fc3a35a545bae3..98bc15dadca374d240e3a7acdf9f7706a2c20d68 100644
--- a/Source/core/animation/StringKeyframe.h
+++ b/Source/core/animation/StringKeyframe.h
@@ -5,23 +5,21 @@
#ifndef StringKeyframe_h
#define StringKeyframe_h
-#include "core/animation/AnimatableValue.h"
#include "core/animation/Keyframe.h"
namespace WebCore {
+class StyleSheetContents;
+
class StringKeyframe : public Keyframe {
public:
static PassRefPtrWillBeRawPtr<StringKeyframe> create()
{
return adoptRefWillBeNoop(new StringKeyframe);
}
- void setPropertyValue(CSSPropertyID property, const String& value)
- {
- m_propertyValues.add(property, value);
- }
+ void setPropertyValue(CSSPropertyID, const String& value, StyleSheetContents*);
void clearPropertyValue(CSSPropertyID property) { m_propertyValues.remove(property); }
- String propertyValue(CSSPropertyID property) const
+ CSSValue* propertyValue(CSSPropertyID property) const
{
ASSERT(m_propertyValues.contains(property));
return m_propertyValues.get(property);
@@ -32,22 +30,22 @@ public:
class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe {
public:
- PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, const String& value, AnimationEffect::CompositeOperation);
+ PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, CSSValue*, AnimationEffect::CompositeOperation);
- const String& value() const { return m_value; }
+ CSSValue* value() const { return m_value.get(); }
virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const OVERRIDE FINAL;
- virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPropertyID, WebCore::Keyframe::PropertySpecificKeyframe* end) const OVERRIDE FINAL;
+ virtual PassRefPtrWillBeRawPtr<Interpolation> createInterpolation(CSSPropertyID, WebCore::Keyframe::PropertySpecificKeyframe* end, Element*) const OVERRIDE FINAL;
virtual void trace(Visitor*) OVERRIDE;
private:
- PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, const String& value);
+ PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, CSSValue*);
virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(double offset) const;
virtual bool isStringPropertySpecificKeyframe() const OVERRIDE { return true; }
- String m_value;
+ RefPtr<CSSValue> m_value;
};
private:
@@ -55,17 +53,21 @@ private:
StringKeyframe(const StringKeyframe& copyFrom);
+ void setPropertyCSSValue(CSSPropertyID, CSSValue*);
virtual PassRefPtrWillBeRawPtr<Keyframe> clone() const OVERRIDE;
virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> createPropertySpecificKeyframe(CSSPropertyID) const OVERRIDE;
virtual bool isStringKeyframe() const OVERRIDE { return true; }
- typedef HashMap<CSSPropertyID, String> PropertyValueMap;
+ typedef HashMap<CSSPropertyID, RefPtr<CSSValue> > PropertyValueMap;
PropertyValueMap m_propertyValues;
};
typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe;
+DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), value.isStringKeyframe());
+DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyframe, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySpecificKeyframe());
+
}
#endif

Powered by Google App Engine
This is Rietveld 408576698