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

Side by Side Diff: Source/core/animation/AnimationPlayer.cpp

Issue 210363007: Declare onFinish event handler for AnimationPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Stop using ContextLifecycleObserver Created 6 years, 8 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
« no previous file with comments | « Source/core/animation/AnimationPlayer.h ('k') | Source/core/animation/AnimationPlayer.idl » ('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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } else { 231 } else {
232 if (sourceEnd() == std::numeric_limits<double>::infinity()) { 232 if (sourceEnd() == std::numeric_limits<double>::infinity()) {
233 exceptionState.throwDOMException(InvalidStateError, "AnimationPlayer has source content whose end time is infinity."); 233 exceptionState.throwDOMException(InvalidStateError, "AnimationPlayer has source content whose end time is infinity.");
234 return; 234 return;
235 } 235 }
236 setCurrentTime(sourceEnd()); 236 setCurrentTime(sourceEnd());
237 } 237 }
238 ASSERT(finished()); 238 ASSERT(finished());
239 } 239 }
240 240
241 const AtomicString& AnimationPlayer::interfaceName() const
242 {
243 return EventTargetNames::AnimationPlayer;
244 }
245
246 ExecutionContext* AnimationPlayer::executionContext() const
247 {
248 if (m_timeline) {
249 if (Document* document = m_timeline->document())
250 return document->contextDocument().get();
251 }
252 return 0;
253 }
254
241 void AnimationPlayer::setPlaybackRate(double playbackRate) 255 void AnimationPlayer::setPlaybackRate(double playbackRate)
242 { 256 {
243 if (!std::isfinite(playbackRate)) 257 if (!std::isfinite(playbackRate))
244 return; 258 return;
245 double storedCurrentTime = currentTime(); 259 double storedCurrentTime = currentTime();
246 m_playbackRate = playbackRate; 260 m_playbackRate = playbackRate;
247 updateTimingState(storedCurrentTime); 261 updateTimingState(storedCurrentTime);
248 } 262 }
249 263
250 void AnimationPlayer::setOutdated() 264 void AnimationPlayer::setOutdated()
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 { 340 {
327 RELEASE_ASSERT(!paused()); 341 RELEASE_ASSERT(!paused());
328 updateTimingState(pauseTime); 342 updateTimingState(pauseTime);
329 if (!m_isPausedForTesting && hasActiveAnimationsOnCompositor()) 343 if (!m_isPausedForTesting && hasActiveAnimationsOnCompositor())
330 toAnimation(m_content.get())->pauseAnimationForTestingOnCompositor(curre ntTime()); 344 toAnimation(m_content.get())->pauseAnimationForTestingOnCompositor(curre ntTime());
331 m_isPausedForTesting = true; 345 m_isPausedForTesting = true;
332 pause(); 346 pause();
333 } 347 }
334 348
335 } // namespace 349 } // namespace
OLDNEW
« no previous file with comments | « Source/core/animation/AnimationPlayer.h ('k') | Source/core/animation/AnimationPlayer.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698