Bug 1381545 - Send stylo prefs via Report Site Issue. r=Gijs
authorCarol Chung <cch5ng@gmail.com>
Mon, 24 Jul 2017 18:05:29 -0700
changeset 371325 2ad1af89c807dfb0cc6c0c8702e56972d586ccba
parent 371324 95c0feba19eca15b4d7084e5eb0d5f08b4858b88
child 371326 20da293c7656ef8e58f8acdc36f9e34de1ac7ae0
push id32241
push usercbook@mozilla.com
push dateThu, 27 Jul 2017 08:57:54 +0000
treeherdermozilla-central@e5693cea1ec9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1381545
milestone56.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 1381545 - Send stylo prefs via Report Site Issue. r=Gijs
browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm
--- a/browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm
+++ b/browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm
@@ -6,16 +6,17 @@ this.EXPORTED_SYMBOLS = ["WebCompatRepor
 
 let { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 const TABLISTENER_JSM = "chrome://webcompat-reporter/content/TabListener.jsm";
 const WIDGET_ID = "webcompat-reporter-button";
+const PREF_STYLO_ENABLED = "layout.css.servo.enabled";
 
 XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
   "resource:///modules/CustomizableUI.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "wcStrings", function() {
   return Services.strings.createBundle(
     "chrome://webcompat-reporter/locale/webcompat.properties");
 });
@@ -115,19 +116,28 @@ let WebCompatReporter = {
   //    so it can show a preview to the user and include it in FormData
   // Note: openWebCompatTab arguments are passed in as an array because they
   // are the result of a promise resolution.
   openWebCompatTab([gBrowser, tabData]) {
     const SCREENSHOT_MESSAGE = "WebCompat:SendScreenshot";
     const FRAMESCRIPT = "chrome://webcompat-reporter/content/wc-frame.js";
     let win = Services.wm.getMostRecentWindow("navigator:browser");
     const WEBCOMPAT_ORIGIN = new win.URL(WebCompatReporter.endpoint).origin;
+    let styloEnabled = Services.prefs.getBoolPref(PREF_STYLO_ENABLED, false);
+
+    let params = new URLSearchParams();
+    params.append("url", `${tabData.url}`);
+    params.append("src", "desktop-reporter");
+    if (styloEnabled) {
+        params.append("details", "layout.css.servo.enabled: true");
+        params.append("label", "type-stylo");
+    }
 
     let tab = gBrowser.loadOneTab(
-      `${WebCompatReporter.endpoint}?url=${encodeURIComponent(tabData.url)}&src=desktop-reporter`,
+      `${WebCompatReporter.endpoint}?${params}`,
       {inBackground: false, triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal()});
 
     // If we successfully got a screenshot blob, add a listener to know when
     // the new tab is loaded before sending it over.
     if (tabData && tabData.blob) {
       let browser = gBrowser.getBrowserForTab(tab);
       let loadedListener = {
         QueryInterface: XPCOMUtils.generateQI(["nsIWebProgressListener",