Bug 1552116 - Move devtools.inspector.inactive.css.enabled to devtools shared preferences r=miker
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 16 May 2019 09:58:43 +0000
changeset 532892 7f053480beaab8263f4ac6a7fd740d9eaaa5ee5a
parent 532891 e6913f1de086cb75104de6f5105df44f7818ce1e
child 532893 7908eb064b0c211e6e40b70f4313b12a1487d741
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiker
bugs1552116
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1552116 - Move devtools.inspector.inactive.css.enabled to devtools shared preferences r=miker This preference is used both by the client and the server and cannot be stored in devtools/client Also added default fallback values. Differential Revision: https://phabricator.services.mozilla.com/D31404
devtools/client/inspector/rules/models/element-style.js
devtools/client/preferences/devtools-client.js
devtools/server/actors/utils/inactive-property-helper.js
devtools/shared/preferences/devtools-shared.js
--- a/devtools/client/inspector/rules/models/element-style.js
+++ b/devtools/client/inspector/rules/models/element-style.js
@@ -65,17 +65,18 @@ class ElementStyle {
       this.pageStyle.on("stylesheet-updated", this.onRefresh);
       this.ruleView.inspector.styleChangeTracker.on("style-changed", this.onRefresh);
       this.ruleView.selection.on("pseudoclass", this.onRefresh);
     }
   }
 
   get unusedCssEnabled() {
     if (!this._unusedCssEnabled) {
-      this._unusedCssEnabled = Services.prefs.getBoolPref(PREF_INACTIVE_CSS_ENABLED);
+      this._unusedCssEnabled =
+        Services.prefs.getBoolPref(PREF_INACTIVE_CSS_ENABLED, false);
     }
     return this._unusedCssEnabled;
   }
 
   destroy() {
     if (this.destroyed) {
       return;
     }
--- a/devtools/client/preferences/devtools-client.js
+++ b/devtools/client/preferences/devtools-client.js
@@ -45,22 +45,16 @@ pref("devtools.inspector.show_pseudo_ele
 // The default size for image preview tooltips in the rule-view/computed-view/markup-view
 pref("devtools.inspector.imagePreviewTooltipSize", 300);
 // Enable user agent style inspection in rule-view
 pref("devtools.inspector.showUserAgentStyles", false);
 // Show all native anonymous content
 pref("devtools.inspector.showAllAnonymousContent", false);
 // Show user agent shadow roots
 pref("devtools.inspector.showUserAgentShadowRoots", false);
-// Enable Inactive CSS detection
-#if defined(NIGHTLY_BUILD)
-pref("devtools.inspector.inactive.css.enabled", true);
-#else
-pref("devtools.inspector.inactive.css.enabled", false);
-#endif
 // Enable the new Rules View
 pref("devtools.inspector.new-rulesview.enabled", false);
 
 // Grid highlighter preferences
 pref("devtools.gridinspector.gridOutlineMaxColumns", 50);
 pref("devtools.gridinspector.gridOutlineMaxRows", 50);
 pref("devtools.gridinspector.showGridAreas", false);
 pref("devtools.gridinspector.showGridLineNumbers", false);
--- a/devtools/server/actors/utils/inactive-property-helper.js
+++ b/devtools/server/actors/utils/inactive-property-helper.js
@@ -132,17 +132,17 @@ class InactivePropertyHelper {
         msgId: "inactive-css-not-grid-or-flex-container",
         numFixProps: 2,
       },
     ];
   }
 
   get unusedCssEnabled() {
     if (!this._unusedCssEnabled) {
-      this._unusedCssEnabled = Services.prefs.getBoolPref(PREF_UNUSED_CSS_ENABLED);
+      this._unusedCssEnabled = Services.prefs.getBoolPref(PREF_UNUSED_CSS_ENABLED, false);
     }
     return this._unusedCssEnabled;
   }
 
   /**
    * Is this CSS property having any effect on this element?
    *
    * @param {DOMNode} el
--- a/devtools/shared/preferences/devtools-shared.js
+++ b/devtools/shared/preferences/devtools-shared.js
@@ -60,8 +60,17 @@ pref("devtools.remote.tls-handshake-time
 
 // The extension ID for devtools-adb-extension
 pref("devtools.remote.adb.extensionID", "adb@mozilla.org");
 // The URL for for devtools-adb-extension (overridden in tests to a local path)
 pref("devtools.remote.adb.extensionURL", "https://ftp.mozilla.org/pub/mozilla.org/labs/devtools/adb-extension/#OS#/adb-extension-latest-#OS#.xpi");
 
 // URL of the remote JSON catalog used for device simulation
 pref("devtools.devices.url", "https://code.cdn.mozilla.net/devices/devices.json");
+
+// Enable Inactive CSS detection. This preference is used both by the client and the
+// server.
+// TODO: clarify the feature detection strategy for this feature. Bug 1552116.
+#if defined(NIGHTLY_BUILD)
+pref("devtools.inspector.inactive.css.enabled", true);
+#else
+pref("devtools.inspector.inactive.css.enabled", false);
+#endif