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

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

Issue 1422713012: Devtools Animations: Listen to all animation play state changes (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
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorInstrumentation.idl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 252ea1fe99dd885921ab1dc9267cb6e870eed5e0..0fe690cc491bb2fdd854e42bb1af9b2c31d517b6 100644
--- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
@@ -42,6 +42,9 @@ WebInspector.AnimationModel.prototype = {
this._pendingAnimations.push(id);
},
+ /**
+ * @param {string} id
+ */
_animationCanceled: function(id)
{
this._pendingAnimations.remove(id);
@@ -54,11 +57,16 @@ WebInspector.AnimationModel.prototype = {
animationStarted: function(payload)
{
var animation = WebInspector.AnimationModel.Animation.parsePayload(this.target(), payload);
+
// Ignore Web Animations custom effects & groups.
- if (animation.type() === "WebAnimation" && animation.source().keyframesRule().keyframes().length === 0)
+ if (animation.type() === "WebAnimation" && animation.source().keyframesRule().keyframes().length === 0) {
this._pendingAnimations.remove(animation.id());
- else
+ } else {
this._animationsById.set(animation.id(), animation);
+ if (this._pendingAnimations.indexOf(animation.id()) === -1)
+ this._pendingAnimations.push(animation.id());
+ }
+
this._flushPendingAnimationsIfNeeded();
},
@@ -429,6 +437,9 @@ WebInspector.AnimationModel.AnimationEffect.prototype = {
*/
iterations: function()
{
+ // Animations with zero duration, zero delays and infinite iterations can't be shown.
+ if (!this.delay() && !this.endDelay() && !this.duration())
+ return 0;
return this._payload.iterations || Infinity;
},
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorInstrumentation.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698