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

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

Issue 620783002: Devtools Animations: Basic animation inspection & control in Styles pane (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review changes for AnimationSection 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 if (error || !inlinePayload) 250 if (error || !inlinePayload)
251 userCallback(null, null); 251 userCallback(null, null);
252 else 252 else
253 userCallback(WebInspector.CSSStyleDeclaration.parsePayload(this, inlinePayload), attributesStylePayload ? WebInspector.CSSStyleDeclaration.parse Payload(this, attributesStylePayload) : null); 253 userCallback(WebInspector.CSSStyleDeclaration.parsePayload(this, inlinePayload), attributesStylePayload ? WebInspector.CSSStyleDeclaration.parse Payload(this, attributesStylePayload) : null);
254 } 254 }
255 255
256 this._agent.getInlineStylesForNode(nodeId, callback.bind(this, userCallb ack)); 256 this._agent.getInlineStylesForNode(nodeId, callback.bind(this, userCallb ack));
257 }, 257 },
258 258
259 /** 259 /**
260 * @param {!DOMAgent.NodeId} sequenceNumber
261 * @param {function(?Array.<!WebInspector.CSSRule>)} userCallback
262 */
263 getKeyframeStylesForNodeAsync: function(sequenceNumber, userCallback)
264 {
265 /**
266 * @param {function(?Array.<!WebInspector.CSSRule>)} userCallback
267 * @param {?Protocol.Error} error
268 * @param {?Array.<!CSSAgent.CSSRule>} payloads
269 * @this {WebInspector.CSSStyleModel}
270 */
271 function callback(userCallback, error, payloads)
caseq 2014/10/02 10:02:26 nit: no need to pass userCallback explicitly (oute
samli 2014/10/03 06:05:05 Done.
272 {
273 var cssStyleModel = this;
274 userCallback(payloads.map(function (payload) {
275 return WebInspector.CSSRule.parsePayload(cssStyleModel, payload) ;
276 }));
277 }
278 this._agent.getKeyframeStylesForNode(sequenceNumber, callback.bind(this, userCallback));
279 },
280
281
282 /**
260 * @param {!WebInspector.DOMNode} node 283 * @param {!WebInspector.DOMNode} node
261 * @param {string} pseudoClass 284 * @param {string} pseudoClass
262 * @param {boolean} enable 285 * @param {boolean} enable
263 * @return {boolean} 286 * @return {boolean}
264 */ 287 */
265 forcePseudoState: function(node, pseudoClass, enable) 288 forcePseudoState: function(node, pseudoClass, enable)
266 { 289 {
267 var pseudoClasses = node.getUserProperty(WebInspector.CSSStyleModel.Pseu doStatePropertyName) || []; 290 var pseudoClasses = node.getUserProperty(WebInspector.CSSStyleModel.Pseu doStatePropertyName) || [];
268 if (enable) { 291 if (enable) {
269 if (pseudoClasses.indexOf(pseudoClass) >= 0) 292 if (pseudoClasses.indexOf(pseudoClass) >= 0)
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 for (var i = 0; i < callbacks.length; ++i) 1730 for (var i = 0; i < callbacks.length; ++i)
1708 callbacks[i](computedStyle); 1731 callbacks[i](computedStyle);
1709 } 1732 }
1710 } 1733 }
1711 } 1734 }
1712 1735
1713 /** 1736 /**
1714 * @type {!WebInspector.CSSStyleModel} 1737 * @type {!WebInspector.CSSStyleModel}
1715 */ 1738 */
1716 WebInspector.cssModel; 1739 WebInspector.cssModel;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698