OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 AnimationEffect::CompositableValueMap m_compositableValuesForAnimations; | 145 AnimationEffect::CompositableValueMap m_compositableValuesForAnimations; |
146 AnimationEffect::CompositableValueMap m_compositableValuesForTransitions; | 146 AnimationEffect::CompositableValueMap m_compositableValuesForTransitions; |
147 }; | 147 }; |
148 | 148 |
149 class CSSAnimations FINAL { | 149 class CSSAnimations FINAL { |
150 public: | 150 public: |
151 static bool isAnimatableProperty(CSSPropertyID); | 151 static bool isAnimatableProperty(CSSPropertyID); |
152 static const StylePropertyShorthand& animatableProperties(); | 152 static const StylePropertyShorthand& animatableProperties(); |
153 // FIXME: This should take a const ScopedStyleTree instead of a StyleResolve
r. | 153 // FIXME: This should take a const ScopedStyleTree instead of a StyleResolve
r. |
154 // We should also change the Element* to a const Element* | 154 // We should also change the Element* to a const Element* |
155 static PassOwnPtr<CSSAnimationUpdate> calculateUpdate(Element*, const Render
Style*, StyleResolver*); | 155 static PassOwnPtr<CSSAnimationUpdate> calculateUpdate(Element*, const Render
Style&, StyleResolver*); |
156 | 156 |
157 void setPendingUpdate(PassOwnPtr<CSSAnimationUpdate> update) { m_pendingUpda
te = update; } | 157 void setPendingUpdate(PassOwnPtr<CSSAnimationUpdate> update) { m_pendingUpda
te = update; } |
158 void maybeApplyPendingUpdate(Element*); | 158 void maybeApplyPendingUpdate(Element*); |
159 bool isEmpty() const { return m_animations.isEmpty() && m_transitions.isEmpt
y() && !m_pendingUpdate; } | 159 bool isEmpty() const { return m_animations.isEmpty() && m_transitions.isEmpt
y() && !m_pendingUpdate; } |
160 void cancel(); | 160 void cancel(); |
161 private: | 161 private: |
162 // Note that a single animation name may map to multiple players due to | 162 // Note that a single animation name may map to multiple players due to |
163 // the way in which we split up animations with incomplete keyframes. | 163 // the way in which we split up animations with incomplete keyframes. |
164 // FIXME: Once the Web Animations model supports groups, we could use a | 164 // FIXME: Once the Web Animations model supports groups, we could use a |
165 // ParGroup to drive multiple animations from a single Player. | 165 // ParGroup to drive multiple animations from a single Player. |
166 typedef HashMap<AtomicString, HashSet<RefPtr<Player> > > AnimationMap; | 166 typedef HashMap<AtomicString, HashSet<RefPtr<Player> > > AnimationMap; |
167 struct RunningTransition { | 167 struct RunningTransition { |
168 Animation* transition; // The TransitionTimeline keeps the Players alive | 168 Animation* transition; // The TransitionTimeline keeps the Players alive |
169 const AnimatableValue* from; | 169 const AnimatableValue* from; |
170 const AnimatableValue* to; | 170 const AnimatableValue* to; |
171 }; | 171 }; |
172 typedef HashMap<CSSPropertyID, RunningTransition > TransitionMap; | 172 typedef HashMap<CSSPropertyID, RunningTransition > TransitionMap; |
173 AnimationMap m_animations; | 173 AnimationMap m_animations; |
174 TransitionMap m_transitions; | 174 TransitionMap m_transitions; |
175 OwnPtr<CSSAnimationUpdate> m_pendingUpdate; | 175 OwnPtr<CSSAnimationUpdate> m_pendingUpdate; |
176 | 176 |
177 AnimationEffect::CompositableValueMap m_previousCompositableValuesForAnimati
ons; | 177 AnimationEffect::CompositableValueMap m_previousCompositableValuesForAnimati
ons; |
178 | 178 |
179 static void calculateAnimationUpdate(CSSAnimationUpdate*, Element*, const Re
nderStyle*, StyleResolver*); | 179 static void calculateAnimationUpdate(CSSAnimationUpdate*, Element*, const Re
nderStyle&, StyleResolver*); |
180 static void calculateTransitionUpdate(CSSAnimationUpdate*, const Element*, c
onst RenderStyle*); | 180 static void calculateTransitionUpdate(CSSAnimationUpdate*, const Element*, c
onst RenderStyle&); |
181 static void calculateTransitionUpdateForProperty(CSSAnimationUpdate*, CSSPro
pertyID, const CandidateTransition&, const TransitionMap*); | 181 static void calculateTransitionUpdateForProperty(CSSAnimationUpdate*, CSSPro
pertyID, const CandidateTransition&, const TransitionMap*); |
182 | 182 |
183 static void calculateAnimationCompositableValues(CSSAnimationUpdate*, const
Element*); | 183 static void calculateAnimationCompositableValues(CSSAnimationUpdate*, const
Element*); |
184 static void calculateTransitionCompositableValues(CSSAnimationUpdate*, const
Element*); | 184 static void calculateTransitionCompositableValues(CSSAnimationUpdate*, const
Element*); |
185 | 185 |
186 class AnimationEventDelegate FINAL : public TimedItem::EventDelegate { | 186 class AnimationEventDelegate FINAL : public TimedItem::EventDelegate { |
187 public: | 187 public: |
188 AnimationEventDelegate(Element* target, const AtomicString& name) | 188 AnimationEventDelegate(Element* target, const AtomicString& name) |
189 : m_target(target) | 189 : m_target(target) |
190 , m_name(name) | 190 , m_name(name) |
(...skipping 16 matching lines...) Expand all Loading... |
207 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Time
dItem::Phase previousPhase, double previousIteration) OVERRIDE; | 207 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Time
dItem::Phase previousPhase, double previousIteration) OVERRIDE; |
208 private: | 208 private: |
209 Element* m_target; | 209 Element* m_target; |
210 const CSSPropertyID m_property; | 210 const CSSPropertyID m_property; |
211 }; | 211 }; |
212 }; | 212 }; |
213 | 213 |
214 } // namespace WebCore | 214 } // namespace WebCore |
215 | 215 |
216 #endif | 216 #endif |
OLD | NEW |