Bug 1412507 - Port bug 1411532 (part 2) to TB: Add a line to about:support that says whether stylo is enabled for chrome. r=aceman CLOSED TREE DONTBUILD
authorRichard Marti <richard.marti@gmail.com>
Sat, 28 Oct 2017 11:52:15 +0200
changeset 29279 59043b5664802c8d42540fe352eb40446b6fcbe3
parent 29278 395acea4a3e753488ca38d56c51654d151d50d6c
child 29280 891c8dc1e07ed89c8e5a3187f2649e32f57561ae
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1412507, 1411532
Bug 1412507 - Port bug 1411532 (part 2) to TB: Add a line to about:support that says whether stylo is enabled for chrome. r=aceman CLOSED TREE DONTBUILD
mail/components/about-support/content/aboutSupport.js
--- a/mail/components/about-support/content/aboutSupport.js
+++ b/mail/components/about-support/content/aboutSupport.js
@@ -98,31 +98,37 @@ var snapshotFormatters = {
     if (data.remoteAutoStart) {
       $("contentprocesses-box").textContent = data.currentContentProcesses +
                                               "/" +
                                               data.maxContentProcesses;
     } else {
       $("contentprocesses-row").hidden = true;
     }
 
+    function getReasonStringName(resultValue, defaultValue) {
+      if (resultValue != defaultValue) {
+        return resultValue ? "enabledByUser" : "disabledByUser";
+      }
+      return resultValue ? "enabledByDefault" : "disabledByDefault";
+    }
     let styloReason;
+    let styloChromeReason;
     if (!data.styloBuild) {
-      styloReason = strings.GetStringFromName("disabledByBuild");
-    } else if (data.styloResult != data.styloDefault) {
-      if (data.styloResult) {
-        styloReason = strings.GetStringFromName("enabledByUser");
-      } else {
-        styloReason = strings.GetStringFromName("disabledByUser");
-      }
-    } else if (data.styloDefault) {
-      styloReason = strings.GetStringFromName("enabledByDefault");
+      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;