зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ad616aa3a65e (bug 1336198)
This commit is contained in:
Родитель
26271b7d8f
Коммит
2ae29f5d51
|
@ -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() {
|
isPanelVisible() {
|
||||||
return this.inspector.toolbox.currentToolId === "inspector" &&
|
return this.inspector.toolbox.currentToolId === "inspector" &&
|
||||||
this.inspector.sidebar &&
|
this.inspector.sidebar &&
|
||||||
(this.inspector.sidebar.getCurrentTabID() === "layoutview" ||
|
this.inspector.sidebar.getCurrentTabID() === "layoutview";
|
||||||
this.inspector.sidebar.getCurrentTabID() === "computedview");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,11 +167,6 @@ BoxModel.prototype = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.inspector.selection.isConnected() &&
|
|
||||||
this.inspector.selection.isElementNode()) {
|
|
||||||
this.trackReflows();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateBoxModel();
|
this.updateBoxModel();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -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);
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
DevToolsModules(
|
DevToolsModules(
|
||||||
'BoxModel.js',
|
'BoxModel.js',
|
||||||
'BoxModelApp.js',
|
|
||||||
'BoxModelEditable.js',
|
'BoxModelEditable.js',
|
||||||
'BoxModelInfo.js',
|
'BoxModelInfo.js',
|
||||||
'BoxModelMain.js',
|
'BoxModelMain.js',
|
||||||
|
|
|
@ -28,12 +28,6 @@ const TooltipsOverlay = require("devtools/client/inspector/shared/tooltips-overl
|
||||||
const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
|
const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
|
||||||
const clipboardHelper = require("devtools/shared/platform/clipboard");
|
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 STYLE_INSPECTOR_PROPERTIES = "devtools/shared/locales/styleinspector.properties";
|
||||||
const {LocalizationHelper} = require("devtools/shared/l10n");
|
const {LocalizationHelper} = require("devtools/shared/l10n");
|
||||||
const STYLE_INSPECTOR_L10N = new LocalizationHelper(STYLE_INSPECTOR_PROPERTIES);
|
const STYLE_INSPECTOR_L10N = new LocalizationHelper(STYLE_INSPECTOR_PROPERTIES);
|
||||||
|
@ -159,7 +153,6 @@ UpdateProcess.prototype = {
|
||||||
function CssComputedView(inspector, document, pageStyle) {
|
function CssComputedView(inspector, document, pageStyle) {
|
||||||
this.inspector = inspector;
|
this.inspector = inspector;
|
||||||
this.highlighters = inspector.highlighters;
|
this.highlighters = inspector.highlighters;
|
||||||
this.store = inspector.store;
|
|
||||||
this.styleDocument = document;
|
this.styleDocument = document;
|
||||||
this.styleWindow = this.styleDocument.defaultView;
|
this.styleWindow = this.styleDocument.defaultView;
|
||||||
this.pageStyle = pageStyle;
|
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.
|
// The element that we're inspecting, and the document that it comes from.
|
||||||
this._viewedElement = null;
|
this._viewedElement = null;
|
||||||
|
|
||||||
this.createBoxModelView();
|
|
||||||
this.createStyleViews();
|
this.createStyleViews();
|
||||||
|
|
||||||
this._contextmenu = new StyleInspectorMenu(this, { isRuleView: false });
|
this._contextmenu = new StyleInspectorMenu(this, { isRuleView: false });
|
||||||
|
@ -612,29 +604,6 @@ CssComputedView.prototype = {
|
||||||
this.inspector.emit("computed-view-sourcelinks-updated");
|
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.
|
* The CSS as displayed by the UI.
|
||||||
*/
|
*/
|
||||||
|
@ -826,7 +795,6 @@ CssComputedView.prototype = {
|
||||||
|
|
||||||
this.inspector = null;
|
this.inspector = null;
|
||||||
this.highlighters = null;
|
this.highlighters = null;
|
||||||
this.store = null;
|
|
||||||
this.styleDocument = null;
|
this.styleDocument = null;
|
||||||
this.styleWindow = null;
|
this.styleWindow = null;
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ const MenuItem = require("devtools/client/framework/menu-item");
|
||||||
|
|
||||||
const {HTMLBreadcrumbs} = require("devtools/client/inspector/breadcrumbs");
|
const {HTMLBreadcrumbs} = require("devtools/client/inspector/breadcrumbs");
|
||||||
const BoxModel = require("devtools/client/inspector/boxmodel/box-model");
|
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 {FontInspector} = require("devtools/client/inspector/fonts/fonts");
|
||||||
const {InspectorSearch} = require("devtools/client/inspector/inspector-search");
|
const {InspectorSearch} = require("devtools/client/inspector/inspector-search");
|
||||||
const {RuleViewTool} = require("devtools/client/inspector/rules/rules");
|
const {RuleViewTool} = require("devtools/client/inspector/rules/rules");
|
||||||
|
@ -572,11 +573,8 @@ Inspector.prototype = {
|
||||||
defaultTab == "computedview");
|
defaultTab == "computedview");
|
||||||
|
|
||||||
this.ruleview = new RuleViewTool(this, this.panelWin);
|
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.computedview = new ComputedViewTool(this, this.panelWin);
|
||||||
|
this.boxmodel = new BoxModel(this, this.panelWin);
|
||||||
|
|
||||||
if (Services.prefs.getBoolPref("devtools.layoutview.enabled")) {
|
if (Services.prefs.getBoolPref("devtools.layoutview.enabled")) {
|
||||||
const LayoutView = this.browserRequire("devtools/client/inspector/layout/layout");
|
const LayoutView = this.browserRequire("devtools/client/inspector/layout/layout");
|
||||||
|
|
|
@ -13,7 +13,6 @@ const { AppConstants } = devtools.require("resource://gre/modules/AppConstants.j
|
||||||
|
|
||||||
const BROWSER_BASED_DIRS = [
|
const BROWSER_BASED_DIRS = [
|
||||||
"resource://devtools/client/inspector/boxmodel",
|
"resource://devtools/client/inspector/boxmodel",
|
||||||
"resource://devtools/client/inspector/computed",
|
|
||||||
"resource://devtools/client/inspector/layout",
|
"resource://devtools/client/inspector/layout",
|
||||||
"resource://devtools/client/jsonview",
|
"resource://devtools/client/jsonview",
|
||||||
"resource://devtools/client/shared/vendor",
|
"resource://devtools/client/shared/vendor",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче