Demo/bin/Debug/front_end/animation/AnimationTimeline.js
(开头部分) 40KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
// Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @constructor
* @extends {WebInspector.VBox}
* @implements {WebInspector.TargetManager.Observer}
*/
WebInspector.AnimationTimeline = function()
{
WebInspector.VBox.call(this, true);
this.registerRequiredCSS("animation/animationTimeline.css");
this.element.classList.add("animations-timeline");
this._grid = this.contentElement.createSVGChild("svg", "animation-timeline-grid");
this.contentElement.appendChild(this._createScrubber());
WebInspector.installDragHandle(this._timelineScrubberHead, this._scrubberDragStart.bind(this), this._scrubberDragMove.bind(this), this._scrubberDragEnd.bind(this), "move");
this._timelineScrubberHead.textContent = WebInspector.UIString(Number.millisToString(0));
this._underlyingPlaybackRate = 1;
this.contentElement.appendChild(this._createHeader());
this._animationsContainer = this.contentElement.createChild("div", "animation-timeline-rows");
this._duration = this._defaultDuration();
this._scrubberRadius = 25;
this._timelineControlsWidth = 200;
/** @type {!Map.<!DOMAgent.BackendNodeId, !WebInspector.AnimationTimeline.NodeUI>} */
this._nodesMap = new Map();
this._symbol = Symbol("animationTimeline");
/** @type {!Map.<string, !WebInspector.AnimationModel.Animation>} */
this._animationsMap = new Map();
WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel, WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspector.DOMModel.Events.NodeRemoved, this._nodeRemoved, this);
WebInspector.targetManager.observeTargets(this, WebInspector.Target.Type.Page);
}
WebInspector.AnimationTimeline.GlobalPlaybackRates = [0.1, 0.25, 0.5, 1.0];
WebInspector.AnimationTimeline.prototype = {
wasShown: function()
{
for (var target of WebInspector.targetManager.targets(WebInspector.Target.Type.Page))
this._addEventListeners(target);
},
willHide: function()
{
for (var target of WebInspector.targetManager.targets(WebInspector.Target.Type.Page))
this._removeEventListeners(target);
},
/**
* @override
* @param {!WebInspector.Target} target
*/
targetAdded: function(target)
{
if (this.isShowing())
this._addEventListeners(target);
后面还有 1040 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。