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

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

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: Created 4 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 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 WebInspector.AnimationTimeline.GlobalPlaybackRates = [1, 0.25, 0.1]; 42 WebInspector.AnimationTimeline.GlobalPlaybackRates = [1, 0.25, 0.1];
43 43
44 /** @enum {string} */ 44 /** @enum {string} */
45 WebInspector.AnimationTimeline._ControlState = { 45 WebInspector.AnimationTimeline._ControlState = {
46 Play: "play-outline", 46 Play: "play-outline",
47 Replay: "replay-outline", 47 Replay: "replay-outline",
48 Pause: "pause-outline" 48 Pause: "pause-outline"
49 }; 49 };
50 50
51 WebInspector.AnimationTimeline.prototype = { 51 WebInspector.AnimationTimeline.prototype = {
52 /**
53 * @override
54 */
52 wasShown: function() 55 wasShown: function()
53 { 56 {
54 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Capability.DOM)) 57 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Capability.DOM))
55 this._addEventListeners(target); 58 this._addEventListeners(target);
56 }, 59 },
57 60
61 /**
62 * @override
63 */
58 willHide: function() 64 willHide: function()
59 { 65 {
60 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Capability.DOM)) 66 for (var target of WebInspector.targetManager.targets(WebInspector.Targe t.Capability.DOM))
61 this._removeEventListeners(target); 67 this._removeEventListeners(target);
62 this._popoverHelper.hidePopover(); 68 this._popoverHelper.hidePopover();
63 }, 69 },
64 70
65 /** 71 /**
66 * @override 72 * @override
67 * @param {!WebInspector.Target} target 73 * @param {!WebInspector.Target} target
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 _render: function(timestamp) 545 _render: function(timestamp)
540 { 546 {
541 while (this._renderQueue.length && (!timestamp || window.performance.now () - timestamp < 50)) 547 while (this._renderQueue.length && (!timestamp || window.performance.now () - timestamp < 50))
542 this._renderQueue.shift().redraw(); 548 this._renderQueue.shift().redraw();
543 if (this._renderQueue.length) 549 if (this._renderQueue.length)
544 this._animationsContainer.window().requestAnimationFrame(this._rende r.bind(this)); 550 this._animationsContainer.window().requestAnimationFrame(this._rende r.bind(this));
545 else 551 else
546 delete this._redrawing; 552 delete this._redrawing;
547 }, 553 },
548 554
555 /**
556 * @override
557 */
549 onResize: function() 558 onResize: function()
550 { 559 {
551 this._cachedTimelineWidth = Math.max(0, this._animationsContainer.offset Width - this._timelineControlsWidth) || 0; 560 this._cachedTimelineWidth = Math.max(0, this._animationsContainer.offset Width - this._timelineControlsWidth) || 0;
552 this._cachedTimelineHeight = this._animationsContainer.offsetHeight; 561 this._cachedTimelineHeight = this._animationsContainer.offsetHeight;
553 this.scheduleRedraw(); 562 this.scheduleRedraw();
554 if (this._scrubberPlayer) 563 if (this._scrubberPlayer)
555 this._syncScrubber(); 564 this._syncScrubber();
556 delete this._gridOffsetLeft; 565 delete this._gridOffsetLeft;
557 }, 566 },
558 567
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 */ 773 */
765 WebInspector.AnimationTimeline.StepTimingFunction.parse = function(text) { 774 WebInspector.AnimationTimeline.StepTimingFunction.parse = function(text) {
766 var match = text.match(/^steps\((\d+), (start|middle)\)$/); 775 var match = text.match(/^steps\((\d+), (start|middle)\)$/);
767 if (match) 776 if (match)
768 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), match[2]); 777 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), match[2]);
769 match = text.match(/^steps\((\d+)\)$/); 778 match = text.match(/^steps\((\d+)\)$/);
770 if (match) 779 if (match)
771 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), "end"); 780 return new WebInspector.AnimationTimeline.StepTimingFunction(parseInt(ma tch[1], 10), "end");
772 return null; 781 return null;
773 }; 782 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698