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

Unified Diff: Source/core/animation/Animation.cpp

Issue 1158783011: Web Animations: Don't fire finish event when cancelling (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/web-animations-api/player-cancel-finishes-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/Animation.cpp
diff --git a/Source/core/animation/Animation.cpp b/Source/core/animation/Animation.cpp
index 5103120d88fef661182dd039d0726bcd241fb484..75f3477d9380b7cb2b45455926a78c683ea351fc 100644
--- a/Source/core/animation/Animation.cpp
+++ b/Source/core/animation/Animation.cpp
@@ -792,13 +792,17 @@ bool Animation::update(TimingUpdateReason reason)
if ((idle || limited()) && !m_finished) {
if (reason == TimingUpdateForAnimationFrame && (idle || hasStartTime())) {
- const AtomicString& eventType = EventTypeNames::finish;
- if (executionContext() && hasEventListeners(eventType)) {
- double eventCurrentTime = currentTimeInternal() * 1000;
- m_pendingFinishedEvent = AnimationPlayerEvent::create(eventType, eventCurrentTime, timeline()->currentTime());
- m_pendingFinishedEvent->setTarget(this);
- m_pendingFinishedEvent->setCurrentTarget(this);
- m_timeline->document()->enqueueAnimationFrameEvent(m_pendingFinishedEvent);
+ if (idle) {
+ // TODO(dstockwell): Fire the cancel event.
+ } else {
+ const AtomicString& eventType = EventTypeNames::finish;
+ if (executionContext() && hasEventListeners(eventType)) {
+ double eventCurrentTime = currentTimeInternal() * 1000;
+ m_pendingFinishedEvent = AnimationPlayerEvent::create(eventType, eventCurrentTime, timeline()->currentTime());
+ m_pendingFinishedEvent->setTarget(this);
+ m_pendingFinishedEvent->setCurrentTarget(this);
+ m_timeline->document()->enqueueAnimationFrameEvent(m_pendingFinishedEvent);
+ }
}
m_finished = true;
}
« no previous file with comments | « LayoutTests/web-animations-api/player-cancel-finishes-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698