Backed out changeset 0a516296693b (bug 1590093) for causing browser_jsterm_selfxss.js to permafail CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Mon, 28 Oct 2019 17:15:50 +0200
changeset 499466 d48c19be70fea3f669d456f1f8920a8096c8ae00
parent 499465 d0ec18faae87d1ec52e6ed73f9e9dd3da760935d
child 499467 17e43e854a153904d3fa7501c6049fb6866c2c80
push id98980
push useraciure@mozilla.com
push dateMon, 28 Oct 2019 15:16:46 +0000
treeherderautoland@d48c19be70fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1590093
milestone72.0a1
backs out0a516296693bb8b221744bae054419be6f2510c2
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
Backed out changeset 0a516296693b (bug 1590093) for causing browser_jsterm_selfxss.js to permafail CLOSED TREE
devtools/client/shared/components/menu/MenuButton.js
devtools/client/webconsole/components/App.js
devtools/client/webconsole/components/FilterBar/ConsoleSettings.js
devtools/client/webconsole/components/SideBar.js
--- a/devtools/client/shared/components/menu/MenuButton.js
+++ b/devtools/client/shared/components/menu/MenuButton.js
@@ -11,35 +11,25 @@ const Services = require("Services");
 const flags = require("devtools/shared/flags");
 const {
   createRef,
   PureComponent,
 } = require("devtools/client/shared/vendor/react");
 const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
 const dom = require("devtools/client/shared/vendor/react-dom-factories");
 const { button } = dom;
+const {
+  HTMLTooltip,
+} = require("devtools/client/shared/widgets/tooltip/HTMLTooltip");
+const { focusableSelector } = require("devtools/client/shared/focus");
 
 const isMacOS = Services.appinfo.OS === "Darwin";
 
 loader.lazyRequireGetter(
   this,
-  "HTMLTooltip",
-  "devtools/client/shared/widgets/tooltip/HTMLTooltip",
-  true
-);
-
-loader.lazyRequireGetter(
-  this,
-  "focusableSelector",
-  "devtools/client/shared/focus",
-  true
-);
-
-loader.lazyRequireGetter(
-  this,
   "createPortal",
   "devtools/client/shared/vendor/react-dom",
   true
 );
 
 // Return a copy of |obj| minus |fields|.
 const omit = (obj, fields) => {
   const objCopy = { ...obj };
--- a/devtools/client/webconsole/components/App.js
+++ b/devtools/client/webconsole/components/App.js
@@ -17,58 +17,42 @@ const dom = require("devtools/client/sha
 const {
   connect,
 } = require("devtools/client/shared/redux/visibility-handler-connect");
 
 const actions = require("devtools/client/webconsole/actions/index");
 const {
   FILTERBAR_DISPLAY_MODES,
 } = require("devtools/client/webconsole/constants");
-
-// We directly require Components that we know are going to be used right away
 const ConsoleOutput = createFactory(
   require("devtools/client/webconsole/components/Output/ConsoleOutput")
 );
 const FilterBar = createFactory(
   require("devtools/client/webconsole/components/FilterBar/FilterBar")
 );
+const SideBar = createFactory(
+  require("devtools/client/webconsole/components/SideBar")
+);
+const ReverseSearchInput = createFactory(
+  require("devtools/client/webconsole/components/Input/ReverseSearchInput")
+);
+const EditorToolbar = createFactory(
+  require("devtools/client/webconsole/components/Input/EditorToolbar")
+);
 const JSTerm = createFactory(
   require("devtools/client/webconsole/components/Input/JSTerm")
 );
 const ConfirmDialog = createFactory(
   require("devtools/client/webconsole/components/Input/ConfirmDialog")
 );
-
-// And lazy load the ones that may not be used.
-loader.lazyGetter(this, "SideBar", () =>
-  createFactory(require("devtools/client/webconsole/components/SideBar"))
-);
-
-loader.lazyGetter(this, "ReverseSearchInput", () =>
-  createFactory(
-    require("devtools/client/webconsole/components/Input/ReverseSearchInput")
-  )
+const NotificationBox = createFactory(
+  require("devtools/client/shared/components/NotificationBox").NotificationBox
 );
-
-loader.lazyGetter(this, "EditorToolbar", () =>
-  createFactory(
-    require("devtools/client/webconsole/components/Input/EditorToolbar")
-  )
-);
-
-loader.lazyGetter(this, "NotificationBox", () =>
-  createFactory(
-    require("devtools/client/shared/components/NotificationBox").NotificationBox
-  )
-);
-
-loader.lazyGetter(this, "GridElementWidthResizer", () =>
-  createFactory(
-    require("devtools/client/shared/components/splitter/GridElementWidthResizer")
-  )
+const GridElementWidthResizer = createFactory(
+  require("devtools/client/shared/components/splitter/GridElementWidthResizer")
 );
 
 const l10n = require("devtools/client/webconsole/utils/l10n");
 const { Utils: WebConsoleUtils } = require("devtools/client/webconsole/utils");
 
 const SELF_XSS_OK = l10n.getStr("selfxss.okstring");
 const SELF_XSS_MSG = l10n.getFormatStr("selfxss.msg", [SELF_XSS_OK]);
 
@@ -324,56 +308,46 @@ class App extends Component {
       onPaste: this.onPaste,
       autocomplete,
       editorMode,
       editorWidth,
     });
   }
 
   renderReverseSearch() {
-    const {
-      serviceContainer,
-      reverseSearchInitialValue,
-      reverseSearchInputVisible,
-    } = this.props;
+    const { serviceContainer, reverseSearchInitialValue } = this.props;
 
-    return reverseSearchInputVisible
-      ? ReverseSearchInput({
-          key: "reverse-search-input",
-          setInputValue: serviceContainer.setInputValue,
-          focusInput: serviceContainer.focusInput,
-          initialValue: reverseSearchInitialValue,
-        })
-      : null;
+    return ReverseSearchInput({
+      key: "reverse-search-input",
+      setInputValue: serviceContainer.setInputValue,
+      focusInput: serviceContainer.focusInput,
+      initialValue: reverseSearchInitialValue,
+    });
   }
 
   renderSideBar() {
     const { serviceContainer, sidebarVisible } = this.props;
-    return sidebarVisible
-      ? SideBar({
-          key: "sidebar",
-          serviceContainer,
-          visible: sidebarVisible,
-        })
-      : null;
+    return SideBar({
+      key: "sidebar",
+      serviceContainer,
+      visible: sidebarVisible,
+    });
   }
 
   renderNotificationBox() {
     const { notifications, editorMode } = this.props;
 
-    return notifications && notifications.length > 0
-      ? NotificationBox({
-          id: "webconsole-notificationbox",
-          key: "notification-box",
-          displayBorderTop: !editorMode,
-          displayBorderBottom: editorMode,
-          wrapping: true,
-          notifications,
-        })
-      : null;
+    return NotificationBox({
+      id: "webconsole-notificationbox",
+      key: "notification-box",
+      displayBorderTop: !editorMode,
+      displayBorderBottom: editorMode,
+      wrapping: true,
+      notifications,
+    });
   }
 
   renderConfirmDialog() {
     const { webConsoleUI, serviceContainer } = this.props;
 
     return ConfirmDialog({
       webConsoleUI,
       serviceContainer,
@@ -421,26 +395,24 @@ class App extends Component {
       filterBar,
       editorToolbar,
       dom.div(
         { className: "flexible-output-input", key: "in-out-container" },
         consoleOutput,
         notificationBox,
         jsterm
       ),
-      editorMode
-        ? GridElementWidthResizer({
-            key: "editor-resizer",
-            enabled: editorMode,
-            position: "end",
-            className: "editor-resizer",
-            getControlledElementNode: () => webConsoleUI.jsterm.node,
-            onResizeEnd: width => dispatch(actions.setEditorWidth(width)),
-          })
-        : null,
+      GridElementWidthResizer({
+        key: "editor-resizer",
+        enabled: editorMode,
+        position: "end",
+        className: "editor-resizer",
+        getControlledElementNode: () => webConsoleUI.jsterm.node,
+        onResizeEnd: width => dispatch(actions.setEditorWidth(width)),
+      }),
       reverseSearch,
       sidebar,
       confirmDialog,
     ]);
   }
 }
 
 const mapStateToProps = state => ({
--- a/devtools/client/webconsole/components/FilterBar/ConsoleSettings.js
+++ b/devtools/client/webconsole/components/FilterBar/ConsoleSettings.js
@@ -11,28 +11,22 @@ const PropTypes = require("devtools/clie
 
 const actions = require("devtools/client/webconsole/actions/index");
 const { l10n } = require("devtools/client/webconsole/utils/messages");
 
 // Additional Components
 const MenuButton = createFactory(
   require("devtools/client/shared/components/menu/MenuButton")
 );
-
-loader.lazyGetter(this, "MenuItem", function() {
-  return createFactory(
-    require("devtools/client/shared/components/menu/MenuItem")
-  );
-});
-
-loader.lazyGetter(this, "MenuList", function() {
-  return createFactory(
-    require("devtools/client/shared/components/menu/MenuList")
-  );
-});
+const MenuItem = createFactory(
+  require("devtools/client/shared/components/menu/MenuItem")
+);
+const MenuList = createFactory(
+  require("devtools/client/shared/components/menu/MenuList")
+);
 
 class ConsoleSettings extends Component {
   static get propTypes() {
     return {
       dispatch: PropTypes.func.isRequired,
       groupWarnings: PropTypes.bool.isRequired,
       hidePersistLogsCheckbox: PropTypes.bool.isRequired,
       hideShowContentMessagesCheckbox: PropTypes.bool.isRequired,
@@ -135,16 +129,14 @@ class ConsoleSettings extends Component 
 
     return MenuButton(
       {
         menuId: "webconsole-console-settings-menu-button",
         toolboxDoc: toolbox ? toolbox.doc : doc,
         className: "devtools-button webconsole-console-settings-menu-button",
         title: l10n.getStr("webconsole.console.settings.menu.button.tooltip"),
       },
-      // We pass the children in a function so we don't require the MenuItem and MenuList
-      // components until we need to display them (i.e. when the button is clicked).
-      () => this.renderMenuItems()
+      this.renderMenuItems()
     );
   }
 }
 
 module.exports = ConsoleSettings;
--- a/devtools/client/webconsole/components/SideBar.js
+++ b/devtools/client/webconsole/components/SideBar.js
@@ -45,36 +45,42 @@ loader.lazyRequireGetter(
   true
 );
 
 class SideBar extends Component {
   static get propTypes() {
     return {
       serviceContainer: PropTypes.object,
       dispatch: PropTypes.func.isRequired,
+      visible: PropTypes.bool,
       grip: PropTypes.object,
       onResized: PropTypes.func,
     };
   }
 
   constructor(props) {
     super(props);
     this.onClickSidebarClose = this.onClickSidebarClose.bind(this);
   }
 
   shouldComponentUpdate(nextProps) {
-    const { grip } = nextProps;
-    return grip !== this.props.grip;
+    const { grip, visible } = nextProps;
+
+    return visible !== this.props.visible || grip !== this.props.grip;
   }
 
   onClickSidebarClose() {
     this.props.dispatch(actions.sidebarClose());
   }
 
   render() {
+    if (!this.props.visible) {
+      return null;
+    }
+
     const { grip, serviceContainer } = this.props;
 
     const objectInspector = getObjectInspector(grip, serviceContainer, {
       autoExpandDepth: 1,
       mode: reps.MODE.SHORT,
       autoFocusRoot: true,
     });