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

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

Issue 2168323002: [DevTools] Explicitly require ResourceTreeModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: URL management was split into a separate CL 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/ComputedStyleModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleModel.js b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleModel.js
index 022fe4ca607697f1ad77ae3c2f30987aa05485c1..4f606fc0ce50057cc2991928a4d8f013f25c2bcd 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ComputedStyleModel.js
@@ -35,6 +35,14 @@ WebInspector.ComputedStyleModel.prototype = {
},
/**
+ * @return {?WebInspector.ResourceTreeModel}
+ */
+ resourceTreeModel: function()
+ {
+ return this._resourceTreeModel || null;
pfeldman 2016/07/27 17:54:35 This does not sound right, css should not need res
eostroukhov-old 2016/08/05 18:32:03 This method was left here by mistake, removed now.
+ },
+
+ /**
* @param {!WebInspector.Event} event
*/
_onNodeChanged: function(event)
@@ -58,14 +66,13 @@ WebInspector.ComputedStyleModel.prototype = {
this._target = target;
var domModel = null;
- var resourceTreeModel = null;
if (target) {
this._cssModel = WebInspector.CSSModel.fromTarget(target);
domModel = WebInspector.DOMModel.fromTarget(target);
- resourceTreeModel = target.resourceTreeModel;
+ this._resourceTreeModel = target.resourceTreeModel;
}
- if (this._cssModel && domModel && resourceTreeModel) {
+ if (this._cssModel && domModel && this._resourceTreeModel) {
this._targetEvents = [
this._cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetAdded, this._onComputedStyleChanged, this),
this._cssModel.addEventListener(WebInspector.CSSModel.Events.StyleSheetRemoved, this._onComputedStyleChanged, this),
@@ -74,7 +81,7 @@ WebInspector.ComputedStyleModel.prototype = {
this._cssModel.addEventListener(WebInspector.CSSModel.Events.PseudoStateForced, this._onComputedStyleChanged, this),
this._cssModel.addEventListener(WebInspector.CSSModel.Events.ModelWasEnabled, this._onComputedStyleChanged, this),
domModel.addEventListener(WebInspector.DOMModel.Events.DOMMutated, this._onDOMModelChanged, this),
- resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameResized, this._onFrameResized, this),
+ this._resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameResized, this._onFrameResized, this),
];
}
},

Powered by Google App Engine
This is Rietveld 408576698