Bug 1382090 - Test both prefs and build for Stylo in about:support. r=bholley draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 19 Jul 2017 16:32:40 -0500
changeset 611593 1359ed623c6892e5161ab166dc4107a41343a4ac
parent 611331 c5ea72577f794635a334a30780d104a1d89267a0
child 638196 1dc63b90b52018e5a240b126e037119263a84b93
push id69258
push userbmo:jryans@gmail.com
push dateWed, 19 Jul 2017 21:35:10 +0000
reviewersbholley
bugs1382090
milestone56.0a1
Bug 1382090 - Test both prefs and build for Stylo in about:support. r=bholley Avoid the confusing state of "Stylo: true (disabled by build)" by also checking the build constant _and_ the pref / env var together. MozReview-Commit-ID: jTK66cWcyv
toolkit/modules/Troubleshoot.jsm
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -232,18 +232,19 @@ var dataProviders = {
     } catch (e) {
       data.autoStartStatus = -1;
     }
 
     data.styloBuild = AppConstants.MOZ_STYLO;
     data.styloDefault = Services.prefs.getDefaultBranch(null)
                                 .getBoolPref("layout.css.servo.enabled", false);
     data.styloResult =
-      !!env.get("STYLO_FORCE_ENABLED") ||
-      Services.prefs.getBoolPref("layout.css.servo.enabled", false);
+      AppConstants.MOZ_STYLO &&
+      (!!env.get("STYLO_FORCE_ENABLED") ||
+       Services.prefs.getBoolPref("layout.css.servo.enabled", false));
 
     const keyGoogle = Services.urlFormatter.formatURL("%GOOGLE_API_KEY%").trim();
     data.keyGoogleFound = keyGoogle != "no-google-api-key" && keyGoogle.length > 0;
 
     const keyMozilla = Services.urlFormatter.formatURL("%MOZILLA_API_KEY%").trim();
     data.keyMozillaFound = keyMozilla != "no-mozilla-api-key" && keyMozilla.length > 0;
 
     done(data);