OLD | NEW |
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 Loading... |
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 {!string} id |
| 261 * @param {function(?Array.<!WebInspector.CSSRule>)} userCallback |
| 262 */ |
| 263 getKeyframeStylesForNodeAsync: function(id, userCallback) |
| 264 { |
| 265 /** |
| 266 * @param {?Protocol.Error} error |
| 267 * @param {?Array.<!CSSAgent.CSSRule>} payloads |
| 268 * @this {WebInspector.CSSStyleModel} |
| 269 */ |
| 270 function callback(error, payloads) |
| 271 { |
| 272 var cssStyleModel = this; |
| 273 userCallback(payloads.map(function (payload) { |
| 274 return WebInspector.CSSRule.parsePayload(cssStyleModel, payload)
; |
| 275 })); |
| 276 } |
| 277 this._agent.getKeyframeStylesForNode(id, callback.bind(this)); |
| 278 }, |
| 279 |
| 280 |
| 281 /** |
260 * @param {!WebInspector.DOMNode} node | 282 * @param {!WebInspector.DOMNode} node |
261 * @param {string} pseudoClass | 283 * @param {string} pseudoClass |
262 * @param {boolean} enable | 284 * @param {boolean} enable |
263 * @return {boolean} | 285 * @return {boolean} |
264 */ | 286 */ |
265 forcePseudoState: function(node, pseudoClass, enable) | 287 forcePseudoState: function(node, pseudoClass, enable) |
266 { | 288 { |
267 var pseudoClasses = node.getUserProperty(WebInspector.CSSStyleModel.Pseu
doStatePropertyName) || []; | 289 var pseudoClasses = node.getUserProperty(WebInspector.CSSStyleModel.Pseu
doStatePropertyName) || []; |
268 if (enable) { | 290 if (enable) { |
269 if (pseudoClasses.indexOf(pseudoClass) >= 0) | 291 if (pseudoClasses.indexOf(pseudoClass) >= 0) |
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 for (var i = 0; i < callbacks.length; ++i) | 1729 for (var i = 0; i < callbacks.length; ++i) |
1708 callbacks[i](computedStyle); | 1730 callbacks[i](computedStyle); |
1709 } | 1731 } |
1710 } | 1732 } |
1711 } | 1733 } |
1712 | 1734 |
1713 /** | 1735 /** |
1714 * @type {!WebInspector.CSSStyleModel} | 1736 * @type {!WebInspector.CSSStyleModel} |
1715 */ | 1737 */ |
1716 WebInspector.cssModel; | 1738 WebInspector.cssModel; |
OLD | NEW |