| 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef CSSAnimations_h | 31 #ifndef CSSAnimations_h |
| 32 #define CSSAnimations_h | 32 #define CSSAnimations_h |
| 33 | 33 |
| 34 #include "core/animation/Animation.h" | 34 #include "core/animation/Animation.h" |
| 35 | 35 |
| 36 #include "core/animation/Player.h" | 36 #include "core/animation/Player.h" |
| 37 #include "core/css/StylePropertySet.h" | 37 #include "core/css/StylePropertySet.h" |
| 38 #include "core/dom/Document.h" |
| 38 #include "core/platform/animation/CSSAnimationData.h" | 39 #include "core/platform/animation/CSSAnimationData.h" |
| 39 #include "core/rendering/style/RenderStyleConstants.h" | 40 #include "core/rendering/style/RenderStyleConstants.h" |
| 40 #include "wtf/HashMap.h" | 41 #include "wtf/HashMap.h" |
| 41 #include "wtf/HashSet.h" | 42 #include "wtf/HashSet.h" |
| 42 #include "wtf/Vector.h" | 43 #include "wtf/Vector.h" |
| 43 #include "wtf/text/AtomicString.h" | 44 #include "wtf/text/AtomicString.h" |
| 44 | 45 |
| 45 namespace WebCore { | 46 namespace WebCore { |
| 46 | 47 |
| 47 class CSSAnimationDataList; | 48 class CSSAnimationDataList; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 71 class CSSAnimations FINAL { | 72 class CSSAnimations FINAL { |
| 72 public: | 73 public: |
| 73 static bool needsUpdate(const Element*, const RenderStyle*); | 74 static bool needsUpdate(const Element*, const RenderStyle*); |
| 74 static PassOwnPtr<CSSAnimationUpdate> calculateUpdate(const Element*, EDispl
ay, const CSSAnimations*, const CSSAnimationDataList*, StyleResolver*); | 75 static PassOwnPtr<CSSAnimationUpdate> calculateUpdate(const Element*, EDispl
ay, const CSSAnimations*, const CSSAnimationDataList*, StyleResolver*); |
| 75 void update(Element*, const RenderStyle*); | 76 void update(Element*, const RenderStyle*); |
| 76 bool isEmpty() const { return m_animations.isEmpty(); } | 77 bool isEmpty() const { return m_animations.isEmpty(); } |
| 77 void cancel(); | 78 void cancel(); |
| 78 private: | 79 private: |
| 79 typedef HashMap<StringImpl*, Player*> AnimationMap; | 80 typedef HashMap<StringImpl*, Player*> AnimationMap; |
| 80 AnimationMap m_animations; | 81 AnimationMap m_animations; |
| 82 class EventDelegate FINAL : public TimedItemEventDelegate { |
| 83 public: |
| 84 EventDelegate(Element* target, const AtomicString& name) |
| 85 : m_target(target) |
| 86 , m_name(name) |
| 87 { |
| 88 } |
| 89 virtual void onEventCondition(bool wasInPlay, bool isInPlay, double prev
iousIteration, double currentIteration) OVERRIDE; |
| 90 private: |
| 91 void dispatch(Document::ListenerType, AtomicString& eventName, double el
apsedTime); |
| 92 Element* m_target; |
| 93 const AtomicString m_name; |
| 94 }; |
| 81 }; | 95 }; |
| 82 | 96 |
| 83 } // namespace WebCore | 97 } // namespace WebCore |
| 84 | 98 |
| 85 #endif | 99 #endif |
| OLD | NEW |