From 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 7 May 2012 11:21:11 +0200 Subject: Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286) --- Source/WebCore/css/WebKitCSSKeyframesRule.h | 67 +++++++++++++++++------------ 1 file changed, 39 insertions(+), 28 deletions(-) (limited to 'Source/WebCore/css/WebKitCSSKeyframesRule.h') 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 #include #include @@ -34,35 +36,46 @@ namespace WebCore { class CSSRuleList; +class StyleKeyframe; class WebKitCSSKeyframeRule; -typedef int ExceptionCode; +class StyleRuleKeyframes : public StyleRuleBase { +public: + static PassRefPtr create() { return adoptRef(new StyleRuleKeyframes()); } + + ~StyleRuleKeyframes(); + + const Vector >& keyframes() const { return m_keyframes; } + + void parserAppendKeyframe(PassRefPtr); + void wrapperAppendKeyframe(PassRefPtr); + 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 copy() const { return adoptRef(new StyleRuleKeyframes(*this)); } + +private: + StyleRuleKeyframes(); + StyleRuleKeyframes(const StyleRuleKeyframes&); + + Vector > m_keyframes; + AtomicString m_name; +}; class WebKitCSSKeyframesRule : public CSSRule { public: - static PassRefPtr create() - { - return adoptRef(new WebKitCSSKeyframesRule(0)); - } - static PassRefPtr create(CSSStyleSheet* parent) - { - return adoptRef(new WebKitCSSKeyframesRule(parent)); - } + static PassRefPtr 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 m_keyframesRule; - RefPtr m_lstCSSRules; - AtomicString m_name; + mutable Vector > m_childRuleCSSOMWrappers; + mutable OwnPtr m_ruleListCSSOMWrapper; }; } // namespace WebCore -- cgit v1.2.1