| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 const Vector<AtomicString>& cancelledAnimationNames() const { return m_cance
lledAnimationNames; } | 82 const Vector<AtomicString>& cancelledAnimationNames() const { return m_cance
lledAnimationNames; } |
| 83 private: | 83 private: |
| 84 // Order is significant since it defines the order in which new animations w
ill be started. | 84 // Order is significant since it defines the order in which new animations w
ill be started. |
| 85 Vector<NewAnimation> m_newAnimations; | 85 Vector<NewAnimation> m_newAnimations; |
| 86 Vector<AtomicString> m_cancelledAnimationNames; | 86 Vector<AtomicString> m_cancelledAnimationNames; |
| 87 HashSet<const Player*> m_cancelledAnimationPlayers; | 87 HashSet<const Player*> m_cancelledAnimationPlayers; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 class CSSAnimations FINAL { | 90 class CSSAnimations FINAL { |
| 91 public: | 91 public: |
| 92 static bool isAnimatableProperty(CSSPropertyID); |
| 92 static bool needsUpdate(const Element*, const RenderStyle*); | 93 static bool needsUpdate(const Element*, const RenderStyle*); |
| 93 static PassOwnPtr<CSSAnimationUpdate> calculateUpdate(const Element*, const
RenderStyle*, const CSSAnimations*, const CSSAnimationDataList*, StyleResolver*)
; | 94 static PassOwnPtr<CSSAnimationUpdate> calculateUpdate(const Element*, const
RenderStyle*, const CSSAnimations*, const CSSAnimationDataList*, StyleResolver*)
; |
| 94 void setPendingUpdate(PassOwnPtr<CSSAnimationUpdate> update) { m_pendingUpda
te = update; } | 95 void setPendingUpdate(PassOwnPtr<CSSAnimationUpdate> update) { m_pendingUpda
te = update; } |
| 95 void maybeApplyPendingUpdate(Element*); | 96 void maybeApplyPendingUpdate(Element*); |
| 96 bool isEmpty() const { return m_animations.isEmpty() && !m_pendingUpdate; } | 97 bool isEmpty() const { return m_animations.isEmpty() && !m_pendingUpdate; } |
| 97 void cancel(); | 98 void cancel(); |
| 98 private: | 99 private: |
| 99 typedef HashMap<AtomicString, RefPtr<Player> > AnimationMap; | 100 typedef HashMap<AtomicString, RefPtr<Player> > AnimationMap; |
| 100 AnimationMap m_animations; | 101 AnimationMap m_animations; |
| 101 OwnPtr<CSSAnimationUpdate> m_pendingUpdate; | 102 OwnPtr<CSSAnimationUpdate> m_pendingUpdate; |
| 102 class EventDelegate FINAL : public TimedItem::EventDelegate { | 103 class EventDelegate FINAL : public TimedItem::EventDelegate { |
| 103 public: | 104 public: |
| 104 EventDelegate(Element* target, const AtomicString& name) | 105 EventDelegate(Element* target, const AtomicString& name) |
| 105 : m_target(target) | 106 : m_target(target) |
| 106 , m_name(name) | 107 , m_name(name) |
| 107 { | 108 { |
| 108 } | 109 } |
| 109 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Time
dItem::Phase previousPhase, double previousIteration) OVERRIDE; | 110 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Time
dItem::Phase previousPhase, double previousIteration) OVERRIDE; |
| 110 private: | 111 private: |
| 111 void maybeDispatch(Document::ListenerType, AtomicString& eventName, doub
le elapsedTime); | 112 void maybeDispatch(Document::ListenerType, AtomicString& eventName, doub
le elapsedTime); |
| 112 Element* m_target; | 113 Element* m_target; |
| 113 const AtomicString m_name; | 114 const AtomicString m_name; |
| 114 }; | 115 }; |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 } // namespace WebCore | 118 } // namespace WebCore |
| 118 | 119 |
| 119 #endif | 120 #endif |
| OLD | NEW |