#ifndef CSSKeyframeRule_h
#define CSSKeyframeRule_h
#include "core/css/CSSRule.h"
namespace WebCore {
class CSSKeyframesRule;
class CSSParserValueList;
class CSSStyleDeclaration;
class MutableStylePropertySet;
class StylePropertySet;
class StyleRuleCSSStyleDeclaration;
class StyleKeyframe FINAL : public RefCountedWillBeGarbageCollectedFinalized<StyleKeyframe> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
public:
static PassRefPtrWillBeRawPtr<StyleKeyframe> create()
{
return adoptRefWillBeNoop(new StyleKeyframe());
}
~StyleKeyframe();
String keyText() const;
void setKeyText(const String&);
const Vector<double>& keys() const;
void setKeys(PassOwnPtr<Vector<double> >);
const StylePropertySet& properties() const { return *m_properties; }
MutableStylePropertySet& mutableProperties();
void setProperties(PassRefPtr<StylePropertySet>);
String cssText() const;
void trace(Visitor*) { }
static PassOwnPtr<Vector<double> > createKeyList(CSSParserValueList*);
private:
StyleKeyframe();
RefPtr<StylePropertySet> m_properties;
mutable String m_keyText;
mutable OwnPtr<Vector<double> > m_keys;
};
class CSSKeyframeRule FINAL : public CSSRule {
public:
virtual ~CSSKeyframeRule();
virtual CSSRule::Type type() const OVERRIDE { return KEYFRAME_RULE; }
virtual String cssText() const OVERRIDE { return m_keyframe->cssText(); }
virtual void reattach(StyleRuleBase*) OVERRIDE;
String keyText() const { return m_keyframe->keyText(); }
void setKeyText(const String& s) { m_keyframe->setKeyText(s); }
CSSStyleDeclaration* style() const;
virtual void trace(Visitor*) OVERRIDE;
private:
CSSKeyframeRule(StyleKeyframe*, CSSKeyframesRule* parent);
RefPtrWillBeMember<StyleKeyframe> m_keyframe;
mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
friend class CSSKeyframesRule;
};
DEFINE_CSS_RULE_TYPE_CASTS(CSSKeyframeRule, KEYFRAME_RULE);
}
#endif