| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 { | 67 { |
| 68 m_cancelledAnimationNames.append(name); | 68 m_cancelledAnimationNames.append(name); |
| 69 for (HashSet<RefPtr<AnimationPlayer> >::const_iterator iter = players.be
gin(); iter != players.end(); ++iter) | 69 for (HashSet<RefPtr<AnimationPlayer> >::const_iterator iter = players.be
gin(); iter != players.end(); ++iter) |
| 70 m_cancelledAnimationAnimationPlayers.add(iter->get()); | 70 m_cancelledAnimationAnimationPlayers.add(iter->get()); |
| 71 } | 71 } |
| 72 void toggleAnimationPaused(const AtomicString& name) | 72 void toggleAnimationPaused(const AtomicString& name) |
| 73 { | 73 { |
| 74 m_animationsWithPauseToggled.append(name); | 74 m_animationsWithPauseToggled.append(name); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void startTransition(CSSPropertyID id, const AnimatableValue* from, const An
imatableValue* to, PassRefPtr<InertAnimation> animation) | 77 void startTransition(CSSPropertyID id, CSSPropertyID eventId, const Animatab
leValue* from, const AnimatableValue* to, PassRefPtr<InertAnimation> animation) |
| 78 { | 78 { |
| 79 NewTransition newTransition; | 79 NewTransition newTransition; |
| 80 newTransition.id = id; | 80 newTransition.id = id; |
| 81 newTransition.eventId = eventId; |
| 81 newTransition.from = from; | 82 newTransition.from = from; |
| 82 newTransition.to = to; | 83 newTransition.to = to; |
| 83 newTransition.animation = animation; | 84 newTransition.animation = animation; |
| 84 m_newTransitions.set(id, newTransition); | 85 m_newTransitions.set(id, newTransition); |
| 85 } | 86 } |
| 86 bool isCancelledTransition(CSSPropertyID id) const { return m_cancelledTrans
itions.contains(id); } | 87 bool isCancelledTransition(CSSPropertyID id) const { return m_cancelledTrans
itions.contains(id); } |
| 87 void cancelTransition(CSSPropertyID id) { m_cancelledTransitions.add(id); } | 88 void cancelTransition(CSSPropertyID id) { m_cancelledTransitions.add(id); } |
| 88 | 89 |
| 89 struct NewAnimation { | 90 struct NewAnimation { |
| 90 AtomicString name; | 91 AtomicString name; |
| 91 HashSet<RefPtr<InertAnimation> > animations; | 92 HashSet<RefPtr<InertAnimation> > animations; |
| 92 }; | 93 }; |
| 93 const Vector<NewAnimation>& newAnimations() const { return m_newAnimations;
} | 94 const Vector<NewAnimation>& newAnimations() const { return m_newAnimations;
} |
| 94 const Vector<AtomicString>& cancelledAnimationNames() const { return m_cance
lledAnimationNames; } | 95 const Vector<AtomicString>& cancelledAnimationNames() const { return m_cance
lledAnimationNames; } |
| 95 const HashSet<const AnimationPlayer*>& cancelledAnimationAnimationPlayers()
const { return m_cancelledAnimationAnimationPlayers; } | 96 const HashSet<const AnimationPlayer*>& cancelledAnimationAnimationPlayers()
const { return m_cancelledAnimationAnimationPlayers; } |
| 96 const Vector<AtomicString>& animationsWithPauseToggled() const { return m_an
imationsWithPauseToggled; } | 97 const Vector<AtomicString>& animationsWithPauseToggled() const { return m_an
imationsWithPauseToggled; } |
| 97 | 98 |
| 98 struct NewTransition { | 99 struct NewTransition { |
| 99 ALLOW_ONLY_INLINE_ALLOCATION(); | 100 ALLOW_ONLY_INLINE_ALLOCATION(); |
| 100 public: | 101 public: |
| 101 void trace(Visitor* visitor) | 102 void trace(Visitor* visitor) |
| 102 { | 103 { |
| 103 visitor->trace(from); | 104 visitor->trace(from); |
| 104 visitor->trace(to); | 105 visitor->trace(to); |
| 105 } | 106 } |
| 106 | 107 |
| 107 CSSPropertyID id; | 108 CSSPropertyID id; |
| 109 CSSPropertyID eventId; |
| 108 RawPtrWillBeMember<const AnimatableValue> from; | 110 RawPtrWillBeMember<const AnimatableValue> from; |
| 109 RawPtrWillBeMember<const AnimatableValue> to; | 111 RawPtrWillBeMember<const AnimatableValue> to; |
| 110 RefPtr<InertAnimation> animation; | 112 RefPtr<InertAnimation> animation; |
| 111 }; | 113 }; |
| 112 typedef WillBePersistentHeapHashMap<CSSPropertyID, NewTransition> NewTransit
ionMap; | 114 typedef WillBePersistentHeapHashMap<CSSPropertyID, NewTransition> NewTransit
ionMap; |
| 113 const NewTransitionMap& newTransitions() const { return m_newTransitions; } | 115 const NewTransitionMap& newTransitions() const { return m_newTransitions; } |
| 114 const HashSet<CSSPropertyID>& cancelledTransitions() const { return m_cancel
ledTransitions; } | 116 const HashSet<CSSPropertyID>& cancelledTransitions() const { return m_cancel
ledTransitions; } |
| 115 | 117 |
| 116 void adoptActiveInterpolationsForAnimations(WillBeHeapHashMap<CSSPropertyID,
RefPtrWillBeMember<Interpolation> >& newMap) { newMap.swap(m_activeInterpolatio
nsForAnimations); } | 118 void adoptActiveInterpolationsForAnimations(WillBeHeapHashMap<CSSPropertyID,
RefPtrWillBeMember<Interpolation> >& newMap) { newMap.swap(m_activeInterpolatio
nsForAnimations); } |
| 117 void adoptActiveInterpolationsForTransitions(WillBeHeapHashMap<CSSPropertyID
, RefPtrWillBeMember<Interpolation> >& newMap) { newMap.swap(m_activeInterpolati
onsForTransitions); } | 119 void adoptActiveInterpolationsForTransitions(WillBeHeapHashMap<CSSPropertyID
, RefPtrWillBeMember<Interpolation> >& newMap) { newMap.swap(m_activeInterpolati
onsForTransitions); } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Time
dItem::Phase previousPhase, double previousIteration) OVERRIDE; | 224 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Time
dItem::Phase previousPhase, double previousIteration) OVERRIDE; |
| 223 private: | 225 private: |
| 224 Element* m_target; | 226 Element* m_target; |
| 225 const CSSPropertyID m_property; | 227 const CSSPropertyID m_property; |
| 226 }; | 228 }; |
| 227 }; | 229 }; |
| 228 | 230 |
| 229 } // namespace WebCore | 231 } // namespace WebCore |
| 230 | 232 |
| 231 #endif | 233 #endif |
| OLD | NEW |