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

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: Rebase 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 a68f457f9f60b668effc8a7fa04a69d6766aae51..252ea1fe99dd885921ab1dc9267cb6e870eed5e0 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);
},
+ _animationCanceled: function(id)
+ {
+ this._pendingAnimations.remove(id);
+ this._flushPendingAnimationsIfNeeded();
+ },
+
/**
* @param {!AnimationAgent.Animation} payload
*/
@@ -54,7 +59,11 @@ WebInspector.AnimationModel.prototype = {
this._pendingAnimations.remove(animation.id());
else
this._animationsById.set(animation.id(), animation);
+ this._flushPendingAnimationsIfNeeded();
+ },
+ _flushPendingAnimationsIfNeeded: function()
+ {
for (var id of this._pendingAnimations) {
if (!this._animationsById.get(id))
return;
@@ -756,6 +765,15 @@ WebInspector.AnimationDispatcher.prototype = {
/**
* @override
+ * @param {string} id
+ */
+ animationCanceled: function(id)
+ {
+ this._animationModel._animationCanceled(id);
+ },
+
+ /**
+ * @override
* @param {!AnimationAgent.Animation} payload
*/
animationStarted: function(payload)

Powered by Google App Engine
This is Rietveld 408576698