| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 /** | 62 /** |
| 63 * @param {?WebInspector.CSSStyleDeclaration} style | 63 * @param {?WebInspector.CSSStyleDeclaration} style |
| 64 * @this {WebInspector.MetricsSidebarPane} | 64 * @this {WebInspector.MetricsSidebarPane} |
| 65 */ | 65 */ |
| 66 function callback(style) | 66 function callback(style) |
| 67 { | 67 { |
| 68 if (!style || this.node() !== node) | 68 if (!style || this.node() !== node) |
| 69 return; | 69 return; |
| 70 this._updateMetrics(style); | 70 this._updateMetrics(style); |
| 71 } | 71 } |
| 72 cssModel.getComputedStyleAsync(node.id, callback.bind(this)); | |
| 73 | |
| 74 /** | 72 /** |
| 75 * @param {?WebInspector.CSSStyleModel.InlineStyleResult} inlineStyleRes
ult | 73 * @param {?WebInspector.CSSStyleModel.InlineStyleResult} inlineStyleRes
ult |
| 76 * @this {WebInspector.MetricsSidebarPane} | 74 * @this {WebInspector.MetricsSidebarPane} |
| 77 */ | 75 */ |
| 78 function inlineStyleCallback(inlineStyleResult) | 76 function inlineStyleCallback(inlineStyleResult) |
| 79 { | 77 { |
| 80 if (inlineStyleResult && this.node() === node) | 78 if (inlineStyleResult && this.node() === node) |
| 81 this.inlineStyle = inlineStyleResult.inlineStyle; | 79 this.inlineStyle = inlineStyleResult.inlineStyle; |
| 82 finishedCallback(); | |
| 83 } | 80 } |
| 84 cssModel.getInlineStylesAsync(node.id, inlineStyleCallback.bind(this)); | 81 |
| 82 var promises = [ |
| 83 cssModel.computedStylePromise(node.id).then(callback.bind(this)), |
| 84 cssModel.inlineStylesPromise(node.id).then(inlineStyleCallback.bind(
this)) |
| 85 ]; |
| 86 Promise.all(promises) |
| 87 .then(finishedCallback.bind(null, undefined)) |
| 88 .catch(/** @type {function()} */(finishedCallback)); |
| 85 }, | 89 }, |
| 86 | 90 |
| 87 /** | 91 /** |
| 88 * @override | 92 * @override |
| 89 */ | 93 */ |
| 90 onDOMModelChanged: function() | 94 onDOMModelChanged: function() |
| 91 { | 95 { |
| 92 this.update(); | 96 this.update(); |
| 93 }, | 97 }, |
| 94 | 98 |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 }, | 460 }, |
| 457 | 461 |
| 458 editingCommitted: function(element, userInput, previousContent, context) | 462 editingCommitted: function(element, userInput, previousContent, context) |
| 459 { | 463 { |
| 460 this.editingEnded(element, context); | 464 this.editingEnded(element, context); |
| 461 this._applyUserInput(element, userInput, previousContent, context, true)
; | 465 this._applyUserInput(element, userInput, previousContent, context, true)
; |
| 462 }, | 466 }, |
| 463 | 467 |
| 464 __proto__: WebInspector.ElementsSidebarPane.prototype | 468 __proto__: WebInspector.ElementsSidebarPane.prototype |
| 465 } | 469 } |
| OLD | NEW |