Backed out 4 changesets (bug 1297758) for browser_dbg_variables-view-popup-13.js failures

CLOSED TREE

Backed out changeset 95ca02cec38d (bug 1297758)
Backed out changeset 80bc957e1052 (bug 1297758)
Backed out changeset fee0da956618 (bug 1297758)
Backed out changeset 1ac36ff4b601 (bug 1297758)

--HG--
rename : devtools/client/inspector/inspector.js => devtools/client/inspector/inspector-panel.js
This commit is contained in:
Phil Ringnalda 2016-09-27 18:21:57 -07:00
parent 6f3a9050ba
commit e3f2f0fb27
20 changed files with 39 additions and 152 deletions

View File

@ -142,7 +142,7 @@ var AnimationsController = {
this.onNewNodeFront = this.onNewNodeFront.bind(this);
this.onAnimationMutations = this.onAnimationMutations.bind(this);
let target = gInspector.target;
let target = gToolbox.target;
this.animationsFront = new AnimationsFront(target.client, target.form);
// Expose actor capabilities.

View File

@ -9,7 +9,7 @@ const osString = Services.appinfo.OS;
// Panels
loader.lazyGetter(this, "OptionsPanel", () => require("devtools/client/framework/toolbox-options").OptionsPanel);
loader.lazyGetter(this, "InspectorPanel", () => require("devtools/client/inspector/panel").InspectorPanel);
loader.lazyGetter(this, "InspectorPanel", () => require("devtools/client/inspector/inspector-panel").InspectorPanel);
loader.lazyGetter(this, "WebConsolePanel", () => require("devtools/client/webconsole/panel").WebConsolePanel);
loader.lazyGetter(this, "DebuggerPanel", () => require("devtools/client/debugger/panel").DebuggerPanel);
loader.lazyGetter(this, "StyleEditorPanel", () => require("devtools/client/styleeditor/styleeditor-panel").StyleEditorPanel);

View File

@ -341,10 +341,10 @@ BoxModelView.prototype = {
*/
trackReflows: function () {
if (!this.reflowFront) {
let { target } = this.inspector;
if (target.form.reflowActor) {
this.reflowFront = ReflowFront(target.client,
target.form);
let toolbox = this.inspector.toolbox;
if (toolbox.target.form.reflowActor) {
this.reflowFront = ReflowFront(toolbox.target.client,
toolbox.target.form);
} else {
return;
}
@ -468,7 +468,7 @@ BoxModelView.prototype = {
this.inspector.sidebar.off("computedview-selected", this.onNewNode);
this.inspector.selection.off("new-node-front", this.onNewSelection);
this.inspector.sidebar.off("select", this.onSidebarSelect);
this.inspector.target.off("will-navigate", this.onWillNavigate);
this.inspector._target.off("will-navigate", this.onWillNavigate);
this.inspector.off("computed-view-filtered", this.onFilterComputedView);
this.inspector = null;
@ -792,7 +792,7 @@ BoxModelView.prototype = {
this.inspector.markup.on("node-hover", this.onMarkupViewNodeHover);
// Release the actor on will-navigate event
this.inspector.target.once("will-navigate", this.onWillNavigate);
this.inspector._target.once("will-navigate", this.onWillNavigate);
});
},

View File

@ -4,12 +4,8 @@
* 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/. */
/* global window */
"use strict";
var Cu = Components.utils;
var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Services = require("Services");
var promise = require("promise");
var defer = require("devtools/shared/defer");
@ -85,11 +81,11 @@ const PORTRAIT_MODE_WIDTH = 700;
* Fired when the stylesheet source links have been updated (when switching
* to source-mapped files)
*/
function Inspector(toolbox) {
function InspectorPanel(iframeWindow, toolbox) {
this._toolbox = toolbox;
this._target = toolbox.target;
this.panelDoc = window.document;
this.panelWin = window;
this.panelDoc = iframeWindow.document;
this.panelWin = iframeWindow;
this.panelWin.inspector = this;
this.telemetry = new Telemetry();
@ -116,11 +112,13 @@ function Inspector(toolbox) {
EventEmitter.decorate(this);
}
Inspector.prototype = {
exports.InspectorPanel = InspectorPanel;
InspectorPanel.prototype = {
/**
* open is effectively an asynchronous constructor
*/
init: Task.async(function* () {
open: Task.async(function* () {
// Localize all the nodes containing a data-localization attribute.
localizeMarkup(this.panelDoc);
@ -148,10 +146,6 @@ Inspector.prototype = {
return this._toolbox.selection;
},
get highlighter() {
return this._toolbox.highlighter;
},
get isOuterHTMLEditable() {
return this._target.client.traits.editOuterHTML;
},
@ -281,7 +275,7 @@ Inspector.prototype = {
},
_getPageStyle: function () {
return this.inspector.getPageStyle().then(pageStyle => {
return this._toolbox.inspector.getPageStyle().then(pageStyle => {
this.pageStyle = pageStyle;
}, this._handleRejectionIfNotDestroyed);
},
@ -608,7 +602,7 @@ Inspector.prototype = {
// Setup the eye-dropper icon if we're in an HTML document and we have actor support.
if (this.selection.nodeFront && this.selection.nodeFront.isInHTMLDocument) {
this.target.actorHasMethod("inspector", "pickColorFromPage").then(value => {
this.toolbox.target.actorHasMethod("inspector", "pickColorFromPage").then(value => {
if (!value) {
return;
}
@ -1822,90 +1816,3 @@ Inspector.prototype = {
}, console.error);
}
};
// URL constructor doesn't support chrome: scheme
let href = window.location.href.replace(/chrome:/, "http://");
let url = new window.URL(href);
// Only use this method to attach the toolbox if some query parameters are given
if (url.search.length > 1) {
const { targetFromURL } = require("devtools/client/framework/target-from-url");
const { attachThread } = require("devtools/client/framework/attach-thread");
const { BrowserLoader } =
Cu.import("resource://devtools/client/shared/browser-loader.js", {});
const { Selection } = require("devtools/client/framework/selection");
const { InspectorFront } = require("devtools/shared/fronts/inspector");
const { getHighlighterUtils } = require("devtools/client/framework/toolbox-highlighter-utils");
Task.spawn(function* () {
let target = yield targetFromURL(url);
let notImplemented = function () {
throw new Error("Not implemented when the inspector is in a tab");
};
let fakeToolbox = {
target,
hostType: "bottom",
doc: window.document,
win: window,
on() {}, emit() {}, off() {},
initInspector() {},
browserRequire: BrowserLoader({
window: window,
useOnlyShared: true
}).require,
get React() {
return this.browserRequire("devtools/client/shared/vendor/react");
},
get ReactDOM() {
return this.browserRequire("devtools/client/shared/vendor/react-dom");
},
isToolRegistered() {
return false;
},
currentToolId: "inspector",
getCurrentPanel() {
return "inspector";
},
get textboxContextMenuPopup() {
notImplemented();
},
getPanel: notImplemented,
openSplitConsole: notImplemented,
viewCssSourceInStyleEditor: notImplemented,
viewJsSourceInDebugger: notImplemented,
viewSource: notImplemented,
viewSourceInDebugger: notImplemented,
viewSourceInStyleEditor: notImplemented,
// For attachThread:
highlightTool() {},
unhighlightTool() {},
selectTool() {},
raise() {},
getNotificationBox() {}
};
// attachThread also expect a toolbox as argument
fakeToolbox.threadClient = yield attachThread(fakeToolbox);
let inspector = InspectorFront(target.client, target.form);
let showAllAnonymousContent =
Services.prefs.getBoolPref("devtools.inspector.showAllAnonymousContent");
let walker = yield inspector.getWalker({ showAllAnonymousContent });
let selection = new Selection(walker);
let highlighter = yield inspector.getHighlighter(false);
fakeToolbox.inspector = inspector;
fakeToolbox.walker = walker;
fakeToolbox.selection = selection;
fakeToolbox.highlighter = highlighter;
fakeToolbox.highlighterUtils = getHighlighterUtils(fakeToolbox);
let inspectorUI = new Inspector(fakeToolbox);
inspectorUI.init();
}).then(null, e => {
window.alert("Unable to start the inspector:" + e.message + "\n" + e.stack);
});
}

View File

@ -25,7 +25,6 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="application/javascript;version=1.8"
src="chrome://devtools/content/shared/theme-switching.js"></script>
<script type="application/javascript;version=1.8" src="inspector.js" defer="true"></script>
</head>
<body class="theme-body" role="application">
<div class="inspector-responsive-container theme-body inspector">

View File

@ -15,7 +15,7 @@ add_task(function* () {
assertMarkupViewIsLoaded();
yield selectNode("#one", inspector);
let willNavigate = inspector.target.once("will-navigate");
let willNavigate = inspector.toolbox.target.once("will-navigate");
yield testActor.eval(`content.location = "${URL_2}"`);
info("Waiting for will-navigate");

View File

@ -14,9 +14,9 @@ DIRS += [
DevToolsModules(
'breadcrumbs.js',
'inspector-commands.js',
'inspector-panel.js',
'inspector-search.js',
'inspector.xhtml',
'panel.js',
'toolsidebar.js',
)

View File

@ -1,19 +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";
function InspectorPanel(iframeWindow, toolbox) {
this._inspector = new iframeWindow.Inspector(toolbox);
}
InspectorPanel.prototype = {
open() {
return this._inspector.init();
},
destroy() {
return this._inspector.destroy();
}
};
exports.InspectorPanel = InspectorPanel;

View File

@ -470,7 +470,7 @@ CssRuleView.prototype = {
_onAddRule: function () {
let elementStyle = this._elementStyle;
let element = elementStyle.element;
let client = this.inspector.target.client;
let client = this.inspector.toolbox.target.client;
let pseudoClasses = element.pseudoClassLocks;
if (!client.traits.addNewRule) {

View File

@ -87,7 +87,7 @@ RuleEditor.prototype = {
get isSelectorEditable() {
let trait = this.isEditable &&
this.ruleView.inspector.target.client.traits.selectorEditable &&
this.toolbox.target.client.traits.selectorEditable &&
this.rule.domRule.type !== ELEMENT_STYLE &&
this.rule.domRule.type !== CSSRule.KEYFRAME_RULE;

View File

@ -34,7 +34,7 @@ add_task(function* () {
info("Waiting for box mode to show.");
let body = yield getNodeFront("body", inspector);
yield inspector.highlighter.showBoxModel(body);
yield toolbox.highlighter.showBoxModel(body);
info("Waiting for element picker to become active.");
yield startPicker(toolbox);

View File

@ -27,11 +27,11 @@ const ELEMENTS = ["box-model-root",
"box-model-infobar-dimensions"];
add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
let {inspector, toolbox, testActor} = yield openInspectorForURL(TEST_URL);
info("Show the box-model highlighter");
let divFront = yield getNodeFront("div", inspector);
yield inspector.highlighter.showBoxModel(divFront);
yield toolbox.highlighter.showBoxModel(divFront);
for (let id of ELEMENTS) {
let foundId = yield testActor.getHighlighterNodeAttribute(id, "id");
@ -39,5 +39,5 @@ add_task(function* () {
}
info("Hide the box-model highlighter");
yield inspector.highlighter.hideBoxModel();
yield toolbox.highlighter.hideBoxModel();
});

View File

@ -11,7 +11,7 @@
const TEST_URL = "data:text/html;charset=utf-8,<p>Select me!</p>";
add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(TEST_URL);
let {toolbox, inspector, testActor} = yield openInspectorForURL(TEST_URL);
info("hover over the <p> line in the markup-view so that it's the " +
"currently hovered node");
@ -24,7 +24,7 @@ add_task(function* () {
info("listen to the highlighter's hidden event");
let onHidden = testActor.waitForHighlighterEvent("hidden",
inspector.highlighter);
toolbox.highlighter);
info("mouse-leave the markup-view");
yield mouseLeaveMarkupView(inspector);
yield onHidden;

View File

@ -46,7 +46,7 @@ add_task(function* () {
info("Key pressed. Waiting for element to be picked");
testActor.synthesizeKey(args);
return promise.all([
inspector.selection.once("new-node-front"),
toolbox.selection.once("new-node-front"),
inspector.once("inspector-updated")
]);
}

View File

@ -185,7 +185,7 @@ const TEST_DATA = [
];
add_task(function* () {
let {inspector, testActor} = yield openInspectorForURL(
let {inspector, toolbox, testActor} = yield openInspectorForURL(
"data:text/html;charset=utf-8," + encodeURI(TEST_URL));
let divFront = yield getNodeFront("div", inspector);
@ -194,11 +194,11 @@ add_task(function* () {
info("Running test: " + desc);
info("Show the box-model highlighter with options " + options);
yield inspector.highlighter.showBoxModel(divFront, options);
yield toolbox.highlighter.showBoxModel(divFront, options);
yield checkHighlighter(testActor);
info("Hide the box-model highlighter");
yield inspector.highlighter.hideBoxModel();
yield toolbox.highlighter.hideBoxModel();
}
});

View File

@ -22,7 +22,7 @@ add_task(function* () {
info("Key pressed. Waiting for element to be picked");
testActor.synthesizeKey(msg);
return promise.all([
inspector.selection.once("new-node-front"),
toolbox.selection.once("new-node-front"),
inspector.once("inspector-updated")
]);
}

View File

@ -15,7 +15,7 @@ add_task(function* () {
let divFront = yield getNodeFront("div", inspector);
info("Waiting for highlighter to activate");
yield inspector.highlighter.showBoxModel(divFront);
yield inspector.toolbox.highlighter.showBoxModel(divFront);
let rect = yield testActor.getSimpleBorderRect();
is(rect.width, 100, "The highlighter has the right width.");
@ -31,5 +31,5 @@ add_task(function* () {
is(rect.width, 200, "The highlighter has the right width after update");
info("Waiting for highlighter to hide");
yield inspector.highlighter.hideBoxModel();
yield inspector.toolbox.highlighter.hideBoxModel();
});

View File

@ -89,8 +89,9 @@ function* testNavigate(inspector, testActor, ruleview) {
}
function* showPickerOn(selector, inspector) {
let highlighter = inspector.toolbox.highlighter;
let nodeFront = yield getNodeFront(selector, inspector);
yield inspector.highlighter.showBoxModel(nodeFront);
yield highlighter.showBoxModel(nodeFront);
}
function* assertPseudoAddedToNode(inspector, testActor, ruleview) {
@ -118,7 +119,7 @@ function* assertPseudoAddedToNode(inspector, testActor, ruleview) {
let value = yield testActor.getHighlighterNodeTextContent(
"box-model-infobar-pseudo-classes");
is(value, PSEUDO, "pseudo-class in infobar selector");
yield inspector.highlighter.hideBoxModel();
yield inspector.toolbox.highlighter.hideBoxModel();
}
function* assertPseudoRemovedFromNode(testActor) {
@ -144,5 +145,5 @@ function* assertPseudoRemovedFromView(inspector, testActor, ruleview) {
let value = yield testActor.getHighlighterNodeTextContent(
"box-model-infobar-pseudo-classes");
is(value, "", "pseudo-class removed from infobar selector");
yield inspector.highlighter.hideBoxModel();
yield inspector.toolbox.highlighter.hideBoxModel();
}

View File

@ -25,7 +25,6 @@ devtools.jar:
content/shared/frame-script-utils.js (shared/frame-script-utils.js)
content/styleeditor/styleeditor.xul (styleeditor/styleeditor.xul)
content/storage/storage.xul (storage/storage.xul)
content/inspector/inspector.js (inspector/inspector.js)
content/inspector/fonts/fonts.js (inspector/fonts/fonts.js)
content/inspector/markup/markup.xhtml (inspector/markup/markup.xhtml)
content/animationinspector/animation-controller.js (animationinspector/animation-controller.js)

View File

@ -741,7 +741,7 @@ Heritage.extend(SwatchBasedEditorTooltip.prototype, {
this.spectrum.updateUI();
}
let {target} = this.inspector;
let {target} = this.inspector.toolbox;
target.actorHasMethod("inspector", "pickColorFromPage").then(value => {
let tooltipDoc = this.tooltip.doc;
let eyeButton = tooltipDoc.querySelector("#eyedropper-button");