From 2ae29f5d51cfd2c484dbc6ff1520be984bb1b15f Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Thu, 16 Feb 2017 23:43:50 +0100 Subject: [PATCH] Backed out changeset ad616aa3a65e (bug 1336198) --- .../client/inspector/boxmodel/box-model.js | 10 +--- .../boxmodel/components/BoxModelApp.js | 51 ------------------- .../inspector/boxmodel/components/moz.build | 1 - .../client/inspector/computed/computed.js | 32 ------------ devtools/client/inspector/inspector.js | 6 +-- devtools/client/shared/browser-loader.js | 1 - 6 files changed, 4 insertions(+), 97 deletions(-) delete mode 100644 devtools/client/inspector/boxmodel/components/BoxModelApp.js diff --git a/devtools/client/inspector/boxmodel/box-model.js b/devtools/client/inspector/boxmodel/box-model.js index 839b608f5ca2..9edf3164c9c9 100644 --- a/devtools/client/inspector/boxmodel/box-model.js +++ b/devtools/client/inspector/boxmodel/box-model.js @@ -75,13 +75,12 @@ BoxModel.prototype = { }, /** - * Returns true if the computed or layout panel is visible, and false otherwise. + * Returns true if the layout panel is visible, and false otherwise. */ isPanelVisible() { return this.inspector.toolbox.currentToolId === "inspector" && this.inspector.sidebar && - (this.inspector.sidebar.getCurrentTabID() === "layoutview" || - this.inspector.sidebar.getCurrentTabID() === "computedview"); + this.inspector.sidebar.getCurrentTabID() === "layoutview"; }, /** @@ -168,11 +167,6 @@ BoxModel.prototype = { return; } - if (this.inspector.selection.isConnected() && - this.inspector.selection.isElementNode()) { - this.trackReflows(); - } - this.updateBoxModel(); }, diff --git a/devtools/client/inspector/boxmodel/components/BoxModelApp.js b/devtools/client/inspector/boxmodel/components/BoxModelApp.js deleted file mode 100644 index 2af27ac77c2f..000000000000 --- a/devtools/client/inspector/boxmodel/components/BoxModelApp.js +++ /dev/null @@ -1,51 +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"; - -const { addons, createClass, createFactory, PropTypes } = - require("devtools/client/shared/vendor/react"); -const { connect } = require("devtools/client/shared/vendor/react-redux"); - -const { LocalizationHelper } = require("devtools/shared/l10n"); - -const Accordion = - createFactory(require("devtools/client/inspector/layout/components/Accordion")); -const BoxModel = createFactory(require("./BoxModel")); - -const Types = require("../types"); - -const BOXMODEL_STRINGS_URI = "devtools/client/locales/boxmodel.properties"; -const BOXMODEL_L10N = new LocalizationHelper(BOXMODEL_STRINGS_URI); - -const BoxModelApp = createClass({ - - displayName: "BoxModelApp", - - propTypes: { - boxModel: PropTypes.shape(Types.boxModel).isRequired, - showBoxModelProperties: PropTypes.bool.isRequired, - onHideBoxModelHighlighter: PropTypes.func.isRequired, - onShowBoxModelEditor: PropTypes.func.isRequired, - onShowBoxModelHighlighter: PropTypes.func.isRequired, - }, - - mixins: [ addons.PureRenderMixin ], - - render() { - return Accordion({ - items: [ - { - header: BOXMODEL_L10N.getStr("boxmodel.title"), - component: BoxModel, - componentProps: this.props, - opened: true, - } - ] - }); - }, - -}); - -module.exports = connect(state => state)(BoxModelApp); diff --git a/devtools/client/inspector/boxmodel/components/moz.build b/devtools/client/inspector/boxmodel/components/moz.build index 02638ae7b291..562fd1a2cba8 100644 --- a/devtools/client/inspector/boxmodel/components/moz.build +++ b/devtools/client/inspector/boxmodel/components/moz.build @@ -6,7 +6,6 @@ DevToolsModules( 'BoxModel.js', - 'BoxModelApp.js', 'BoxModelEditable.js', 'BoxModelInfo.js', 'BoxModelMain.js', diff --git a/devtools/client/inspector/computed/computed.js b/devtools/client/inspector/computed/computed.js index 3754e5584c9c..54c543c672ad 100644 --- a/devtools/client/inspector/computed/computed.js +++ b/devtools/client/inspector/computed/computed.js @@ -28,12 +28,6 @@ const TooltipsOverlay = require("devtools/client/inspector/shared/tooltips-overl const KeyShortcuts = require("devtools/client/shared/key-shortcuts"); const clipboardHelper = require("devtools/shared/platform/clipboard"); -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 BoxModelApp = createFactory(require("devtools/client/inspector/boxmodel/components/BoxModelApp")); - const STYLE_INSPECTOR_PROPERTIES = "devtools/shared/locales/styleinspector.properties"; const {LocalizationHelper} = require("devtools/shared/l10n"); const STYLE_INSPECTOR_L10N = new LocalizationHelper(STYLE_INSPECTOR_PROPERTIES); @@ -159,7 +153,6 @@ UpdateProcess.prototype = { function CssComputedView(inspector, document, pageStyle) { this.inspector = inspector; this.highlighters = inspector.highlighters; - this.store = inspector.store; this.styleDocument = document; this.styleWindow = this.styleDocument.defaultView; this.pageStyle = pageStyle; @@ -215,7 +208,6 @@ function CssComputedView(inspector, document, pageStyle) { // The element that we're inspecting, and the document that it comes from. this._viewedElement = null; - this.createBoxModelView(); this.createStyleViews(); this._contextmenu = new StyleInspectorMenu(this, { isRuleView: false }); @@ -612,29 +604,6 @@ CssComputedView.prototype = { this.inspector.emit("computed-view-sourcelinks-updated"); }, - /** - * Render the box model view. - */ - createBoxModelView: function () { - let { - onHideBoxModelHighlighter, - onShowBoxModelEditor, - onShowBoxModelHighlighter, - } = this.inspector.boxmodel.getComponentProps(); - - let provider = createElement( - Provider, - { store: this.store }, - BoxModelApp({ - showBoxModelProperties: false, - onHideBoxModelHighlighter, - onShowBoxModelEditor, - onShowBoxModelHighlighter, - }) - ); - ReactDOM.render(provider, this.styleDocument.getElementById("boxmodel-wrapper")); - }, - /** * The CSS as displayed by the UI. */ @@ -826,7 +795,6 @@ CssComputedView.prototype = { this.inspector = null; this.highlighters = null; - this.store = null; this.styleDocument = null; this.styleWindow = null; diff --git a/devtools/client/inspector/inspector.js b/devtools/client/inspector/inspector.js index 738fc5c5f660..9f2e89b881de 100644 --- a/devtools/client/inspector/inspector.js +++ b/devtools/client/inspector/inspector.js @@ -24,6 +24,7 @@ const MenuItem = require("devtools/client/framework/menu-item"); const {HTMLBreadcrumbs} = require("devtools/client/inspector/breadcrumbs"); const BoxModel = require("devtools/client/inspector/boxmodel/box-model"); +const {ComputedViewTool} = require("devtools/client/inspector/computed/computed"); const {FontInspector} = require("devtools/client/inspector/fonts/fonts"); const {InspectorSearch} = require("devtools/client/inspector/inspector-search"); const {RuleViewTool} = require("devtools/client/inspector/rules/rules"); @@ -572,11 +573,8 @@ Inspector.prototype = { defaultTab == "computedview"); this.ruleview = new RuleViewTool(this, this.panelWin); - this.boxmodel = new BoxModel(this, this.panelWin); - - const {ComputedViewTool} = - this.browserRequire("devtools/client/inspector/computed/computed"); this.computedview = new ComputedViewTool(this, this.panelWin); + this.boxmodel = new BoxModel(this, this.panelWin); if (Services.prefs.getBoolPref("devtools.layoutview.enabled")) { const LayoutView = this.browserRequire("devtools/client/inspector/layout/layout"); diff --git a/devtools/client/shared/browser-loader.js b/devtools/client/shared/browser-loader.js index 3aef74a99bf9..e21a899044a3 100644 --- a/devtools/client/shared/browser-loader.js +++ b/devtools/client/shared/browser-loader.js @@ -13,7 +13,6 @@ const { AppConstants } = devtools.require("resource://gre/modules/AppConstants.j const BROWSER_BASED_DIRS = [ "resource://devtools/client/inspector/boxmodel", - "resource://devtools/client/inspector/computed", "resource://devtools/client/inspector/layout", "resource://devtools/client/jsonview", "resource://devtools/client/shared/vendor",