Bug 1378825 - Stop using sdk/stylesheet/utils in DevTools; r=zer0
authorJan Odvarko <odvarko@gmail.com>
Mon, 10 Jul 2017 11:10:55 +0200
changeset 418130 299ca152f01a7725e8eda4c818a6370543f9d729
parent 418129 d8163e29a92f2b4b2d8d651c7518507c7ec1dcad
child 418131 bf290e0676b5a16a6851369327fbc4cb1ad686d3
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszer0
bugs1378825
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 1378825 - Stop using sdk/stylesheet/utils in DevTools; r=zer0 MozReview-Commit-ID: F26gvdnTbhT
devtools/client/shared/theme-switching.js
devtools/client/webconsole/net/main.js
--- a/devtools/client/shared/theme-switching.js
+++ b/devtools/client/shared/theme-switching.js
@@ -87,17 +87,17 @@
     let loadEvents = [];
     for (let url of newThemeDef.stylesheets) {
       let {styleSheet, loadPromise} = appendStyleSheet(document, url);
       devtoolsStyleSheets.get(newThemeDef).push(styleSheet);
       loadEvents.push(loadPromise);
     }
 
     try {
-      const StylesheetUtils = require("sdk/stylesheet/utils");
+      const StylesheetUtils = require("devtools/shared/layout/utils");
       const SCROLLBARS_URL = "chrome://devtools/skin/floating-scrollbars-dark-theme.css";
 
       // TODO: extensions might want to customize scrollbar styles too.
       if (!Services.appShell.hiddenDOMWindow
         .matchMedia("(-moz-overlay-scrollbars)").matches) {
         if (newTheme == "dark") {
           StylesheetUtils.loadSheet(window, SCROLLBARS_URL, "agent");
         } else if (oldTheme == "dark") {
--- a/devtools/client/webconsole/net/main.js
+++ b/devtools/client/webconsole/net/main.js
@@ -1,27 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 /* global BrowserLoader */
 
-var { utils: Cu } = Components;
-
 // Initialize module loader and load all modules of the new inline
 // preview feature. The entire code-base doesn't need any extra
 // privileges and runs entirely in content scope.
 const rootUrl = "resource://devtools/client/webconsole/net/";
 const require = BrowserLoader({
   baseURI: rootUrl,
   window}).require;
 
 const NetRequest = require("./net-request");
-const { loadSheet } = require("sdk/stylesheet/utils");
+const { loadSheet } = require("devtools/shared/layout/utils");
 
 // Localization
 const {LocalizationHelper} = require("devtools/shared/l10n");
 const L10N = new LocalizationHelper("devtools/client/locales/netmonitor.properties");
 
 // Stylesheets
 var styleSheets = [
   "resource://devtools/client/jsonview/css/toolbar.css",
@@ -53,16 +51,17 @@ styleSheets.forEach(url => {
 // https://github.com/yahoo/react-intl
 this.Locale = {
   $STR: key => {
     try {
       return L10N.getStr(key);
     } catch (err) {
       console.error(key + ": " + err);
     }
+    return key;
   }
 };
 
 // List of NetRequest instances represents the state.
 // As soon as Redux is in place it should be maintained using a reducer.
 var netRequests = new Map();
 
 /**
@@ -83,16 +82,14 @@ function onNetworkEvent(log) {
 
   if (!netRequest) {
     return;
   }
 
   if (log.update) {
     netRequest.updateBody(response);
   }
-
-  return;
 }
 
 // Make the 'onNetworkEvent' accessible from chrome (see webconsole.js)
 this.NetRequest = {
   onNetworkEvent: onNetworkEvent
 };