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

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: put into one file 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
« 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) 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
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();
195 if (!screenshots.length) 195 if (!screenshots.length)
196 return; 196 return;
197 var content = new WebInspector.AnimationScreenshotPopover(screenshots); 197
198 popover.setNoMargins(true); 198 if (!screenshots[0].complete)
199 popover.showView(content, anchor); 199 screenshots[0].onload = onFirstScreenshotLoaded.bind(null, screensho ts);
200 else
201 onFirstScreenshotLoaded(screenshots);
202
203 /**
204 * @param {!Array.<!Image>} screenshots
205 */
206 function onFirstScreenshotLoaded(screenshots)
207 {
208 var content = new WebInspector.AnimationScreenshotPopover(screenshot s);
209 popover.setNoMargins(true);
210 popover.showView(content, anchor);
211 }
200 }, 212 },
201 213
202 _onHidePopover: function() 214 _onHidePopover: function()
203 { 215 {
204 }, 216 },
205 217
206 _togglePauseAll: function() 218 _togglePauseAll: function()
207 { 219 {
208 this._allPaused = !this._allPaused; 220 this._allPaused = !this._allPaused;
209 this._pauseButton.setToggled(this._allPaused); 221 this._pauseButton.setToggled(this._allPaused);
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 */ 763 */
752 WebInspector.AnimationTimeline.StepTimingFunction.parse = function(text) { 764 WebInspector.AnimationTimeline.StepTimingFunction.parse = function(text) {
753 var match = text.match(/^step-(start|middle|end)$/); 765 var match = text.match(/^step-(start|middle|end)$/);
754 if (match) 766 if (match)
755 return new WebInspector.AnimationTimeline.StepTimingFunction(1, match[1] ); 767 return new WebInspector.AnimationTimeline.StepTimingFunction(1, match[1] );
756 match = text.match(/^steps\((\d+), (start|middle|end)\)$/); 768 match = text.match(/^steps\((\d+), (start|middle|end)\)$/);
757 if (match) 769 if (match)
758 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), match[2]); 770 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), match[2]);
759 return null; 771 return null;
760 } 772 }
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