Index: Source/devtools/front_end/elements/StylesSidebarPane.js |
diff --git a/Source/devtools/front_end/elements/StylesSidebarPane.js b/Source/devtools/front_end/elements/StylesSidebarPane.js |
index dffd02758e605be13bb481f15cc28e4c7bc238da..6ba5681be5c60907561eefc1d2e4149ee8cb997b 100644 |
--- a/Source/devtools/front_end/elements/StylesSidebarPane.js |
+++ b/Source/devtools/front_end/elements/StylesSidebarPane.js |
@@ -313,16 +313,14 @@ WebInspector.StylesSidebarPane.prototype = { |
/** |
* @override |
- * @param {!WebInspector.Throttler.FinishCallback} finishedCallback |
+ * @return {!Promise.<?>} |
*/ |
- doUpdate: function(finishedCallback) |
+ doUpdate: function() |
{ |
this._discardElementUnderMouse(); |
- this.fetchMatchedCascade() |
+ return this.fetchMatchedCascade() |
.then(this._innerRebuildUpdate.bind(this)) |
- .then(finishedCallback) |
- .catch(/** @type {function()} */(finishedCallback)); |
}, |
_resetCache: function() |
@@ -2804,14 +2802,12 @@ WebInspector.StylePropertyTreeElement.prototype = { |
/** |
* @param {string} styleText |
* @param {boolean} majorChange |
- * @param {!WebInspector.Throttler.FinishCallback} finishedCallback |
+ * @return {!Promise.<undefined>} |
*/ |
- _innerApplyStyleText: function(styleText, majorChange, finishedCallback) |
+ _innerApplyStyleText: function(styleText, majorChange) |
{ |
- if (!this.treeOutline) { |
- finishedCallback(); |
- return; |
- } |
+ if (!this.treeOutline) |
+ return Promise.resolve(); |
styleText = styleText.replace(/\s/g, " ").trim(); // Replace with whitespace. |
if (!styleText.length && majorChange && this._newProperty && !this._propertyHasBeenEditedIncrementally) { |
@@ -2819,7 +2815,7 @@ WebInspector.StylePropertyTreeElement.prototype = { |
var section = this.section(); |
this.parent.removeChild(this); |
section.afterUpdate(); |
- return; |
+ return Promise.resolve(); |
} |
var currentNode = this._parentPane.node(); |
@@ -2838,7 +2834,6 @@ WebInspector.StylePropertyTreeElement.prototype = { |
// It did not apply, cancel editing. |
this._revertStyleUponEditingCanceled(); |
} |
- finishedCallback(); |
this.styleTextAppliedForTest(); |
return; |
} |
@@ -2851,7 +2846,6 @@ WebInspector.StylePropertyTreeElement.prototype = { |
if (!this._parentPane._isEditingStyle && currentNode === this.node()) |
this._updatePane(); |
- finishedCallback(); |
this.styleTextAppliedForTest(); |
} |
@@ -2860,9 +2854,8 @@ WebInspector.StylePropertyTreeElement.prototype = { |
if (styleText.length && !/;\s*$/.test(styleText)) |
styleText += ";"; |
var overwriteProperty = !this._newProperty || this._propertyHasBeenEditedIncrementally; |
- this.property.setText(styleText, majorChange, overwriteProperty) |
- .then(callback.bind(this)) |
- .catch(/** @type {function()} */(finishedCallback)); |
+ return this.property.setText(styleText, majorChange, overwriteProperty) |
+ .then(callback.bind(this)); |
}, |
/** |