OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void wrapperAppendKeyframe(PassRefPtr<StyleKeyframe>); | 49 void wrapperAppendKeyframe(PassRefPtr<StyleKeyframe>); |
50 void wrapperRemoveKeyframe(unsigned); | 50 void wrapperRemoveKeyframe(unsigned); |
51 | 51 |
52 String name() const { return m_name; } | 52 String name() const { return m_name; } |
53 void setName(const String& name) { m_name = AtomicString(name); } | 53 void setName(const String& name) { m_name = AtomicString(name); } |
54 | 54 |
55 int findKeyframeIndex(const String& key) const; | 55 int findKeyframeIndex(const String& key) const; |
56 | 56 |
57 PassRefPtr<StyleRuleKeyframes> copy() const { return adoptRef(new StyleRuleK
eyframes(*this)); } | 57 PassRefPtr<StyleRuleKeyframes> copy() const { return adoptRef(new StyleRuleK
eyframes(*this)); } |
58 | 58 |
59 void reportDescendantMemoryUsage(MemoryObjectInfo*) const; | |
60 | |
61 private: | 59 private: |
62 StyleRuleKeyframes(); | 60 StyleRuleKeyframes(); |
63 StyleRuleKeyframes(const StyleRuleKeyframes&); | 61 StyleRuleKeyframes(const StyleRuleKeyframes&); |
64 | 62 |
65 Vector<RefPtr<StyleKeyframe> > m_keyframes; | 63 Vector<RefPtr<StyleKeyframe> > m_keyframes; |
66 AtomicString m_name; | 64 AtomicString m_name; |
67 }; | 65 }; |
68 | 66 |
69 class WebKitCSSKeyframesRule : public CSSRule { | 67 class WebKitCSSKeyframesRule : public CSSRule { |
70 public: | 68 public: |
71 static PassRefPtr<WebKitCSSKeyframesRule> create(StyleRuleKeyframes* rule, C
SSStyleSheet* sheet) { return adoptRef(new WebKitCSSKeyframesRule(rule, sheet));
} | 69 static PassRefPtr<WebKitCSSKeyframesRule> create(StyleRuleKeyframes* rule, C
SSStyleSheet* sheet) { return adoptRef(new WebKitCSSKeyframesRule(rule, sheet));
} |
72 | 70 |
73 virtual ~WebKitCSSKeyframesRule(); | 71 virtual ~WebKitCSSKeyframesRule(); |
74 | 72 |
75 virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_KEYFRAMES_RULE;
} | 73 virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_KEYFRAMES_RULE;
} |
76 virtual String cssText() const OVERRIDE; | 74 virtual String cssText() const OVERRIDE; |
77 virtual void reattach(StyleRuleBase*) OVERRIDE; | 75 virtual void reattach(StyleRuleBase*) OVERRIDE; |
78 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; | |
79 | 76 |
80 String name() const { return m_keyframesRule->name(); } | 77 String name() const { return m_keyframesRule->name(); } |
81 void setName(const String&); | 78 void setName(const String&); |
82 | 79 |
83 CSSRuleList* cssRules(); | 80 CSSRuleList* cssRules(); |
84 | 81 |
85 void insertRule(const String& rule); | 82 void insertRule(const String& rule); |
86 void deleteRule(const String& key); | 83 void deleteRule(const String& key); |
87 WebKitCSSKeyframeRule* findRule(const String& key); | 84 WebKitCSSKeyframeRule* findRule(const String& key); |
88 | 85 |
89 // For IndexedGetter and CSSRuleList. | 86 // For IndexedGetter and CSSRuleList. |
90 unsigned length() const; | 87 unsigned length() const; |
91 WebKitCSSKeyframeRule* item(unsigned index) const; | 88 WebKitCSSKeyframeRule* item(unsigned index) const; |
92 | 89 |
93 private: | 90 private: |
94 WebKitCSSKeyframesRule(StyleRuleKeyframes*, CSSStyleSheet* parent); | 91 WebKitCSSKeyframesRule(StyleRuleKeyframes*, CSSStyleSheet* parent); |
95 | 92 |
96 RefPtr<StyleRuleKeyframes> m_keyframesRule; | 93 RefPtr<StyleRuleKeyframes> m_keyframesRule; |
97 mutable Vector<RefPtr<WebKitCSSKeyframeRule> > m_childRuleCSSOMWrappers; | 94 mutable Vector<RefPtr<WebKitCSSKeyframeRule> > m_childRuleCSSOMWrappers; |
98 mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper; | 95 mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper; |
99 }; | 96 }; |
100 | 97 |
101 } // namespace WebCore | 98 } // namespace WebCore |
102 | 99 |
103 #endif // WebKitCSSKeyframesRule_h | 100 #endif // WebKitCSSKeyframesRule_h |
OLD | NEW |