Bug 1470922 - Enable CodeMirror JSTerm on Nightly except for people using accessible technology; r=bgrins. draft
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Tue, 24 Jul 2018 10:48:01 +0200
changeset 823801 7c4ca7af4514e33e49e841675c3bdfb6979cf97f
parent 823800 606cd9e0953bf0cb805477fbe52b96f33e38c075
child 823802 bf5073d9372f6458f9085c5aaa9e8c8e3f8bcf5a
push id117787
push userbmo:nchevobbe@mozilla.com
push dateSat, 28 Jul 2018 15:39:52 +0000
reviewersbgrins
bugs1470922
milestone63.0a1
Bug 1470922 - Enable CodeMirror JSTerm on Nightly except for people using accessible technology; r=bgrins. MozReview-Commit-ID: 5wpd9o4w9H0
devtools/client/preferences/devtools-client.js
devtools/client/webconsole/webconsole-output-wrapper.js
--- a/devtools/client/preferences/devtools-client.js
+++ b/devtools/client/preferences/devtools-client.js
@@ -274,18 +274,22 @@ pref("devtools.webconsole.timestampMessa
 
 // Enable the webconsole sidebar toggle in Nightly builds.
 #if defined(NIGHTLY_BUILD)
 pref("devtools.webconsole.sidebarToggle", true);
 #else
 pref("devtools.webconsole.sidebarToggle", false);
 #endif
 
-// Enable CodeMirror in the JsTerm: |false|
+// Enable CodeMirror in the JsTerm in Nightly builds
+#if defined(NIGHTLY_BUILD)
+pref("devtools.webconsole.jsterm.codeMirror", true);
+#else
 pref("devtools.webconsole.jsterm.codeMirror", false);
+#endif
 
 // Disable the new performance recording panel by default
 pref("devtools.performance.new-panel-enabled", false);
 
 // Enable client-side mapping service for source maps
 pref("devtools.source-map.client-service.enabled", true);
 
 // The number of lines that are displayed in the web console.
--- a/devtools/client/webconsole/webconsole-output-wrapper.js
+++ b/devtools/client/webconsole/webconsole-output-wrapper.js
@@ -1,13 +1,14 @@
 /* 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";
 
+const Services = require("Services");
 const { createElement, createFactory } = require("devtools/client/shared/vendor/react");
 const ReactDOM = require("devtools/client/shared/vendor/react-dom");
 const { Provider } = require("devtools/client/shared/vendor/react-redux");
 
 const actions = require("devtools/client/webconsole/actions/index");
 const { createContextMenu, createEditContextMenu } = require("devtools/client/webconsole/utils/context-menu");
 const { configureStore } = require("devtools/client/webconsole/store");
 const { isPacketPrivate } = require("devtools/client/webconsole/utils/messages");
@@ -240,17 +241,18 @@ WebConsoleOutputWrapper.prototype = {
       }
 
       const app = App({
         attachRefToHud,
         serviceContainer,
         hud,
         onFirstMeaningfulPaint: resolve,
         closeSplitConsole: this.closeSplitConsole.bind(this),
-        jstermCodeMirror: store.getState().prefs.jstermCodeMirror,
+        jstermCodeMirror: store.getState().prefs.jstermCodeMirror
+          && !Services.appinfo.accessibilityEnabled,
       });
 
       // Render the root Application component.
       const provider = createElement(Provider, { store }, app);
       this.body = ReactDOM.render(provider, this.parentNode);
     });
   },