Bug 1471914 - Check that the font editor pref is on before rendering it. r=pbro a=lizzard
authorRazvan Caliman <rcaliman@mozilla.com>
Thu, 28 Jun 2018 17:16:54 +0200
changeset 477827 eb0b435eba5b60040f7273d55acd29d7ee1fc3f5
parent 477826 3f625b66a12352ac79d4b43bd057c8abacc436f0
child 477828 3da147dac512da9368fbe9179c5ad72dc8c759e4
push id9441
push userarchaeopteryx@coole-files.de
push dateFri, 06 Jul 2018 15:09:28 +0000
treeherdermozilla-beta@3a7a791ef4ff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro, lizzard
bugs1471914
milestone62.0
Bug 1471914 - Check that the font editor pref is on before rendering it. r=pbro a=lizzard MozReview-Commit-ID: C0uQkZCJ2Ck
devtools/client/inspector/fonts/components/FontsApp.js
devtools/client/inspector/fonts/fonts.js
--- a/devtools/client/inspector/fonts/components/FontsApp.js
+++ b/devtools/client/inspector/fonts/components/FontsApp.js
@@ -14,41 +14,43 @@ const FontOverview = createFactory(requi
 
 const Types = require("../types");
 
 class FontsApp extends PureComponent {
   static get propTypes() {
     return {
       fontData: PropTypes.shape(Types.fontData).isRequired,
       fontEditor: PropTypes.shape(Types.fontEditor).isRequired,
+      fontEditorEnabled: PropTypes.bool.isRequired,
       fontOptions: PropTypes.shape(Types.fontOptions).isRequired,
       onInstanceChange: PropTypes.func.isRequired,
       onPreviewFonts: PropTypes.func.isRequired,
       onPropertyChange: PropTypes.func.isRequired,
       onToggleFontHighlight: PropTypes.func.isRequired,
     };
   }
 
   render() {
     const {
       fontData,
       fontEditor,
+      fontEditorEnabled,
       fontOptions,
       onInstanceChange,
       onPreviewFonts,
       onPropertyChange,
       onToggleFontHighlight,
     } = this.props;
 
     return dom.div(
       {
         className: "theme-sidebar inspector-tabpanel",
         id: "sidebar-panel-fontinspector"
       },
-      FontEditor({
+      fontEditorEnabled && FontEditor({
         fontEditor,
         onInstanceChange,
         onPropertyChange,
         onToggleFontHighlight,
       }),
       FontOverview({
         fontData,
         fontOptions,
--- a/devtools/client/inspector/fonts/fonts.js
+++ b/devtools/client/inspector/fonts/fonts.js
@@ -84,16 +84,17 @@ class FontInspector {
   }
 
   init() {
     if (!this.inspector) {
       return;
     }
 
     const fontsApp = FontsApp({
+      fontEditorEnabled: Services.prefs.getBoolPref(PREF_FONT_EDITOR),
       onInstanceChange: this.onInstanceChange,
       onToggleFontHighlight: this.onToggleFontHighlight,
       onPreviewFonts: this.onPreviewFonts,
       onPropertyChange: this.onPropertyChange,
     });
 
     const provider = createElement(Provider, {
       id: "fontinspector",