WebKitCSSKeyframeRule.h [plain text]
#ifndef WebKitCSSKeyframeRule_h
#define WebKitCSSKeyframeRule_h
#include "CSSRule.h"
#include "ExceptionCode.h"
#include "StylePropertySet.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
class StyleRuleCSSStyleDeclaration;
class WebKitCSSKeyframesRule;
class StyleKeyframe : public RefCounted<StyleKeyframe> {
public:
static PassRefPtr<StyleKeyframe> create()
{
return adoptRef(new StyleKeyframe());
}
String keyText() const { return m_key; }
void setKeyText(const String& s) { m_key = s; }
void getKeys(Vector<float>& keys) const { parseKeyString(m_key, keys); }
StylePropertySet* properties() const { return m_properties.get(); }
void setProperties(PassRefPtr<StylePropertySet>);
String cssText() const;
private:
StyleKeyframe() { }
static void parseKeyString(const String&, Vector<float>& keys);
RefPtr<StylePropertySet> m_properties;
String m_key;
};
class WebKitCSSKeyframeRule : public CSSRule {
public:
~WebKitCSSKeyframeRule();
String keyText() const { return m_keyframe->keyText(); }
void setKeyText(const String& s) { m_keyframe->setKeyText(s); }
CSSStyleDeclaration* style() const;
String cssText() const { return m_keyframe->cssText(); }
private:
WebKitCSSKeyframeRule(StyleKeyframe*, WebKitCSSKeyframesRule* parent);
RefPtr<StyleKeyframe> m_keyframe;
mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
friend class WebKitCSSKeyframesRule;
};
}
#endif // WebKitCSSKeyframeRule_h