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

Unified Diff: Source/devtools/front_end/ElementsPanel.js

Issue 221253002: DevTools: move off WebInspector.css/domModel in sidebars. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review comment addressed. Created 6 years, 9 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
« no previous file with comments | « no previous file | Source/devtools/front_end/MetricsSidebarPane.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ElementsPanel.js
diff --git a/Source/devtools/front_end/ElementsPanel.js b/Source/devtools/front_end/ElementsPanel.js
index 6e00da3f2e6c1d04e9af1234b605bbb3dcba0240..94ae1496191a18e93f21b028c8b1b701b5a18e1d 100644
--- a/Source/devtools/front_end/ElementsPanel.js
+++ b/Source/devtools/front_end/ElementsPanel.js
@@ -1051,11 +1051,21 @@ WebInspector.ElementsPanel.prototype = {
},
/**
+ * @return {boolean}
+ */
+ _cssModelEnabledForSelectedNode: function()
+ {
+ if (!this.selectedDOMNode())
+ return true;
+ return this.selectedDOMNode().target().cssModel.isEnabled();
+ },
+
+ /**
* @param {boolean=} forceUpdate
*/
updateStyles: function(forceUpdate)
{
- if (!WebInspector.cssModel.isEnabled())
+ if (!this._cssModelEnabledForSelectedNode())
return;
var stylesSidebarPane = this.sidebarPanes.styles;
var computedStylePane = this.sidebarPanes.computedStyle;
@@ -1068,7 +1078,7 @@ WebInspector.ElementsPanel.prototype = {
updateMetrics: function()
{
- if (!WebInspector.cssModel.isEnabled())
+ if (!this._cssModelEnabledForSelectedNode())
return;
var metricsSidebarPane = this.sidebarPanes.metrics;
if (!metricsSidebarPane.isShowing() || !metricsSidebarPane.needsUpdate)
@@ -1080,7 +1090,7 @@ WebInspector.ElementsPanel.prototype = {
updatePlatformFonts: function()
{
- if (!WebInspector.cssModel.isEnabled())
+ if (!this._cssModelEnabledForSelectedNode())
return;
var platformFontsSidebar = this.sidebarPanes.platformFonts;
if (!platformFontsSidebar.isShowing() || !platformFontsSidebar.needsUpdate)
« no previous file with comments | « no previous file | Source/devtools/front_end/MetricsSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698