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

Side by Side Diff: third_party/WebKit/Source/core/animation/AnimationEffect.h

Issue 1944603003: Make AnimationEffectReadOnly.getComputedTiming() consistent with Web Animations spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 virtual ~AnimationEffect() { } 83 virtual ~AnimationEffect() { }
84 84
85 virtual bool isKeyframeEffect() const { return false; } 85 virtual bool isKeyframeEffect() const { return false; }
86 86
87 Phase getPhase() const { return ensureCalculated().phase; } 87 Phase getPhase() const { return ensureCalculated().phase; }
88 bool isCurrent() const { return ensureCalculated().isCurrent; } 88 bool isCurrent() const { return ensureCalculated().isCurrent; }
89 bool isInEffect() const { return ensureCalculated().isInEffect; } 89 bool isInEffect() const { return ensureCalculated().isInEffect; }
90 bool isInPlay() const { return ensureCalculated().isInPlay; } 90 bool isInPlay() const { return ensureCalculated().isInPlay; }
91 double currentIteration() const { return ensureCalculated().currentIteration ; } 91 double currentIteration() const { return ensureCalculated().currentIteration ; }
92 double timeFraction() const { return ensureCalculated().timeFraction; } 92 double progress() const { return ensureCalculated().progress; }
93 double timeToForwardsEffectChange() const { return ensureCalculated().timeTo ForwardsEffectChange; } 93 double timeToForwardsEffectChange() const { return ensureCalculated().timeTo ForwardsEffectChange; }
94 double timeToReverseEffectChange() const { return ensureCalculated().timeToR everseEffectChange; } 94 double timeToReverseEffectChange() const { return ensureCalculated().timeToR everseEffectChange; }
95 95
96 double iterationDuration() const; 96 double iterationDuration() const;
97 double activeDurationInternal() const; 97 double activeDurationInternal() const;
98 double endTimeInternal() const { return specifiedTiming().startDelay + activ eDurationInternal() + specifiedTiming().endDelay; } 98 double endTimeInternal() const { return specifiedTiming().startDelay + activ eDurationInternal() + specifiedTiming().endDelay; }
99 99
100 const Animation* animation() const { return m_animation; } 100 const Animation* animation() const { return m_animation; }
101 Animation* animation() { return m_animation; } 101 Animation* animation() { return m_animation; }
102 const Timing& specifiedTiming() const { return m_timing; } 102 const Timing& specifiedTiming() const { return m_timing; }
103 AnimationEffectTiming* timing(); 103 AnimationEffectTiming* timing();
104 void updateSpecifiedTiming(const Timing&); 104 void updateSpecifiedTiming(const Timing&);
105 105
106 void computedTiming(ComputedTimingProperties&); 106 void getComputedTiming(ComputedTimingProperties&);
107 ComputedTimingProperties computedTiming(); 107 ComputedTimingProperties getComputedTiming();
108 108
109 DECLARE_VIRTUAL_TRACE(); 109 DECLARE_VIRTUAL_TRACE();
110 110
111 protected: 111 protected:
112 explicit AnimationEffect(const Timing&, EventDelegate* = nullptr); 112 explicit AnimationEffect(const Timing&, EventDelegate* = nullptr);
113 113
114 // When AnimationEffect receives a new inherited time via updateInheritedTim e 114 // When AnimationEffect receives a new inherited time via updateInheritedTim e
115 // it will (if necessary) recalculate timings and (if necessary) call 115 // it will (if necessary) recalculate timings and (if necessary) call
116 // updateChildrenAndEffects. 116 // updateChildrenAndEffects.
117 void updateInheritedTime(double inheritedTime, TimingUpdateReason) const; 117 void updateInheritedTime(double inheritedTime, TimingUpdateReason) const;
(...skipping 20 matching lines...) Expand all
138 virtual void specifiedTimingChanged() { } 138 virtual void specifiedTimingChanged() { }
139 139
140 Member<Animation> m_animation; 140 Member<Animation> m_animation;
141 Timing m_timing; 141 Timing m_timing;
142 Member<EventDelegate> m_eventDelegate; 142 Member<EventDelegate> m_eventDelegate;
143 143
144 mutable struct CalculatedTiming { 144 mutable struct CalculatedTiming {
145 DISALLOW_NEW(); 145 DISALLOW_NEW();
146 Phase phase; 146 Phase phase;
147 double currentIteration; 147 double currentIteration;
148 double timeFraction; 148 double progress;
149 bool isCurrent; 149 bool isCurrent;
150 bool isInEffect; 150 bool isInEffect;
151 bool isInPlay; 151 bool isInPlay;
152 double localTime; 152 double localTime;
153 double timeToForwardsEffectChange; 153 double timeToForwardsEffectChange;
154 double timeToReverseEffectChange; 154 double timeToReverseEffectChange;
155 } m_calculated; 155 } m_calculated;
156 mutable bool m_needsUpdate; 156 mutable bool m_needsUpdate;
157 mutable double m_lastUpdateTime; 157 mutable double m_lastUpdateTime;
158 String m_name; 158 String m_name;
159 159
160 const CalculatedTiming& ensureCalculated() const; 160 const CalculatedTiming& ensureCalculated() const;
161 }; 161 };
162 162
163 } // namespace blink 163 } // namespace blink
164 164
165 #endif // AnimationEffect_h 165 #endif // AnimationEffect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698