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

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

Issue 2199103002: DevTools: fix animations panel after image loading became async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.AnimationTimeline = function() 10 WebInspector.AnimationTimeline = function()
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 * @param {!WebInspector.Popover} popover 184 * @param {!WebInspector.Popover} popover
185 */ 185 */
186 _showPopover: function(anchor, popover) 186 _showPopover: function(anchor, popover)
187 { 187 {
188 var animGroup; 188 var animGroup;
189 for (var group of this._previewMap.keysArray()) { 189 for (var group of this._previewMap.keysArray()) {
190 if (this._previewMap.get(group).element === anchor.parentElement) 190 if (this._previewMap.get(group).element === anchor.parentElement)
191 animGroup = group; 191 animGroup = group;
192 } 192 }
193 console.assert(animGroup); 193 console.assert(animGroup);
194 var screenshots = animGroup.screenshots(); 194 var screenshots = animGroup.screenshots(onImageLoad);
195 if (!screenshots.length) 195 if (!screenshots.length)
196 return; 196 return;
197 var content = new WebInspector.AnimationScreenshotPopover(screenshots); 197 if (screenshots[0].complete)
lushnikov 2016/08/01 23:16:11 why do we care only about the 0's screenshot?
luoe 2016/08/02 00:24:10 We shouldn't :) Changed to keep a counter for rema
198 popover.setNoMargins(true); 198 onImageLoad();
199 popover.showView(content, anchor); 199
200 var loaded = false;
201 function onImageLoad()
202 {
203 if (loaded)
204 return;
205 loaded = true;
206
207 var content = new WebInspector.AnimationScreenshotPopover(screenshot s);
208 popover.setNoMargins(true);
209 popover.showView(content, anchor);
210 }
200 }, 211 },
201 212
202 _onHidePopover: function() 213 _onHidePopover: function()
203 { 214 {
204 }, 215 },
205 216
206 _togglePauseAll: function() 217 _togglePauseAll: function()
207 { 218 {
208 this._allPaused = !this._allPaused; 219 this._allPaused = !this._allPaused;
209 this._pauseButton.setToggled(this._allPaused); 220 this._pauseButton.setToggled(this._allPaused);
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 */ 762 */
752 WebInspector.AnimationTimeline.StepTimingFunction.parse = function(text) { 763 WebInspector.AnimationTimeline.StepTimingFunction.parse = function(text) {
753 var match = text.match(/^step-(start|middle|end)$/); 764 var match = text.match(/^step-(start|middle|end)$/);
754 if (match) 765 if (match)
755 return new WebInspector.AnimationTimeline.StepTimingFunction(1, match[1] ); 766 return new WebInspector.AnimationTimeline.StepTimingFunction(1, match[1] );
756 match = text.match(/^steps\((\d+), (start|middle|end)\)$/); 767 match = text.match(/^steps\((\d+), (start|middle|end)\)$/);
757 if (match) 768 if (match)
758 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), match[2]); 769 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), match[2]);
759 return null; 770 return null;
760 } 771 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698