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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 void setKeyText(const String& s) { m_key = s; } | 48 void setKeyText(const String& s) { m_key = s; } |
49 | 49 |
50 void getKeys(Vector<float>& keys) const { parseKeyString(m_key, keys); } | 50 void getKeys(Vector<float>& keys) const { parseKeyString(m_key, keys); } |
51 | 51 |
52 const StylePropertySet* properties() const { return m_properties.get(); } | 52 const StylePropertySet* properties() const { return m_properties.get(); } |
53 StylePropertySet* mutableProperties(); | 53 StylePropertySet* mutableProperties(); |
54 void setProperties(PassRefPtr<StylePropertySet>); | 54 void setProperties(PassRefPtr<StylePropertySet>); |
55 | 55 |
56 String cssText() const; | 56 String cssText() const; |
57 | 57 |
58 void reportMemoryUsage(MemoryObjectInfo*) const; | |
59 | |
60 private: | 58 private: |
61 StyleKeyframe(); | 59 StyleKeyframe(); |
62 | 60 |
63 static void parseKeyString(const String&, Vector<float>& keys); | 61 static void parseKeyString(const String&, Vector<float>& keys); |
64 | 62 |
65 RefPtr<StylePropertySet> m_properties; | 63 RefPtr<StylePropertySet> m_properties; |
66 // FIXME: This should be a parsed vector of floats. | 64 // FIXME: This should be a parsed vector of floats. |
67 // comma separated list of keys | 65 // comma separated list of keys |
68 String m_key; | 66 String m_key; |
69 }; | 67 }; |
70 | 68 |
71 class WebKitCSSKeyframeRule : public CSSRule { | 69 class WebKitCSSKeyframeRule : public CSSRule { |
72 public: | 70 public: |
73 virtual ~WebKitCSSKeyframeRule(); | 71 virtual ~WebKitCSSKeyframeRule(); |
74 | 72 |
75 virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_KEYFRAME_RULE; } | 73 virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_KEYFRAME_RULE; } |
76 virtual String cssText() const OVERRIDE { return m_keyframe->cssText(); } | 74 virtual String cssText() const OVERRIDE { return m_keyframe->cssText(); } |
77 virtual void reattach(StyleRuleBase*) OVERRIDE; | 75 virtual void reattach(StyleRuleBase*) OVERRIDE; |
78 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; | |
79 | 76 |
80 String keyText() const { return m_keyframe->keyText(); } | 77 String keyText() const { return m_keyframe->keyText(); } |
81 void setKeyText(const String& s) { m_keyframe->setKeyText(s); } | 78 void setKeyText(const String& s) { m_keyframe->setKeyText(s); } |
82 | 79 |
83 CSSStyleDeclaration* style() const; | 80 CSSStyleDeclaration* style() const; |
84 | 81 |
85 private: | 82 private: |
86 WebKitCSSKeyframeRule(StyleKeyframe*, WebKitCSSKeyframesRule* parent); | 83 WebKitCSSKeyframeRule(StyleKeyframe*, WebKitCSSKeyframesRule* parent); |
87 | 84 |
88 RefPtr<StyleKeyframe> m_keyframe; | 85 RefPtr<StyleKeyframe> m_keyframe; |
89 mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; | 86 mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper; |
90 | 87 |
91 friend class WebKitCSSKeyframesRule; | 88 friend class WebKitCSSKeyframesRule; |
92 }; | 89 }; |
93 | 90 |
94 } // namespace WebCore | 91 } // namespace WebCore |
95 | 92 |
96 #endif // WebKitCSSKeyframeRule_h | 93 #endif // WebKitCSSKeyframeRule_h |
OLD | NEW |