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

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

Issue 1716673002: Web Animations: Throw exceptions for play/pause/reverse/finish with infinite end time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 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 Animation_h 31 #ifndef Animation_h
32 #define Animation_h 32 #define Animation_h
33 33
34 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
34 #include "bindings/core/v8/ScriptPromise.h" 35 #include "bindings/core/v8/ScriptPromise.h"
35 #include "bindings/core/v8/ScriptPromiseProperty.h" 36 #include "bindings/core/v8/ScriptPromiseProperty.h"
36 #include "core/CSSPropertyNames.h" 37 #include "core/CSSPropertyNames.h"
37 #include "core/CoreExport.h" 38 #include "core/CoreExport.h"
38 #include "core/animation/AnimationEffect.h" 39 #include "core/animation/AnimationEffect.h"
39 #include "core/dom/ActiveDOMObject.h" 40 #include "core/dom/ActiveDOMObject.h"
40 #include "core/dom/DOMException.h" 41 #include "core/dom/DOMException.h"
41 #include "core/events/EventTarget.h" 42 #include "core/events/EventTarget.h"
42 #include "platform/animation/CompositorAnimationPlayerClient.h" 43 #include "platform/animation/CompositorAnimationPlayerClient.h"
43 #include "platform/heap/Handle.h" 44 #include "platform/heap/Handle.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 91
91 double currentTimeInternal() const; 92 double currentTimeInternal() const;
92 double unlimitedCurrentTimeInternal() const; 93 double unlimitedCurrentTimeInternal() const;
93 94
94 void setCurrentTimeInternal(double newCurrentTime, TimingUpdateReason = Timi ngUpdateOnDemand); 95 void setCurrentTimeInternal(double newCurrentTime, TimingUpdateReason = Timi ngUpdateOnDemand);
95 bool paused() const { return m_paused && !m_isPausedForTesting; } 96 bool paused() const { return m_paused && !m_isPausedForTesting; }
96 static const char* playStateString(AnimationPlayState); 97 static const char* playStateString(AnimationPlayState);
97 String playState() const { return playStateString(playStateInternal()); } 98 String playState() const { return playStateString(playStateInternal()); }
98 AnimationPlayState playStateInternal() const; 99 AnimationPlayState playStateInternal() const;
99 100
100 void pause(); 101 void pause(ExceptionState& = ASSERT_NO_EXCEPTION);
101 void play(); 102 void play(ExceptionState& = ASSERT_NO_EXCEPTION);
102 void reverse(); 103 void reverse(ExceptionState& = ASSERT_NO_EXCEPTION);
103 void finish(ExceptionState&); 104 void finish(ExceptionState& = ASSERT_NO_EXCEPTION);
104 105
105 ScriptPromise finished(ScriptState*); 106 ScriptPromise finished(ScriptState*);
106 ScriptPromise ready(ScriptState*); 107 ScriptPromise ready(ScriptState*);
107 108
108 bool playing() const { return !(playStateInternal() == Idle || limited() || m_paused || m_isPausedForTesting); } 109 bool playing() const { return !(playStateInternal() == Idle || limited() || m_paused || m_isPausedForTesting); }
109 bool limited() const { return limited(currentTimeInternal()); } 110 bool limited() const { return limited(currentTimeInternal()); }
110 bool finishedInternal() const { return m_finished; } 111 bool finishedInternal() const { return m_finished; }
111 112
112 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish); 113 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish);
113 DEFINE_ATTRIBUTE_EVENT_LISTENER(cancel); 114 DEFINE_ATTRIBUTE_EVENT_LISTENER(cancel);
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 296
296 OwnPtr<CompositorAnimationPlayer> m_compositorPlayer; 297 OwnPtr<CompositorAnimationPlayer> m_compositorPlayer;
297 298
298 bool m_currentTimePending; 299 bool m_currentTimePending;
299 bool m_stateIsBeingUpdated; 300 bool m_stateIsBeingUpdated;
300 }; 301 };
301 302
302 } // namespace blink 303 } // namespace blink
303 304
304 #endif // Animation_h 305 #endif // Animation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698