OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
12 * | 12 * |
13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
17 * | 17 * |
18 * You should have received a copy of the GNU Library General Public License | 18 * You should have received a copy of the GNU Library General Public License |
19 * along with this library; see the file COPYING.LIB. If not, write to | 19 * along with this library; see the file COPYING.LIB. If not, write to |
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #ifndef CSSAnimationData_h | 25 #ifndef CSSAnimationData_h |
26 #define CSSAnimationData_h | 26 #define CSSAnimationData_h |
27 | 27 |
28 #include "CSSPropertyNames.h" | 28 #include "CSSPropertyNames.h" |
29 #include "core/rendering/style/RenderStyleConstants.h" | 29 #include "core/rendering/style/RenderStyleConstants.h" |
| 30 #include "heap/Handle.h" |
30 #include "platform/animation/TimingFunction.h" | 31 #include "platform/animation/TimingFunction.h" |
31 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
32 #include "wtf/RefCounted.h" | 33 #include "wtf/RefCounted.h" |
33 #include "wtf/text/WTFString.h" | 34 #include "wtf/text/WTFString.h" |
34 | 35 |
35 namespace WebCore { | 36 namespace WebCore { |
36 | 37 |
37 class CSSAnimationData : public RefCounted<CSSAnimationData> { | 38 class CSSAnimationData FINAL : public RefCountedWillBeGarbageCollectedFinalized<
CSSAnimationData> { |
38 public: | 39 public: |
39 ~CSSAnimationData(); | 40 ~CSSAnimationData(); |
40 | 41 |
41 static PassRefPtr<CSSAnimationData> create() { return adoptRef(new CSSAnimat
ionData); } | 42 static PassRefPtrWillBeRawPtr<CSSAnimationData> create() |
42 static PassRefPtr<CSSAnimationData> create(const CSSAnimationData* o) { retu
rn adoptRef(new CSSAnimationData(*o)); } | 43 { |
| 44 return adoptRefWillBeNoop(new CSSAnimationData); |
| 45 } |
| 46 |
| 47 static PassRefPtrWillBeRawPtr<CSSAnimationData> create(const CSSAnimationDat
a* o) |
| 48 { |
| 49 return adoptRefWillBeNoop(new CSSAnimationData(*o)); |
| 50 } |
43 | 51 |
44 bool isDelaySet() const { return m_delaySet; } | 52 bool isDelaySet() const { return m_delaySet; } |
45 bool isDirectionSet() const { return m_directionSet; } | 53 bool isDirectionSet() const { return m_directionSet; } |
46 bool isDurationSet() const { return m_durationSet; } | 54 bool isDurationSet() const { return m_durationSet; } |
47 bool isFillModeSet() const { return m_fillModeSet; } | 55 bool isFillModeSet() const { return m_fillModeSet; } |
48 bool isIterationCountSet() const { return m_iterationCountSet; } | 56 bool isIterationCountSet() const { return m_iterationCountSet; } |
49 bool isNameSet() const { return m_nameSet; } | 57 bool isNameSet() const { return m_nameSet; } |
50 bool isPlayStateSet() const { return m_playStateSet; } | 58 bool isPlayStateSet() const { return m_playStateSet; } |
51 bool isPropertySet() const { return m_propertySet; } | 59 bool isPropertySet() const { return m_propertySet; } |
52 bool isTimingFunctionSet() const { return m_timingFunctionSet; } | 60 bool isTimingFunctionSet() const { return m_timingFunctionSet; } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 void setAnimationMode(AnimationMode mode) { m_mode = mode; } | 135 void setAnimationMode(AnimationMode mode) { m_mode = mode; } |
128 | 136 |
129 void setIsNoneAnimation(bool n) { m_isNone = n; } | 137 void setIsNoneAnimation(bool n) { m_isNone = n; } |
130 | 138 |
131 CSSAnimationData& operator=(const CSSAnimationData&); | 139 CSSAnimationData& operator=(const CSSAnimationData&); |
132 | 140 |
133 // return true every CSSAnimationData in the chain (defined by m_next) match | 141 // return true every CSSAnimationData in the chain (defined by m_next) match |
134 bool operator==(const CSSAnimationData& o) const { return animationsMatchFor
StyleRecalc(&o); } | 142 bool operator==(const CSSAnimationData& o) const { return animationsMatchFor
StyleRecalc(&o); } |
135 bool operator!=(const CSSAnimationData& o) const { return !(*this == o); } | 143 bool operator!=(const CSSAnimationData& o) const { return !(*this == o); } |
136 | 144 |
| 145 void trace(Visitor*) { } |
| 146 |
137 private: | 147 private: |
138 CSSAnimationData(); | 148 CSSAnimationData(); |
139 explicit CSSAnimationData(const CSSAnimationData&); | 149 explicit CSSAnimationData(const CSSAnimationData&); |
140 | 150 |
141 // Return whether this object matches another CSSAnimationData object for | 151 // Return whether this object matches another CSSAnimationData object for |
142 // the purposes of style recalc. This excludes some properties. | 152 // the purposes of style recalc. This excludes some properties. |
143 bool animationsMatchForStyleRecalc(const CSSAnimationData*) const; | 153 bool animationsMatchForStyleRecalc(const CSSAnimationData*) const; |
144 | 154 |
145 AtomicString m_name; | 155 AtomicString m_name; |
146 CSSPropertyID m_property; | 156 CSSPropertyID m_property; |
(...skipping 27 matching lines...) Expand all Loading... |
174 static double initialAnimationIterationCount() { return 1.0; } | 184 static double initialAnimationIterationCount() { return 1.0; } |
175 static const AtomicString& initialAnimationName(); | 185 static const AtomicString& initialAnimationName(); |
176 static EAnimPlayState initialAnimationPlayState() { return AnimPlayStatePlay
ing; } | 186 static EAnimPlayState initialAnimationPlayState() { return AnimPlayStatePlay
ing; } |
177 static CSSPropertyID initialAnimationProperty() { return CSSPropertyInvalid;
} | 187 static CSSPropertyID initialAnimationProperty() { return CSSPropertyInvalid;
} |
178 static const PassRefPtr<TimingFunction> initialAnimationTimingFunction() { r
eturn CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease); } | 188 static const PassRefPtr<TimingFunction> initialAnimationTimingFunction() { r
eturn CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease); } |
179 }; | 189 }; |
180 | 190 |
181 } // namespace WebCore | 191 } // namespace WebCore |
182 | 192 |
183 #endif // CSSAnimationData_h | 193 #endif // CSSAnimationData_h |
OLD | NEW |