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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 2144923002: DevTools: remove the ComputedStyles -> Styles pane dependency. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698