forked from mirrors/gecko-dev
		
	Bug 1355747 - Disable and remove layout panel promotion code in release 58. r=jdescottes
				
					
				
			This commit is contained in:
		
							parent
							
								
									5e34d765c7
								
							
						
					
					
						commit
						1227230888
					
				
					 10 changed files with 1 additions and 179 deletions
				
			
		|  | @ -54,7 +54,7 @@ FontInspector.prototype = { | ||||||
|       id: "fontinspector", |       id: "fontinspector", | ||||||
|       key: "fontinspector", |       key: "fontinspector", | ||||||
|       store: this.store, |       store: this.store, | ||||||
|       title: INSPECTOR_L10N.getStr("inspector.sidebar.fontInspectorTitle") |       title: INSPECTOR_L10N.getStr("inspector.sidebar.fontInspectorTitle"), | ||||||
|     }, app); |     }, app); | ||||||
| 
 | 
 | ||||||
|     // Expose the provider to let inspector.js use it in setupSidebar.
 |     // Expose the provider to let inspector.js use it in setupSidebar.
 | ||||||
|  |  | ||||||
|  | @ -27,8 +27,6 @@ const CSS_GRID_COUNT_HISTOGRAM_ID = "DEVTOOLS_NUMBER_OF_CSS_GRIDS_IN_A_PAGE"; | ||||||
| const SHOW_GRID_AREAS = "devtools.gridinspector.showGridAreas"; | const SHOW_GRID_AREAS = "devtools.gridinspector.showGridAreas"; | ||||||
| const SHOW_GRID_LINE_NUMBERS = "devtools.gridinspector.showGridLineNumbers"; | const SHOW_GRID_LINE_NUMBERS = "devtools.gridinspector.showGridLineNumbers"; | ||||||
| const SHOW_INFINITE_LINES_PREF = "devtools.gridinspector.showInfiniteLines"; | const SHOW_INFINITE_LINES_PREF = "devtools.gridinspector.showInfiniteLines"; | ||||||
| // @remove after release 56 (See Bug 1355747)
 |  | ||||||
| const PROMOTE_COUNT_PREF = "devtools.promote.layoutview"; |  | ||||||
| 
 | 
 | ||||||
| // Default grid colors.
 | // Default grid colors.
 | ||||||
| const GRID_COLORS = [ | const GRID_COLORS = [ | ||||||
|  | @ -569,9 +567,6 @@ GridInspector.prototype = { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // @remove after release 56 (See Bug 1355747)
 |  | ||||||
|     Services.prefs.setIntPref(PROMOTE_COUNT_PREF, 0); |  | ||||||
| 
 |  | ||||||
|     this.inspector.reflowTracker.trackReflows(this, this.onReflow); |     this.inspector.reflowTracker.trackReflows(this, this.onReflow); | ||||||
|     this.updateGridPanel(); |     this.updateGridPanel(); | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|  | @ -16,10 +16,8 @@ Services.scriptloader.loadSubScript( | ||||||
|   "chrome://mochitests/content/browser/devtools/client/framework/test/shared-redux-head.js", |   "chrome://mochitests/content/browser/devtools/client/framework/test/shared-redux-head.js", | ||||||
|   this); |   this); | ||||||
| 
 | 
 | ||||||
| Services.prefs.setBoolPref("devtools.promote.layoutview.showPromoteBar", false); |  | ||||||
| Services.prefs.setIntPref("devtools.toolbox.footer.height", 350); | Services.prefs.setIntPref("devtools.toolbox.footer.height", 350); | ||||||
| registerCleanupFunction(() => { | registerCleanupFunction(() => { | ||||||
|   Services.prefs.clearUserPref("devtools.promote.layoutview.showPromoteBar"); |  | ||||||
|   Services.prefs.clearUserPref("devtools.toolbox.footer.height"); |   Services.prefs.clearUserPref("devtools.toolbox.footer.height"); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -18,7 +18,6 @@ const BoxModelTypes = require("devtools/client/inspector/boxmodel/types"); | ||||||
| const GridTypes = require("devtools/client/inspector/grids/types"); | const GridTypes = require("devtools/client/inspector/grids/types"); | ||||||
| 
 | 
 | ||||||
| const Accordion = createFactory(require("./Accordion")); | const Accordion = createFactory(require("./Accordion")); | ||||||
| const LayoutPromoteBar = createFactory(require("./LayoutPromoteBar")); |  | ||||||
| 
 | 
 | ||||||
| const BOXMODEL_STRINGS_URI = "devtools/client/locales/boxmodel.properties"; | const BOXMODEL_STRINGS_URI = "devtools/client/locales/boxmodel.properties"; | ||||||
| const BOXMODEL_L10N = new LocalizationHelper(BOXMODEL_STRINGS_URI); | const BOXMODEL_L10N = new LocalizationHelper(BOXMODEL_STRINGS_URI); | ||||||
|  | @ -41,7 +40,6 @@ const App = createClass({ | ||||||
|     setSelectedNode: PropTypes.func.isRequired, |     setSelectedNode: PropTypes.func.isRequired, | ||||||
|     showBoxModelProperties: PropTypes.bool.isRequired, |     showBoxModelProperties: PropTypes.bool.isRequired, | ||||||
|     onHideBoxModelHighlighter: PropTypes.func.isRequired, |     onHideBoxModelHighlighter: PropTypes.func.isRequired, | ||||||
|     onPromoteLearnMoreClick: PropTypes.func.isRequired, |  | ||||||
|     onSetGridOverlayColor: PropTypes.func.isRequired, |     onSetGridOverlayColor: PropTypes.func.isRequired, | ||||||
|     onShowBoxModelEditor: PropTypes.func.isRequired, |     onShowBoxModelEditor: PropTypes.func.isRequired, | ||||||
|     onShowBoxModelHighlighter: PropTypes.func.isRequired, |     onShowBoxModelHighlighter: PropTypes.func.isRequired, | ||||||
|  | @ -54,15 +52,10 @@ const App = createClass({ | ||||||
|   mixins: [ addons.PureRenderMixin ], |   mixins: [ addons.PureRenderMixin ], | ||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     let { onPromoteLearnMoreClick } = this.props; |  | ||||||
| 
 |  | ||||||
|     return dom.div( |     return dom.div( | ||||||
|       { |       { | ||||||
|         id: "layout-container", |         id: "layout-container", | ||||||
|       }, |       }, | ||||||
|       LayoutPromoteBar({ |  | ||||||
|         onPromoteLearnMoreClick, |  | ||||||
|       }), |  | ||||||
|       Accordion({ |       Accordion({ | ||||||
|         items: [ |         items: [ | ||||||
|           { |           { | ||||||
|  |  | ||||||
|  | @ -1,76 +0,0 @@ | ||||||
| /* 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"; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * !!!!                      TO BE REMOVED AFTER RELEASE 56                          !!!! |  | ||||||
|  * !!!!                                                                              !!!! |  | ||||||
|  * !!!! This file is a temporary panel that should only be used for release 56 to    !!!! |  | ||||||
|  * !!!! promote the new layout panel. After release 56, it should be removed.        !!!! |  | ||||||
|  * !!!! See bug 1355747.                                                             !!!! |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| const Services = require("Services"); |  | ||||||
| const { addons, createClass, DOM: dom, PropTypes } = |  | ||||||
|   require("devtools/client/shared/vendor/react"); |  | ||||||
| 
 |  | ||||||
| const { LocalizationHelper } = require("devtools/shared/l10n"); |  | ||||||
| 
 |  | ||||||
| const LAYOUT_STRINGS_URI = "devtools/client/locales/layout.properties"; |  | ||||||
| const LAYOUT_L10N = new LocalizationHelper(LAYOUT_STRINGS_URI); |  | ||||||
| 
 |  | ||||||
| const SHOW_PROMOTE_BAR_PREF = "devtools.promote.layoutview.showPromoteBar"; |  | ||||||
| 
 |  | ||||||
| module.exports = createClass({ |  | ||||||
| 
 |  | ||||||
|   displayName: "LayoutPromoteBar", |  | ||||||
| 
 |  | ||||||
|   propTypes: { |  | ||||||
|     onPromoteLearnMoreClick: PropTypes.func.isRequired, |  | ||||||
|   }, |  | ||||||
| 
 |  | ||||||
|   mixins: [ addons.PureRenderMixin ], |  | ||||||
| 
 |  | ||||||
|   getInitialState() { |  | ||||||
|     return { |  | ||||||
|       showPromoteBar: Services.prefs.getBoolPref(SHOW_PROMOTE_BAR_PREF) |  | ||||||
|     }; |  | ||||||
|   }, |  | ||||||
| 
 |  | ||||||
|   onPromoteCloseButtonClick() { |  | ||||||
|     Services.prefs.setBoolPref(SHOW_PROMOTE_BAR_PREF, false); |  | ||||||
|     this.setState({ showPromoteBar: false }); |  | ||||||
|   }, |  | ||||||
| 
 |  | ||||||
|   render() { |  | ||||||
|     let { onPromoteLearnMoreClick } = this.props; |  | ||||||
|     let { showPromoteBar } = this.state; |  | ||||||
| 
 |  | ||||||
|     return showPromoteBar ? |  | ||||||
|       dom.div({ className: "layout-promote-bar" }, |  | ||||||
|         dom.span({ className: "layout-promote-info-icon" }), |  | ||||||
|         dom.div({ className: "layout-promote-message" }, |  | ||||||
|           LAYOUT_L10N.getStr("layout.promoteMessage"), |  | ||||||
|           dom.a( |  | ||||||
|             { |  | ||||||
|               className: "layout-promote-learn-more-link theme-link", |  | ||||||
|               href: "#", |  | ||||||
|               onClick: onPromoteLearnMoreClick, |  | ||||||
|             }, |  | ||||||
|             LAYOUT_L10N.getStr("layout.learnMore") |  | ||||||
|           ) |  | ||||||
|         ), |  | ||||||
|         dom.button( |  | ||||||
|           { |  | ||||||
|             className: "layout-promote-close-button devtools-button", |  | ||||||
|             onClick: this.onPromoteCloseButtonClick, |  | ||||||
|           } |  | ||||||
|         ) |  | ||||||
|       ) |  | ||||||
|       : |  | ||||||
|       null; |  | ||||||
|   }, |  | ||||||
| 
 |  | ||||||
| }); |  | ||||||
|  | @ -8,5 +8,4 @@ DevToolsModules( | ||||||
|     'Accordion.css', |     'Accordion.css', | ||||||
|     'Accordion.js', |     'Accordion.js', | ||||||
|     'App.js', |     'App.js', | ||||||
|     'LayoutPromoteBar.js', |  | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  | @ -15,12 +15,6 @@ const { LocalizationHelper } = require("devtools/shared/l10n"); | ||||||
| const INSPECTOR_L10N = | const INSPECTOR_L10N = | ||||||
|   new LocalizationHelper("devtools/client/locales/inspector.properties"); |   new LocalizationHelper("devtools/client/locales/inspector.properties"); | ||||||
| 
 | 
 | ||||||
| // @remove after release 56 (See Bug 1355747)
 |  | ||||||
| const PROMOTE_COUNT_PREF = "devtools.promote.layoutview"; |  | ||||||
| 
 |  | ||||||
| // @remove after release 56 (See Bug 1355747)
 |  | ||||||
| const GRID_LINK = "https://www.mozilla.org/en-US/developer/css-grid/?utm_source=gridtooltip&utm_medium=devtools&utm_campaign=cssgrid_layout"; |  | ||||||
| 
 |  | ||||||
| loader.lazyRequireGetter(this, "GridInspector", "devtools/client/inspector/grids/grid-inspector"); | loader.lazyRequireGetter(this, "GridInspector", "devtools/client/inspector/grids/grid-inspector"); | ||||||
| 
 | 
 | ||||||
| function LayoutView(inspector, window) { | function LayoutView(inspector, window) { | ||||||
|  | @ -28,8 +22,6 @@ function LayoutView(inspector, window) { | ||||||
|   this.inspector = inspector; |   this.inspector = inspector; | ||||||
|   this.store = inspector.store; |   this.store = inspector.store; | ||||||
| 
 | 
 | ||||||
|   this.onPromoteLearnMoreClick = this.onPromoteLearnMoreClick.bind(this); |  | ||||||
| 
 |  | ||||||
|   this.init(); |   this.init(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -65,10 +57,6 @@ LayoutView.prototype = { | ||||||
|       onToggleShowInfiniteLines, |       onToggleShowInfiniteLines, | ||||||
|     } = this.gridInspector.getComponentProps(); |     } = this.gridInspector.getComponentProps(); | ||||||
| 
 | 
 | ||||||
|     let { |  | ||||||
|       onPromoteLearnMoreClick, |  | ||||||
|     } = this; |  | ||||||
| 
 |  | ||||||
|     let app = App({ |     let app = App({ | ||||||
|       getSwatchColorPickerTooltip, |       getSwatchColorPickerTooltip, | ||||||
|       setSelectedNode, |       setSelectedNode, | ||||||
|  | @ -78,7 +66,6 @@ LayoutView.prototype = { | ||||||
|        */ |        */ | ||||||
|       showBoxModelProperties: true, |       showBoxModelProperties: true, | ||||||
|       onHideBoxModelHighlighter, |       onHideBoxModelHighlighter, | ||||||
|       onPromoteLearnMoreClick, |  | ||||||
|       onSetGridOverlayColor, |       onSetGridOverlayColor, | ||||||
|       onShowBoxModelEditor, |       onShowBoxModelEditor, | ||||||
|       onShowBoxModelHighlighter, |       onShowBoxModelHighlighter, | ||||||
|  | @ -98,10 +85,6 @@ LayoutView.prototype = { | ||||||
|       key: "layoutview", |       key: "layoutview", | ||||||
|       store: this.store, |       store: this.store, | ||||||
|       title: INSPECTOR_L10N.getStr("inspector.sidebar.layoutViewTitle2"), |       title: INSPECTOR_L10N.getStr("inspector.sidebar.layoutViewTitle2"), | ||||||
|       // @remove after release 56 (See Bug 1355747)
 |  | ||||||
|       badge: Services.prefs.getIntPref(PROMOTE_COUNT_PREF) > 0 ? |  | ||||||
|         INSPECTOR_L10N.getStr("inspector.sidebar.newBadge") : null, |  | ||||||
|       showBadge: () => Services.prefs.getIntPref(PROMOTE_COUNT_PREF) > 0, |  | ||||||
|     }, app); |     }, app); | ||||||
| 
 | 
 | ||||||
|     // Expose the provider to let inspector.js use it in setupSidebar.
 |     // Expose the provider to let inspector.js use it in setupSidebar.
 | ||||||
|  | @ -119,11 +102,6 @@ LayoutView.prototype = { | ||||||
|     this.store = null; |     this.store = null; | ||||||
|   }, |   }, | ||||||
| 
 | 
 | ||||||
|   onPromoteLearnMoreClick() { |  | ||||||
|     let browserWin = this.inspector.target.tab.ownerDocument.defaultView; |  | ||||||
|     browserWin.openUILinkIn(GRID_LINK, "current"); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| module.exports = LayoutView; | module.exports = LayoutView; | ||||||
|  |  | ||||||
|  | @ -44,11 +44,3 @@ layout.overlayGrid=Overlay Grid | ||||||
| # LOCALIZATION NOTE (layout.rowColumnPositions): The row and column position of a grid | # LOCALIZATION NOTE (layout.rowColumnPositions): The row and column position of a grid | ||||||
| # cell shown in the grid cell infobar when hovering over the CSS grid outline. | # cell shown in the grid cell infobar when hovering over the CSS grid outline. | ||||||
| layout.rowColumnPositions=Row %S / Column %S | layout.rowColumnPositions=Row %S / Column %S | ||||||
| 
 |  | ||||||
| # LOCALIZATION NOTE (layout.promoteMessage): Text displayed in the promote bar for the |  | ||||||
| # layout panel. |  | ||||||
| layout.promoteMessage=Explore CSS Grids with the latest CSS Grid Inspector. |  | ||||||
| 
 |  | ||||||
| # LOCALIZATION NOTE (layout.learnMore): Text for the link displayed in the promote bar |  | ||||||
| # for the layout panel. |  | ||||||
| layout.learnMore=Learn more… |  | ||||||
|  |  | ||||||
|  | @ -61,13 +61,6 @@ pref("devtools.inspector.colorWidget.enabled", false); | ||||||
| // Enable the CSS shapes highlighter
 | // Enable the CSS shapes highlighter
 | ||||||
| pref("devtools.inspector.shapesHighlighter.enabled", true); | pref("devtools.inspector.shapesHighlighter.enabled", true); | ||||||
| 
 | 
 | ||||||
| // Counter to promote the inspector layout view.
 |  | ||||||
| // @remove after release 56 (See Bug 1355747)
 |  | ||||||
| pref("devtools.promote.layoutview", 1); |  | ||||||
| // Whether or not to show the promote bar in the layout view
 |  | ||||||
| // @remove after release 56 (See Bug 1355747)
 |  | ||||||
| pref("devtools.promote.layoutview.showPromoteBar", true); |  | ||||||
| 
 |  | ||||||
| // Grid highlighter preferences
 | // Grid highlighter preferences
 | ||||||
| pref("devtools.gridinspector.gridOutlineMaxColumns", 50); | pref("devtools.gridinspector.gridOutlineMaxColumns", 50); | ||||||
| pref("devtools.gridinspector.gridOutlineMaxRows", 50); | pref("devtools.gridinspector.gridOutlineMaxRows", 50); | ||||||
|  |  | ||||||
|  | @ -48,56 +48,6 @@ | ||||||
|   align-items: center; |   align-items: center; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /** |  | ||||||
|  * Layout Promote Bar |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| .layout-promote-bar { |  | ||||||
|   align-items: center; |  | ||||||
|   background-color: var(--theme-toolbar-background); |  | ||||||
|   border-bottom: 1px solid var(--theme-splitter-color); |  | ||||||
|   display: flex; |  | ||||||
|   font-size: 11px; |  | ||||||
|   padding: 5px; |  | ||||||
|   transition: all 0.25s ease; |  | ||||||
|   width: 100%; |  | ||||||
|   -moz-user-select: none; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| .layout-promote-bar:hover { |  | ||||||
|   background-color: var(--theme-toolbar-hover); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| .layout-promote-info-icon { |  | ||||||
|   display: inline-block; |  | ||||||
|   background-size: 16px; |  | ||||||
|   width: 16px; |  | ||||||
|   height: 16px; |  | ||||||
|   margin: 6px; |  | ||||||
|   background-image: url("chrome://browser/skin/info.svg"); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| .layout-promote-message { |  | ||||||
|   flex: 1; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| .layout-promote-learn-more-link { |  | ||||||
|   margin-inline-start: 5px; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| .layout-promote-learn-more-link:hover { |  | ||||||
|   text-decoration: underline; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| .layout-promote-close-button { |  | ||||||
|   margin: 6px; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| .layout-promote-close-button::before { |  | ||||||
|   background-image: url("chrome://devtools/skin/images/close.svg"); |  | ||||||
|   margin: -6px 0 0 -6px; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| /** | /** | ||||||
|  * Grid Container |  * Grid Container | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Gabriel Luong
						Gabriel Luong