Bug 1469341 - Remove the XUL wrapper document for the Browser Console;r=nchevobbe

MozReview-Commit-ID: KCZ6u5byQuO

--HG--
extra : rebase_source : 2d1495576ca2c7a956a2327cff2f9fbc8bbb0010
This commit is contained in:
Brian Grinstead 2018-07-18 07:23:22 -07:00
Родитель 83ae44a8c1
Коммит 00d813243a
7 изменённых файлов: 6 добавлений и 41 удалений

Просмотреть файл

@ -9,7 +9,6 @@ devtools.jar:
content/shared/widgets/widgets.css (shared/widgets/widgets.css)
content/shared/widgets/VariablesView.xul (shared/widgets/VariablesView.xul)
content/webconsole/index.html (webconsole/index.html)
content/webconsole/browserconsole.xul (webconsole/browserconsole.xul)
* content/scratchpad/index.xul (scratchpad/index.xul)
content/shared/splitview.css (shared/splitview.css)
content/shared/theme-switching.js (shared/theme-switching.js)

Просмотреть файл

@ -233,9 +233,6 @@ pref("devtools.accessibility.enabled", false);
// Web Audio Editor Inspector Width should be a preference
pref("devtools.webaudioeditor.inspectorWidth", 300);
// Experimental UI for the browser console that doesn't use a XUL wrapper doc
pref("devtools.browserconsole.html", false);
// Web console filters
pref("devtools.webconsole.filter.error", true);
pref("devtools.webconsole.filter.warn", true);

Просмотреть файл

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!-- 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/. -->
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="devtools-webconsole"
macanimationtype="document"
fullscreenbutton="true"
title=""
windowtype="devtools:webconsole"
width="900" height="350"
persist="screenX screenY width height sizemode">
<link rel="localization" href="toolkit/main-window/editmenu.ftl"/>
<script type="text/javascript" src="chrome://global/content/l10n.js"></script>
<popupset></popupset>
<iframe src="index.html" flex="1"></iframe>
</window>

Просмотреть файл

@ -1475,8 +1475,7 @@ class JSTerm extends Component {
// toolbox-textbox-context-popup and friends. For now, fall
// back to use that if running inside the toolbox, but use our
// own menu when running in the Browser Console (see Bug 1476097).
if (this.props.hud.isBrowserConsole &&
Services.prefs.getBoolPref("devtools.browserconsole.html")) {
if (this.props.hud.isBrowserConsole) {
this.props.serviceContainer.openEditContextMenu(e);
}
}

Просмотреть файл

@ -175,9 +175,8 @@ HUDService.prototype = {
}
async function openWindow(t) {
const win = Services.ww.openWindow(null, Tools.webConsole.browserConsoleURL,
const win = Services.ww.openWindow(null, Tools.webConsole.url,
"_blank", BC_WINDOW_FEATURES, null);
let iframeWindow = win;
await new Promise(resolve => {
win.addEventListener("DOMContentLoaded", resolve, {once: true});
@ -185,17 +184,7 @@ HUDService.prototype = {
win.document.title = l10n.getStr("browserConsole.title");
// With a XUL wrapper doc, we host index.html in an iframe.
// Wait for that to be ready before resolving:
if (!Tools.webConsole.browserConsoleUsesHTML) {
const iframe = win.document.querySelector("iframe");
await new Promise(resolve => {
iframe.addEventListener("DOMContentLoaded", resolve, {once: true});
});
iframeWindow = iframe.contentWindow;
}
return {iframeWindow, chromeWindow: win};
return {iframeWindow: win, chromeWindow: win};
}
// Temporarily cache the async startup sequence so that if toggleBrowserConsole

Просмотреть файл

@ -11,8 +11,7 @@ const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
add_task(async function() {
// Enable net messages in the console for this test.
await pushPref("devtools.browserconsole.filter.net", true);
// These are required for testing the text input in the browser console:
await pushPref("devtools.browserconsole.html", true);
// This is required for testing the text input in the browser console:
await pushPref("devtools.chrome.enabled", true);
await addTab(TEST_URI);

Просмотреть файл

@ -27,12 +27,12 @@ add_task(async function() {
await waitFor(() => findMessage(hud, TEST_MESSAGE));
currWindow = Services.wm.getMostRecentWindow(null);
is(currWindow.document.documentURI, Tools.webConsole.browserConsoleURL,
is(currWindow.document.documentURI, Tools.webConsole.url,
"The Browser Console is open and has focus");
mainWindow.focus();
await HUDService.openBrowserConsoleOrFocus();
currWindow = Services.wm.getMostRecentWindow(null);
is(currWindow.document.documentURI, Tools.webConsole.browserConsoleURL,
is(currWindow.document.documentURI, Tools.webConsole.url,
"The Browser Console is open and has focus");
await HUDService.toggleBrowserConsole();
hud = HUDService.getBrowserConsole();