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

Side by Side Diff: Source/devtools/front_end/sdk/AnimationModel.js

Issue 664993002: Devtools Animations: Display keyframes for CSS Animations in inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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) 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 /** 176 /**
177 * @constructor 177 * @constructor
178 * @extends {WebInspector.SDKObject} 178 * @extends {WebInspector.SDKObject}
179 * @param {!WebInspector.Target} target 179 * @param {!WebInspector.Target} target
180 * @param {!AnimationAgent.AnimationNode} payload 180 * @param {!AnimationAgent.AnimationNode} payload
181 */ 181 */
182 WebInspector.AnimationModel.AnimationNode = function(target, payload) 182 WebInspector.AnimationModel.AnimationNode = function(target, payload)
183 { 183 {
184 WebInspector.SDKObject.call(this, target); 184 WebInspector.SDKObject.call(this, target);
185 this._payload = payload; 185 this._payload = payload;
186 if (payload.keyframesRule)
187 this._keyframesRule = new WebInspector.AnimationModel.KeyframesRule(targ et, payload.keyframesRule);
186 } 188 }
187 189
188 WebInspector.AnimationModel.AnimationNode.prototype = { 190 WebInspector.AnimationModel.AnimationNode.prototype = {
189 /** 191 /**
190 * @return {number} 192 * @return {number}
191 */ 193 */
192 startDelay: function() 194 startDelay: function()
193 { 195 {
194 return this._payload.startDelay; 196 return this._payload.startDelay;
195 }, 197 },
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 }, 253 },
252 254
253 /** 255 /**
254 * @return {string} 256 * @return {string}
255 */ 257 */
256 name: function() 258 name: function()
257 { 259 {
258 return this._payload.name; 260 return this._payload.name;
259 }, 261 },
260 262
263 /**
264 * @return {?WebInspector.AnimationModel.KeyframesRule}
265 */
266 keyframesRule: function()
267 {
268 return this._keyframesRule;
269 },
270
271 __proto__: WebInspector.SDKObject.prototype
272 }
273
274 /**
275 * @constructor
276 * @extends {WebInspector.SDKObject}
277 * @param {!WebInspector.Target} target
278 * @param {!AnimationAgent.KeyframesRule} payload
279 */
280 WebInspector.AnimationModel.KeyframesRule = function(target, payload)
281 {
282 WebInspector.SDKObject.call(this, target);
283 this._payload = payload;
284 this._keyframes = this._payload.keyframes.map(function (keyframeStyle) {
pfeldman 2014/10/23 06:37:00 Please extract as a named function w/ annotation b
samli 2014/10/24 05:06:19 Done.
285 return new WebInspector.AnimationModel.KeyframeStyle(target, keyframeSty le);
286 });
287 }
288
289 WebInspector.AnimationModel.KeyframesRule.prototype = {
290 /**
291 * @return {string|undefined}
292 */
293 name: function()
294 {
295 return this._payload.name;
296 },
297
298 /**
299 * @return {!Array.<!WebInspector.AnimationModel.KeyframeStyle>}
300 */
301 keyframes: function()
302 {
303 return this._keyframes;
304 },
305
306 __proto__: WebInspector.SDKObject.prototype
307 }
308
309 /**
310 * @constructor
311 * @extends {WebInspector.SDKObject}
312 * @param {!WebInspector.Target} target
313 * @param {!AnimationAgent.KeyframeStyle} payload
314 */
315 WebInspector.AnimationModel.KeyframeStyle = function(target, payload)
316 {
317 WebInspector.SDKObject.call(this, target);
318 this._payload = payload;
319 this._style = WebInspector.CSSStyleDeclaration.parsePayload(this.target().cs sModel, payload.style);
320 }
321
322 WebInspector.AnimationModel.KeyframeStyle.prototype = {
323 /**
324 * @return {string}
325 */
326 offset: function()
327 {
328 return this._payload.offset;
329 },
330
331 /**
332 * @return {!WebInspector.CSSStyleDeclaration}
333 */
334 style: function()
335 {
336 return this._style;
337 },
338
261 __proto__: WebInspector.SDKObject.prototype 339 __proto__: WebInspector.SDKObject.prototype
262 } 340 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698