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

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

Issue 1843603004: Devtools Animations: Correctly sync scrubber when first animation ended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 /** 6 /**
7 * @constructor 7 * @constructor
8 * @extends {WebInspector.SDKModel} 8 * @extends {WebInspector.SDKModel}
9 * @param {!WebInspector.Target} target 9 * @param {!WebInspector.Target} target
10 */ 10 */
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 /** 764 /**
765 * @param {?Protocol.Error} error 765 * @param {?Protocol.Error} error
766 * @param {number} currentTime 766 * @param {number} currentTime
767 * @return {number} 767 * @return {number}
768 */ 768 */
769 function callback(error, currentTime) 769 function callback(error, currentTime)
770 { 770 {
771 return !error ? currentTime : 0; 771 return !error ? currentTime : 0;
772 } 772 }
773 773
774 return this.target().animationAgent().getCurrentTime(this._animations[0] .id(), callback).catchException(0); 774 var longestAnim = null;
775 for (var anim of this._animations) {
776 if (!longestAnim || anim.endTime() > longestAnim.endTime())
777 longestAnim = anim;
778 }
779 return this.target().animationAgent().getCurrentTime(longestAnim.id(), c allback).catchException(0);
775 }, 780 },
776 781
777 /** 782 /**
778 * @param {!WebInspector.AnimationModel.AnimationGroup} group 783 * @param {!WebInspector.AnimationModel.AnimationGroup} group
779 * @return {boolean} 784 * @return {boolean}
780 */ 785 */
781 _matches: function(group) 786 _matches: function(group)
782 { 787 {
783 /** 788 /**
784 * @param {!WebInspector.AnimationModel.Animation} anim 789 * @param {!WebInspector.AnimationModel.Animation} anim
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 if (!this._capturing) 943 if (!this._capturing)
939 return; 944 return;
940 945
941 delete this._stopTimer; 946 delete this._stopTimer;
942 delete this._endTime; 947 delete this._endTime;
943 this._requests = []; 948 this._requests = [];
944 this._capturing = false; 949 this._capturing = false;
945 this._target.pageAgent().stopScreencast(); 950 this._target.pageAgent().stopScreencast();
946 } 951 }
947 } 952 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698