Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: Source/core/animation/DocumentTimeline.h

Issue 19266007: Web Animations: Introduce ActiveAnimations and AnimationStack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed maps. Store ActiveAnimations in ElementRareData. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/animation/AnimationStack.h ('k') | Source/core/animation/Player.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
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 DocumentTimeline_h 31 #ifndef DocumentTimeline_h
32 #define DocumentTimeline_h 32 #define DocumentTimeline_h
33 33
34 #include "core/animation/ActiveAnimations.h"
34 #include "core/animation/Player.h" 35 #include "core/animation/Player.h"
36 #include "core/dom/Element.h"
35 #include "wtf/RefCounted.h" 37 #include "wtf/RefCounted.h"
36 #include "wtf/RefPtr.h" 38 #include "wtf/RefPtr.h"
37 #include "wtf/Vector.h" 39 #include "wtf/Vector.h"
38 40
39 namespace WebCore { 41 namespace WebCore {
40 42
41 class Document; 43 class Document;
42 class TimedItem; 44 class TimedItem;
43 45
44 // DocumentTimeline is constructed and owned by Document, and tied to its lifecy cle. 46 // DocumentTimeline is constructed and owned by Document, and tied to its lifecy cle.
45 class DocumentTimeline : public RefCounted<DocumentTimeline> { 47 class DocumentTimeline : public RefCounted<DocumentTimeline> {
46 48
47 public: 49 public:
48 static PassRefPtr<DocumentTimeline> create(Document*); 50 static PassRefPtr<DocumentTimeline> create(Document*);
49 void serviceAnimations(double); 51 void serviceAnimations(double);
50 PassRefPtr<Player> play(TimedItem*); 52 PassRefPtr<Player> play(TimedItem*);
51 double currentTime() { return m_currentTime; } 53 double currentTime() { return m_currentTime; }
52 void pauseAnimationsForTesting(double); 54 void pauseAnimationsForTesting(double);
55 AnimationStack* animationStack(const Element* element) const
56 {
57 if (!element->activeAnimations())
58 return 0;
59 return element->activeAnimations()->defaultStack();
esprehn 2013/07/23 01:20:38 if (ActiveAnimations* animations = element->active
dstockwell 2013/07/23 01:33:00 Done.
60 }
61 AnimationStack* ensureAnimationStack(Element* element) { return element->ens ureActiveAnimations()->defaultStack(); }
esprehn 2013/07/23 01:20:38 Remove this method, just call this directly or put
dstockwell 2013/07/23 01:33:00 Removed. The plan was for this to become virtual
53 62
54 private: 63 private:
55 DocumentTimeline(Document*); 64 DocumentTimeline(Document*);
56 double m_currentTime; 65 double m_currentTime;
57 Document* m_document; 66 Document* m_document;
58 Vector<RefPtr<Player> > m_players; 67 Vector<RefPtr<Player> > m_players;
59 }; 68 };
60 69
61 } // namespace 70 } // namespace
62 71
63 #endif 72 #endif
OLDNEW
« no previous file with comments | « Source/core/animation/AnimationStack.h ('k') | Source/core/animation/Player.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698