diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebCore/css/WebKitCSSKeyframesRule.h | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebCore/css/WebKitCSSKeyframesRule.h')
-rw-r--r-- | Source/WebCore/css/WebKitCSSKeyframesRule.h | 67 |
1 files changed, 39 insertions, 28 deletions
diff --git a/Source/WebCore/css/WebKitCSSKeyframesRule.h b/Source/WebCore/css/WebKitCSSKeyframesRule.h index b1a1b8f10..81abf879a 100644 --- a/Source/WebCore/css/WebKitCSSKeyframesRule.h +++ b/Source/WebCore/css/WebKitCSSKeyframesRule.h @@ -27,6 +27,8 @@ #define WebKitCSSKeyframesRule_h #include "CSSRule.h" +#include "ExceptionCode.h" +#include "StyleRule.h" #include <wtf/Forward.h> #include <wtf/RefPtr.h> #include <wtf/text/AtomicString.h> @@ -34,35 +36,46 @@ namespace WebCore { class CSSRuleList; +class StyleKeyframe; class WebKitCSSKeyframeRule; -typedef int ExceptionCode; +class StyleRuleKeyframes : public StyleRuleBase { +public: + static PassRefPtr<StyleRuleKeyframes> create() { return adoptRef(new StyleRuleKeyframes()); } + + ~StyleRuleKeyframes(); + + const Vector<RefPtr<StyleKeyframe> >& keyframes() const { return m_keyframes; } + + void parserAppendKeyframe(PassRefPtr<StyleKeyframe>); + void wrapperAppendKeyframe(PassRefPtr<StyleKeyframe>); + void wrapperRemoveKeyframe(unsigned); + + String name() const { return m_name; } + void setName(const String& name) { m_name = AtomicString(name); } + + int findKeyframeIndex(const String& key) const; + + PassRefPtr<StyleRuleKeyframes> copy() const { return adoptRef(new StyleRuleKeyframes(*this)); } + +private: + StyleRuleKeyframes(); + StyleRuleKeyframes(const StyleRuleKeyframes&); + + Vector<RefPtr<StyleKeyframe> > m_keyframes; + AtomicString m_name; +}; class WebKitCSSKeyframesRule : public CSSRule { public: - static PassRefPtr<WebKitCSSKeyframesRule> create() - { - return adoptRef(new WebKitCSSKeyframesRule(0)); - } - static PassRefPtr<WebKitCSSKeyframesRule> create(CSSStyleSheet* parent) - { - return adoptRef(new WebKitCSSKeyframesRule(parent)); - } + static PassRefPtr<WebKitCSSKeyframesRule> create(StyleRuleKeyframes* rule, CSSStyleSheet* sheet) { return adoptRef(new WebKitCSSKeyframesRule(rule, sheet)); } ~WebKitCSSKeyframesRule(); - String name() const { return m_name; } + String name() const { return m_keyframesRule->name(); } void setName(const String&); - // This version of setName does not call styleSheetChanged to avoid - // unnecessary work. It assumes callers will either make that call - // themselves, or know that it will get called later. - void setNameInternal(const String& name) - { - m_name = AtomicString(name); - } - - CSSRuleList* cssRules() { return m_lstCSSRules.get(); } + CSSRuleList* cssRules(); void insertRule(const String& rule); void deleteRule(const String& key); @@ -70,19 +83,17 @@ public: String cssText() const; - // Not part of the CSSOM. - unsigned length() const { return m_lstCSSRules->length(); } - WebKitCSSKeyframeRule* item(unsigned index); - const WebKitCSSKeyframeRule* item(unsigned index) const; - void append(WebKitCSSKeyframeRule*); + // For IndexedGetter and CSSRuleList. + unsigned length() const; + WebKitCSSKeyframeRule* item(unsigned index) const; private: - WebKitCSSKeyframesRule(CSSStyleSheet* parent); + WebKitCSSKeyframesRule(StyleRuleKeyframes*, CSSStyleSheet* parent); - int findRuleIndex(const String& key) const; + RefPtr<StyleRuleKeyframes> m_keyframesRule; - RefPtr<CSSRuleList> m_lstCSSRules; - AtomicString m_name; + mutable Vector<RefPtr<WebKitCSSKeyframeRule> > m_childRuleCSSOMWrappers; + mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper; }; } // namespace WebCore |