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

Unified Diff: third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js

Issue 1433623002: Devtools Animations: Don't wait for empty transitions to start (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
index 882e2b1ab73c5186d121b2fa85f1412429942803..aa5ec0b52f951cf83ed090d02ac1b35cffe33504 100644
--- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
@@ -23,8 +23,7 @@ WebInspector.AnimationModel = function(target)
}
WebInspector.AnimationModel.Events = {
- AnimationGroupStarted: "AnimationGroupStarted",
- AnimationCanceled: "AnimationCanceled"
+ AnimationGroupStarted: "AnimationGroupStarted"
}
WebInspector.AnimationModel.prototype = {
@@ -43,6 +42,12 @@ WebInspector.AnimationModel.prototype = {
this._pendingAnimations.push(id);
},
+ _animationCancelled: function(id)
+ {
+ this._pendingAnimations.remove(id);
+ this._flushPendingAnimationsIfNeeded();
+ },
+
/**
* @param {!AnimationAgent.Animation} payload
*/
@@ -50,7 +55,11 @@ WebInspector.AnimationModel.prototype = {
{
var animation = WebInspector.AnimationModel.Animation.parsePayload(this.target(), payload);
this._animationsById.set(animation.id(), animation);
+ this._flushPendingAnimationsIfNeeded();
+ },
+ _flushPendingAnimationsIfNeeded: function()
+ {
for (var id of this._pendingAnimations) {
if (!this._animationsById.get(id))
return;
@@ -752,6 +761,15 @@ WebInspector.AnimationDispatcher.prototype = {
/**
* @override
+ * @param {string} id
+ */
+ animationCancelled: function(id)
+ {
+ this._animationModel._animationCancelled(id);
+ },
+
+ /**
+ * @override
* @param {!AnimationAgent.Animation} payload
*/
animationStarted: function(payload)

Powered by Google App Engine
This is Rietveld 408576698