Bug 1411532 part 2 - Add a line to about:support that says whether stylo is enabled for chrome. r?bz
MozReview-Commit-ID: K1DU9KbtQJZ
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -76,31 +76,46 @@ var snapshotFormatters = {
if (data.remoteAutoStart) {
$("contentprocesses-box").textContent = data.currentContentProcesses +
"/" +
data.maxContentProcesses;
} else {
$("contentprocesses-row").hidden = true;
}
- let styloReason;
- if (!data.styloBuild) {
- styloReason = strings.GetStringFromName("disabledByBuild");
- } else if (data.styloResult != data.styloDefault) {
- if (data.styloResult) {
- styloReason = strings.GetStringFromName("enabledByUser");
+ function getReasonStringName(resultValue, defaultValue) {
+ if (resultValue != defaultValue) {
+ if (resultValue) {
+ return "enabledByUser";
+ } else {
+ return "disabledByUser";
+ }
} else {
- styloReason = strings.GetStringFromName("disabledByUser");
+ if (resultValue) {
+ return "enabledByDefault";
+ } else {
+ return "disabledByDefault";
+ }
}
- } else if (data.styloDefault) {
- styloReason = strings.GetStringFromName("enabledByDefault");
+ }
+ let styloReason;
+ let styloChromeReason;
+ if (!data.styloBuild) {
+ styloReason = "disabledByBuild";
+ styloChromeReason = "disabledByBuild";
} else {
- styloReason = strings.GetStringFromName("disabledByDefault");
+ styloReason = getReasonStringName(data.styloResult, data.styloDefault);
+ styloChromeReason = getReasonStringName(data.styloChromeResult,
+ data.styloChromeDefault);
}
- $("stylo-box").textContent = `${data.styloResult} (${styloReason})`;
+ styloReason = strings.GetStringFromName(styloReason);
+ styloChromeReason = strings.GetStringFromName(styloChromeReason);
+ $("stylo-box").textContent =
+ `content = ${data.styloResult} (${styloReason}), ` +
+ `chrome = ${data.styloChromeResult} (${styloChromeReason})`;
let keyGoogleFound = data.keyGoogleFound ? "found" : "missing";
$("key-google-box").textContent = strings.GetStringFromName(keyGoogleFound);
let keyMozillaFound = data.keyMozillaFound ? "found" : "missing";
$("key-mozilla-box").textContent = strings.GetStringFromName(keyMozillaFound);
$("safemode-box").textContent = data.safeMode;
--- a/toolkit/modules/Troubleshoot.jsm
+++ b/toolkit/modules/Troubleshoot.jsm
@@ -64,17 +64,17 @@ const PREFS_WHITELIST = [
"general.useragent.",
"gfx.",
"html5.",
"image.",
"javascript.",
"keyword.",
"layers.",
"layout.css.dpi",
- "layout.css.servo.enabled",
+ "layout.css.servo.",
"layout.display-list.",
"media.",
"mousewheel.",
"network.",
"permissions.default.image",
"places.",
"plugin.",
"plugins.",
@@ -244,16 +244,26 @@ var dataProviders = {
data.styloResult = true;
} else if (env.get("STYLO_FORCE_DISABLED")) {
data.styloResult = false;
} else {
data.styloResult =
Services.prefs.getBoolPref("layout.css.servo.enabled", false);
}
}
+ data.styloChromeDefault =
+ Services.prefs.getDefaultBranch(null)
+ .getBoolPref("layout.css.servo.chrome.enabled", false);
+ data.styloChromeResult = false;
+ if (data.styloResult) {
+ let winUtils = Services.wm.getMostRecentWindow("").
+ QueryInterface(Ci.nsIInterfaceRequestor).
+ getInterface(Ci.nsIDOMWindowUtils);
+ data.styloChromeResult = winUtils.isStyledByServo;
+ }
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);
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js
@@ -148,16 +148,22 @@ const SNAPSHOT_SCHEMA = {
type: "boolean",
},
styloDefault: {
type: "boolean",
},
styloResult: {
type: "boolean",
},
+ styloChromeDefault: {
+ type: "boolean",
+ },
+ styloChromeResult: {
+ type: "boolean",
+ },
keyGoogleFound: {
type: "boolean",
},
keyMozillaFound: {
type: "boolean",
},
safeMode: {
type: "boolean",