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

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

Issue 30813004: Revert r160071 "Web Animations: Implement AnimationClock and fix start time of animations" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // DocumentTimeline is constructed and owned by Document, and tied to its lifecy cle. 47 // DocumentTimeline is constructed and owned by Document, and tied to its lifecy cle.
48 class DocumentTimeline : public RefCounted<DocumentTimeline> { 48 class DocumentTimeline : public RefCounted<DocumentTimeline> {
49 49
50 public: 50 public:
51 static PassRefPtr<DocumentTimeline> create(Document*); 51 static PassRefPtr<DocumentTimeline> create(Document*);
52 void serviceAnimations(double); 52 void serviceAnimations(double);
53 PassRefPtr<Player> play(TimedItem*); 53 PassRefPtr<Player> play(TimedItem*);
54 // Called from setReadyState() in Document.cpp to set m_zeroTimeAsPerfTime t o 54 // Called from setReadyState() in Document.cpp to set m_zeroTimeAsPerfTime t o
55 // performance.timing.domInteractive. 55 // performance.timing.domInteractive.
56 void setZeroTimeAsPerfTime(double); 56 void setZeroTimeAsPerfTime(double);
57 double currentTime(); 57 double currentTime() { return m_currentTime; }
58 void pauseAnimationsForTesting(double); 58 void pauseAnimationsForTesting(double);
59 size_t numberOfActiveAnimationsForTesting() const; 59 size_t numberOfActiveAnimationsForTesting() const;
60 AnimationStack* animationStack(const Element* element) const 60 AnimationStack* animationStack(const Element* element) const
61 { 61 {
62 if (ActiveAnimations* animations = element->activeAnimations()) 62 if (ActiveAnimations* animations = element->activeAnimations())
63 return animations->defaultStack(); 63 return animations->defaultStack();
64 return 0; 64 return 0;
65 } 65 }
66 void addEventToDispatch(EventTarget* target, PassRefPtr<Event> event) 66 void addEventToDispatch(EventTarget* target, PassRefPtr<Event> event)
67 { 67 {
68 m_events.append(EventToDispatch(target, event)); 68 m_events.append(EventToDispatch(target, event));
69 } 69 }
70 70
71 private: 71 private:
72 DocumentTimeline(Document*); 72 DocumentTimeline(Document*);
73 void dispatchEvents(); 73 void dispatchEvents();
74 double m_currentTime;
74 double m_zeroTimeAsPerfTime; 75 double m_zeroTimeAsPerfTime;
75 Document* m_document; 76 Document* m_document;
76 Vector<RefPtr<Player> > m_players; 77 Vector<RefPtr<Player> > m_players;
77 78
78 struct EventToDispatch { 79 struct EventToDispatch {
79 EventToDispatch(EventTarget* target, PassRefPtr<Event> event) 80 EventToDispatch(EventTarget* target, PassRefPtr<Event> event)
80 : target(target) 81 : target(target)
81 , event(event) 82 , event(event)
82 { 83 {
83 } 84 }
84 RefPtr<EventTarget> target; 85 RefPtr<EventTarget> target;
85 RefPtr<Event> event; 86 RefPtr<Event> event;
86 }; 87 };
87 Vector<EventToDispatch> m_events; 88 Vector<EventToDispatch> m_events;
88 }; 89 };
89 90
90 } // namespace 91 } // namespace
91 92
92 #endif 93 #endif
OLDNEW
« no previous file with comments | « Source/core/animation/AnimationClockTest.cpp ('k') | Source/core/animation/DocumentTimeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698