| Index: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| index 8530344b19d9b7fd7017cad92a817dfce8816eef..3b98d610b1543273d8009404c7bcf5078ba26e5f 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
|
| @@ -242,26 +242,26 @@ WebInspector.StylesSidebarPane.prototype = {
|
| {
|
| this._discardElementUnderMouse();
|
|
|
| - return this.fetchMatchedCascade()
|
| + return this._fetchMatchedCascade()
|
| .then(this._innerRebuildUpdate.bind(this));
|
| },
|
|
|
| _resetCache: function()
|
| {
|
| - delete this._matchedCascadePromise;
|
| + if (this.cssModel())
|
| + this.cssModel().discardCachedMatchedCascade();
|
| },
|
|
|
| /**
|
| * @return {!Promise.<?WebInspector.CSSMatchedStyles>}
|
| */
|
| - fetchMatchedCascade: function()
|
| + _fetchMatchedCascade: function()
|
| {
|
| var node = this.node();
|
| - if (!node)
|
| + if (!node || !this.cssModel())
|
| return Promise.resolve(/** @type {?WebInspector.CSSMatchedStyles} */(null));
|
| - if (!this._matchedCascadePromise)
|
| - this._matchedCascadePromise = this._matchedStylesForNode(node).then(validateStyles.bind(this));
|
| - return this._matchedCascadePromise;
|
| +
|
| + return this.cssModel().cachedMatchedCascadeForNode(node).then(validateStyles.bind(this));
|
|
|
| /**
|
| * @param {?WebInspector.CSSMatchedStyles} matchedStyles
|
| @@ -275,18 +275,6 @@ WebInspector.StylesSidebarPane.prototype = {
|
| },
|
|
|
| /**
|
| - * @param {!WebInspector.DOMNode} node
|
| - * @return {!Promise.<?WebInspector.CSSMatchedStyles>}
|
| - */
|
| - _matchedStylesForNode: function(node)
|
| - {
|
| - var cssModel = this.cssModel();
|
| - if (!cssModel)
|
| - return Promise.resolve(/** @type {?WebInspector.CSSMatchedStyles} */(null));
|
| - return cssModel.matchedStylesPromise(node.id)
|
| - },
|
| -
|
| - /**
|
| * @param {boolean} editing
|
| */
|
| setEditingStyle: function(editing)
|
|
|