mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
merge m-c to fx-team
This commit is contained in:
commit
3a7cf943aa
@ -1109,9 +1109,6 @@ pref("devtools.gcli.hideIntro", false);
|
||||
// How eager are we to show help: never=1, sometimes=2, always=3
|
||||
pref("devtools.gcli.eagerHelper", 2);
|
||||
|
||||
// Do we allow the 'pref set' command
|
||||
pref("devtools.gcli.allowSet", false);
|
||||
|
||||
// Remember the Web Console filters
|
||||
pref("devtools.webconsole.filter.network", true);
|
||||
pref("devtools.webconsole.filter.networkinfo", true);
|
||||
|
@ -9,7 +9,7 @@ const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
const DBG_XUL = "chrome://browser/content/debugger.xul";
|
||||
const DBG_XUL = "chrome://browser/content/devtools/debugger.xul";
|
||||
const DBG_STRINGS_URI = "chrome://browser/locale/devtools/debugger.properties";
|
||||
const CHROME_DEBUGGER_PROFILE_NAME = "-chrome-debugger";
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/devtools/widgets.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/debugger.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/devtools/debugger.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/common.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/widgets.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/debugger.css" type="text/css"?>
|
||||
@ -13,7 +13,7 @@
|
||||
%debuggerDTD;
|
||||
]>
|
||||
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://browser/content/source-editor-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://browser/content/devtools/source-editor-overlay.xul"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="text/javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
|
@ -61,6 +61,7 @@ MOCHITEST_BROWSER_TESTS = \
|
||||
browser_dbg_location-changes.js \
|
||||
browser_dbg_location-changes-new.js \
|
||||
browser_dbg_location-changes-blank.js \
|
||||
browser_dbg_location-changes-bp.js \
|
||||
browser_dbg_sources-cache.js \
|
||||
browser_dbg_scripts-switching.js \
|
||||
browser_dbg_scripts-sorting.js \
|
||||
@ -133,6 +134,8 @@ MOCHITEST_BROWSER_PAGES = \
|
||||
binary_search.coffee \
|
||||
binary_search.js \
|
||||
binary_search.map \
|
||||
test-location-changes-bp.js \
|
||||
test-location-changes-bp.html \
|
||||
$(NULL)
|
||||
|
||||
MOCHITEST_BROWSER_FILES_PARTS = MOCHITEST_BROWSER_TESTS MOCHITEST_BROWSER_PAGES
|
||||
|
@ -0,0 +1,163 @@
|
||||
/* vim:set ts=2 sw=2 sts=2 et: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/**
|
||||
* Make sure that reloading a page with a breakpoint set does not cause it to
|
||||
* fire more than once.
|
||||
*/
|
||||
|
||||
const TAB_URL = EXAMPLE_URL + "test-location-changes-bp.html";
|
||||
const SCRIPT_URL = EXAMPLE_URL + "test-location-changes-bp.js";
|
||||
|
||||
var gPane = null;
|
||||
var gTab = null;
|
||||
var gDebuggee = null;
|
||||
var gDebugger = null;
|
||||
var sourcesShown = false;
|
||||
var tabNavigated = false;
|
||||
|
||||
function test()
|
||||
{
|
||||
debug_tab_pane(TAB_URL, function(aTab, aDebuggee, aPane) {
|
||||
gTab = aTab;
|
||||
gDebuggee = aDebuggee;
|
||||
gPane = aPane;
|
||||
gDebugger = gPane.panelWin;
|
||||
|
||||
testAddBreakpoint();
|
||||
});
|
||||
}
|
||||
|
||||
function testAddBreakpoint()
|
||||
{
|
||||
let controller = gDebugger.DebuggerController;
|
||||
controller.activeThread.addOneTimeListener("framesadded", function() {
|
||||
Services.tm.currentThread.dispatch({ run: function() {
|
||||
|
||||
var frames = gDebugger.DebuggerView.StackFrames._container._list;
|
||||
|
||||
is(controller.activeThread.state, "paused",
|
||||
"The debugger statement was reached.");
|
||||
|
||||
is(frames.querySelectorAll(".dbg-stackframe").length, 1,
|
||||
"Should have one frame.");
|
||||
|
||||
gPane.addBreakpoint({ url: SCRIPT_URL, line: 5 }, testResume);
|
||||
}}, 0);
|
||||
});
|
||||
|
||||
gDebuggee.runDebuggerStatement();
|
||||
}
|
||||
|
||||
function testResume()
|
||||
{
|
||||
is(gDebugger.DebuggerController.activeThread.state, "paused",
|
||||
"The breakpoint wasn't hit yet.");
|
||||
|
||||
let thread = gDebugger.DebuggerController.activeThread;
|
||||
thread.addOneTimeListener("resumed", function() {
|
||||
thread.addOneTimeListener("paused", function() {
|
||||
executeSoon(testBreakpointHit);
|
||||
});
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
content.document.querySelector("button"));
|
||||
});
|
||||
|
||||
thread.resume();
|
||||
}
|
||||
|
||||
function testBreakpointHit()
|
||||
{
|
||||
is(gDebugger.DebuggerController.activeThread.state, "paused",
|
||||
"The breakpoint was hit.");
|
||||
|
||||
let thread = gDebugger.DebuggerController.activeThread;
|
||||
thread.addOneTimeListener("paused", function test(aEvent, aPacket) {
|
||||
thread.addOneTimeListener("resumed", function() {
|
||||
executeSoon(testReloadPage);
|
||||
});
|
||||
|
||||
is(aPacket.why.type, "debuggerStatement", "Execution has advanced to the next line.");
|
||||
isnot(aPacket.why.type, "breakpoint", "No ghost breakpoint was hit.");
|
||||
thread.resume();
|
||||
});
|
||||
|
||||
thread.resume();
|
||||
}
|
||||
|
||||
function testReloadPage()
|
||||
{
|
||||
let controller = gDebugger.DebuggerController;
|
||||
controller._target.once("navigate", function onTabNavigated(aEvent, aPacket) {
|
||||
tabNavigated = true;
|
||||
ok(true, "tabNavigated event was fired.");
|
||||
info("Still attached to the tab.");
|
||||
clickAgain();
|
||||
});
|
||||
|
||||
gDebugger.addEventListener("Debugger:SourceShown", function onSourcesShown() {
|
||||
sourcesShown = true;
|
||||
gDebugger.removeEventListener("Debugger:SourceShown", onSourcesShown);
|
||||
clickAgain();
|
||||
});
|
||||
|
||||
content.location.reload();
|
||||
}
|
||||
|
||||
function clickAgain()
|
||||
{
|
||||
if (!sourcesShown || !tabNavigated) {
|
||||
return;
|
||||
}
|
||||
|
||||
let controller = gDebugger.DebuggerController;
|
||||
controller.activeThread.addOneTimeListener("framesadded", function() {
|
||||
is(gDebugger.DebuggerController.activeThread.state, "paused",
|
||||
"The breakpoint was hit.");
|
||||
|
||||
let thread = gDebugger.DebuggerController.activeThread;
|
||||
thread.addOneTimeListener("paused", function test(aEvent, aPacket) {
|
||||
thread.addOneTimeListener("resumed", function() {
|
||||
executeSoon(closeDebuggerAndFinish);
|
||||
});
|
||||
|
||||
is(aPacket.why.type, "debuggerStatement", "Execution has advanced to the next line.");
|
||||
isnot(aPacket.why.type, "breakpoint", "No ghost breakpoint was hit.");
|
||||
thread.resume();
|
||||
});
|
||||
|
||||
thread.resume();
|
||||
});
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
content.document.querySelector("button"));
|
||||
}
|
||||
|
||||
function testBreakpointHitAfterReload()
|
||||
{
|
||||
is(gDebugger.DebuggerController.activeThread.state, "paused",
|
||||
"The breakpoint was hit.");
|
||||
|
||||
let thread = gDebugger.DebuggerController.activeThread;
|
||||
thread.addOneTimeListener("paused", function test(aEvent, aPacket) {
|
||||
thread.addOneTimeListener("resumed", function() {
|
||||
executeSoon(closeDebuggerAndFinish);
|
||||
});
|
||||
|
||||
is(aPacket.why.type, "debuggerStatement", "Execution has advanced to the next line.");
|
||||
isnot(aPacket.why.type, "breakpoint", "No ghost breakpoint was hit.");
|
||||
thread.resume();
|
||||
});
|
||||
|
||||
thread.resume();
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
removeTab(gTab);
|
||||
gPane = null;
|
||||
gTab = null;
|
||||
gDebuggee = null;
|
||||
gDebugger = null;
|
||||
});
|
17
browser/devtools/debugger/test/test-location-changes-bp.html
Normal file
17
browser/devtools/debugger/test/test-location-changes-bp.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'/>
|
||||
<script type="text/javascript" src="test-location-changes-bp.js"></script>
|
||||
<script type="text/javascript">
|
||||
function runDebuggerStatement() {
|
||||
debugger;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<button type="button" onclick="myFunction()">Run</button>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function myFunction() {
|
||||
var a = 1;
|
||||
debugger;
|
||||
}
|
@ -192,6 +192,7 @@ this.devtools = {
|
||||
};
|
||||
|
||||
const FORBIDDEN_IDS = new Set(["toolbox", ""]);
|
||||
const MAX_ORDINAL = 99;
|
||||
|
||||
/**
|
||||
* DevTools is a class that represents a set of developer tools, it holds a
|
||||
@ -274,8 +275,17 @@ DevTools.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sorting function used for sorting tools based on their ordinals.
|
||||
*/
|
||||
ordinalSort: function DT_ordinalSort(d1, d2) {
|
||||
let o1 = (typeof d1.ordinal == "number") ? d1.ordinal : MAX_ORDINAL;
|
||||
let o2 = (typeof d2.ordinal == "number") ? d2.ordinal : MAX_ORDINAL;
|
||||
return o1 - o2;
|
||||
},
|
||||
|
||||
getDefaultTools: function DT_getDefaultTools() {
|
||||
return devtools.defaultTools;
|
||||
return devtools.defaultTools.sort(this.ordinalSort);
|
||||
},
|
||||
|
||||
getAdditionalTools: function DT_getAdditionalTools() {
|
||||
@ -285,7 +295,7 @@ DevTools.prototype = {
|
||||
tools.push(value);
|
||||
}
|
||||
}
|
||||
return tools;
|
||||
return tools.sort(this.ordinalSort);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -327,20 +337,12 @@ DevTools.prototype = {
|
||||
* A sorted array of the tool definitions registered in this instance
|
||||
*/
|
||||
getToolDefinitionArray: function DT_getToolDefinitionArray() {
|
||||
const MAX_ORDINAL = 99;
|
||||
|
||||
let definitions = [];
|
||||
for (let [id, definition] of this.getToolDefinitionMap()) {
|
||||
definitions.push(definition);
|
||||
}
|
||||
|
||||
definitions.sort(function(d1, d2) {
|
||||
let o1 = (typeof d1.ordinal == "number") ? d1.ordinal : MAX_ORDINAL;
|
||||
let o2 = (typeof d2.ordinal == "number") ? d2.ordinal : MAX_ORDINAL;
|
||||
return o1 - o2;
|
||||
});
|
||||
|
||||
return definitions;
|
||||
return definitions.sort(this.ordinalSort);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -86,6 +86,10 @@ function checkTools() {
|
||||
for (let tool of toolsPref) {
|
||||
prefNodes.push(tool);
|
||||
}
|
||||
// Randomize the order in which we remove the tool and then add them back so
|
||||
// that we get to know if the tabs are correctly placed as per their ordinals.
|
||||
prefNodes = prefNodes.sort(() => Math.random() > 0.5 ? 1: -1);
|
||||
|
||||
// Wait for the next turn of the event loop to avoid stack overflow errors.
|
||||
executeSoon(toggleTools);
|
||||
}
|
||||
@ -124,7 +128,22 @@ function checkRegistered(event, data) {
|
||||
if (data == prefNodes[index - prefNodes.length].getAttribute("id")) {
|
||||
ok(true, "Correct tool added back");
|
||||
// checking tab on the toolbox
|
||||
ok(doc.getElementById("toolbox-tab-" + data), "Tab added back for " + data);
|
||||
let radio = doc.getElementById("toolbox-tab-" + data);
|
||||
ok(radio, "Tab added back for " + data);
|
||||
if (radio.previousSibling) {
|
||||
ok(+radio.getAttribute("ordinal") >=
|
||||
+radio.previousSibling.getAttribute("ordinal"),
|
||||
"Inserted tab's ordinal is greater than equal to its previous tab." +
|
||||
"Expected " + radio.getAttribute("ordinal") + " >= " +
|
||||
radio.previousSibling.getAttribute("ordinal"));
|
||||
}
|
||||
if (radio.nextSibling) {
|
||||
ok(+radio.getAttribute("ordinal") <
|
||||
+radio.nextSibling.getAttribute("ordinal"),
|
||||
"Inserted tab's ordinal is less than its next tab. Expected " +
|
||||
radio.getAttribute("ordinal") + " < " +
|
||||
radio.nextSibling.getAttribute("ordinal"));
|
||||
}
|
||||
index++;
|
||||
// Wait for the next turn of the event loop to avoid stack overflow errors.
|
||||
executeSoon(toggleTools);
|
||||
|
@ -1,3 +1,8 @@
|
||||
/* 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 { utils: Cu } = Components;
|
||||
const DISABLED_TOOLS = "devtools.toolbox.disabledTools";
|
||||
|
@ -5,7 +5,7 @@
|
||||
"use strict";
|
||||
|
||||
const {Cc, Ci, Cu} = require("chrome");
|
||||
|
||||
const MAX_ORDINAL = 99;
|
||||
let Promise = require("sdk/core/promise");
|
||||
let EventEmitter = require("devtools/shared/event-emitter");
|
||||
|
||||
@ -360,6 +360,10 @@ Toolbox.prototype = {
|
||||
radio.id = "toolbox-tab-" + id;
|
||||
radio.setAttribute("flex", "1");
|
||||
radio.setAttribute("toolid", id);
|
||||
if (toolDefinition.ordinal == undefined || toolDefinition.ordinal < 0) {
|
||||
toolDefinition.ordinal = MAX_ORDINAL;
|
||||
}
|
||||
radio.setAttribute("ordinal", toolDefinition.ordinal);
|
||||
radio.setAttribute("tooltiptext", toolDefinition.tooltip);
|
||||
|
||||
radio.addEventListener("command", function(id) {
|
||||
@ -382,8 +386,24 @@ Toolbox.prototype = {
|
||||
vbox.id = "toolbox-panel-" + id;
|
||||
|
||||
radio.appendChild(label);
|
||||
tabs.appendChild(radio);
|
||||
deck.appendChild(vbox);
|
||||
|
||||
// If there is no tab yet, or the ordinal to be added is the largest one.
|
||||
if (tabs.childNodes.length == 0 ||
|
||||
+tabs.lastChild.getAttribute("ordinal") <= toolDefinition.ordinal) {
|
||||
tabs.appendChild(radio);
|
||||
deck.appendChild(vbox);
|
||||
}
|
||||
// else, iterate over all the tabs to get the correct location.
|
||||
else {
|
||||
Array.some(tabs.childNodes, (node, i) => {
|
||||
if (+node.getAttribute("ordinal") > toolDefinition.ordinal) {
|
||||
tabs.insertBefore(radio, node);
|
||||
deck.insertBefore(vbox, deck.childNodes[i + 1]);
|
||||
// + 1 because of options panel.
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this._addKeysToWindow();
|
||||
},
|
||||
|
@ -3,66 +3,66 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
browser.jar:
|
||||
content/browser/devtools/widgets.css (shared/widgets/widgets.css)
|
||||
content/browser/devtools/widgets/VariablesView.xul (shared/widgets/VariablesView.xul)
|
||||
content/browser/devtools/markup-view.xhtml (markupview/markup-view.xhtml)
|
||||
content/browser/devtools/markup-view.css (markupview/markup-view.css)
|
||||
content/browser/devtools/netmonitor.xul (netmonitor/netmonitor.xul)
|
||||
content/browser/devtools/netmonitor.css (netmonitor/netmonitor.css)
|
||||
content/browser/devtools/netmonitor-controller.js (netmonitor/netmonitor-controller.js)
|
||||
content/browser/devtools/netmonitor-view.js (netmonitor/netmonitor-view.js)
|
||||
content/browser/NetworkPanel.xhtml (webconsole/NetworkPanel.xhtml)
|
||||
content/browser/devtools/webconsole.js (webconsole/webconsole.js)
|
||||
content/browser/devtools/webconsole.xul (webconsole/webconsole.xul)
|
||||
* content/browser/scratchpad.xul (scratchpad/scratchpad.xul)
|
||||
content/browser/scratchpad.js (scratchpad/scratchpad.js)
|
||||
content/browser/splitview.css (shared/splitview.css)
|
||||
content/browser/devtools/theme-switching.js (shared/theme-switching.js)
|
||||
content/browser/styleeditor.xul (styleeditor/styleeditor.xul)
|
||||
content/browser/styleeditor.css (styleeditor/styleeditor.css)
|
||||
content/browser/devtools/computedview.xhtml (styleinspector/computedview.xhtml)
|
||||
content/browser/devtools/cssruleview.xhtml (styleinspector/cssruleview.xhtml)
|
||||
content/browser/devtools/ruleview.css (styleinspector/ruleview.css)
|
||||
content/browser/devtools/layoutview/view.js (layoutview/view.js)
|
||||
content/browser/devtools/layoutview/view.xhtml (layoutview/view.xhtml)
|
||||
content/browser/devtools/layoutview/view.css (layoutview/view.css)
|
||||
content/browser/devtools/fontinspector/font-inspector.js (fontinspector/font-inspector.js)
|
||||
content/browser/devtools/fontinspector/font-inspector.xhtml (fontinspector/font-inspector.xhtml)
|
||||
content/browser/devtools/fontinspector/font-inspector.css (fontinspector/font-inspector.css)
|
||||
content/browser/orion.js (sourceeditor/orion/orion.js)
|
||||
* content/browser/source-editor-overlay.xul (sourceeditor/source-editor-overlay.xul)
|
||||
content/browser/debugger.xul (debugger/debugger.xul)
|
||||
content/browser/debugger.css (debugger/debugger.css)
|
||||
content/browser/debugger-controller.js (debugger/debugger-controller.js)
|
||||
content/browser/debugger-view.js (debugger/debugger-view.js)
|
||||
content/browser/debugger-toolbar.js (debugger/debugger-toolbar.js)
|
||||
content/browser/debugger-panes.js (debugger/debugger-panes.js)
|
||||
content/browser/profiler.xul (profiler/profiler.xul)
|
||||
content/browser/devtools/cleopatra.html (profiler/cleopatra/cleopatra.html)
|
||||
content/browser/devtools/profiler/cleopatra/css/ui.css (profiler/cleopatra/css/ui.css)
|
||||
content/browser/devtools/profiler/cleopatra/css/tree.css (profiler/cleopatra/css/tree.css)
|
||||
content/browser/devtools/profiler/cleopatra/css/devtools.css (profiler/cleopatra/css/devtools.css)
|
||||
content/browser/devtools/profiler/cleopatra/js/strings.js (profiler/cleopatra/js/strings.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/parser.js (profiler/cleopatra/js/parser.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/parserWorker.js (profiler/cleopatra/js/parserWorker.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/tree.js (profiler/cleopatra/js/tree.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/ui.js (profiler/cleopatra/js/ui.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/ProgressReporter.js (profiler/cleopatra/js/ProgressReporter.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/devtools.js (profiler/cleopatra/js/devtools.js)
|
||||
content/browser/devtools/profiler/cleopatra/images/circlearrow.svg (profiler/cleopatra/images/circlearrow.svg)
|
||||
content/browser/devtools/profiler/cleopatra/images/noise.png (profiler/cleopatra/images/noise.png)
|
||||
content/browser/devtools/profiler/cleopatra/images/throbber.svg (profiler/cleopatra/images/throbber.svg)
|
||||
content/browser/devtools/profiler/cleopatra/images/treetwisty.svg (profiler/cleopatra/images/treetwisty.svg)
|
||||
content/browser/devtools/commandline.css (commandline/commandline.css)
|
||||
content/browser/devtools/commandlineoutput.xhtml (commandline/commandlineoutput.xhtml)
|
||||
content/browser/devtools/commandlinetooltip.xhtml (commandline/commandlinetooltip.xhtml)
|
||||
content/browser/devtools/framework/toolbox-window.xul (framework/toolbox-window.xul)
|
||||
content/browser/devtools/framework/toolbox-options.xul (framework/toolbox-options.xul)
|
||||
content/browser/devtools/framework/toolbox-options.js (framework/toolbox-options.js)
|
||||
* content/browser/devtools/framework/toolbox.xul (framework/toolbox.xul)
|
||||
content/browser/devtools/framework/toolbox.css (framework/toolbox.css)
|
||||
content/browser/devtools/inspector/inspector.xul (inspector/inspector.xul)
|
||||
content/browser/devtools/inspector/inspector.css (inspector/inspector.css)
|
||||
content/browser/devtools/connect.xhtml (framework/connect/connect.xhtml)
|
||||
content/browser/devtools/connect.css (framework/connect/connect.css)
|
||||
content/browser/devtools/connect.js (framework/connect/connect.js)
|
||||
content/browser/devtools/widgets.css (shared/widgets/widgets.css)
|
||||
content/browser/devtools/widgets/VariablesView.xul (shared/widgets/VariablesView.xul)
|
||||
content/browser/devtools/markup-view.xhtml (markupview/markup-view.xhtml)
|
||||
content/browser/devtools/markup-view.css (markupview/markup-view.css)
|
||||
content/browser/devtools/netmonitor.xul (netmonitor/netmonitor.xul)
|
||||
content/browser/devtools/netmonitor.css (netmonitor/netmonitor.css)
|
||||
content/browser/devtools/netmonitor-controller.js (netmonitor/netmonitor-controller.js)
|
||||
content/browser/devtools/netmonitor-view.js (netmonitor/netmonitor-view.js)
|
||||
content/browser/devtools/NetworkPanel.xhtml (webconsole/NetworkPanel.xhtml)
|
||||
content/browser/devtools/webconsole.js (webconsole/webconsole.js)
|
||||
content/browser/devtools/webconsole.xul (webconsole/webconsole.xul)
|
||||
* content/browser/devtools/scratchpad.xul (scratchpad/scratchpad.xul)
|
||||
content/browser/devtools/scratchpad.js (scratchpad/scratchpad.js)
|
||||
content/browser/devtools/splitview.css (shared/splitview.css)
|
||||
content/browser/devtools/theme-switching.js (shared/theme-switching.js)
|
||||
content/browser/devtools/styleeditor.xul (styleeditor/styleeditor.xul)
|
||||
content/browser/devtools/styleeditor.css (styleeditor/styleeditor.css)
|
||||
content/browser/devtools/computedview.xhtml (styleinspector/computedview.xhtml)
|
||||
content/browser/devtools/cssruleview.xhtml (styleinspector/cssruleview.xhtml)
|
||||
content/browser/devtools/ruleview.css (styleinspector/ruleview.css)
|
||||
content/browser/devtools/layoutview/view.js (layoutview/view.js)
|
||||
content/browser/devtools/layoutview/view.xhtml (layoutview/view.xhtml)
|
||||
content/browser/devtools/layoutview/view.css (layoutview/view.css)
|
||||
content/browser/devtools/fontinspector/font-inspector.js (fontinspector/font-inspector.js)
|
||||
content/browser/devtools/fontinspector/font-inspector.xhtml (fontinspector/font-inspector.xhtml)
|
||||
content/browser/devtools/fontinspector/font-inspector.css (fontinspector/font-inspector.css)
|
||||
content/browser/devtools/orion.js (sourceeditor/orion/orion.js)
|
||||
* content/browser/devtools/source-editor-overlay.xul (sourceeditor/source-editor-overlay.xul)
|
||||
content/browser/devtools/debugger.xul (debugger/debugger.xul)
|
||||
content/browser/devtools/debugger.css (debugger/debugger.css)
|
||||
content/browser/devtools/debugger-controller.js (debugger/debugger-controller.js)
|
||||
content/browser/devtools/debugger-view.js (debugger/debugger-view.js)
|
||||
content/browser/devtools/debugger-toolbar.js (debugger/debugger-toolbar.js)
|
||||
content/browser/devtools/debugger-panes.js (debugger/debugger-panes.js)
|
||||
content/browser/devtools/profiler.xul (profiler/profiler.xul)
|
||||
content/browser/devtools/cleopatra.html (profiler/cleopatra/cleopatra.html)
|
||||
content/browser/devtools/profiler/cleopatra/css/ui.css (profiler/cleopatra/css/ui.css)
|
||||
content/browser/devtools/profiler/cleopatra/css/tree.css (profiler/cleopatra/css/tree.css)
|
||||
content/browser/devtools/profiler/cleopatra/css/devtools.css (profiler/cleopatra/css/devtools.css)
|
||||
content/browser/devtools/profiler/cleopatra/js/strings.js (profiler/cleopatra/js/strings.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/parser.js (profiler/cleopatra/js/parser.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/parserWorker.js (profiler/cleopatra/js/parserWorker.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/tree.js (profiler/cleopatra/js/tree.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/ui.js (profiler/cleopatra/js/ui.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/ProgressReporter.js (profiler/cleopatra/js/ProgressReporter.js)
|
||||
content/browser/devtools/profiler/cleopatra/js/devtools.js (profiler/cleopatra/js/devtools.js)
|
||||
content/browser/devtools/profiler/cleopatra/images/circlearrow.svg (profiler/cleopatra/images/circlearrow.svg)
|
||||
content/browser/devtools/profiler/cleopatra/images/noise.png (profiler/cleopatra/images/noise.png)
|
||||
content/browser/devtools/profiler/cleopatra/images/throbber.svg (profiler/cleopatra/images/throbber.svg)
|
||||
content/browser/devtools/profiler/cleopatra/images/treetwisty.svg (profiler/cleopatra/images/treetwisty.svg)
|
||||
content/browser/devtools/commandline.css (commandline/commandline.css)
|
||||
content/browser/devtools/commandlineoutput.xhtml (commandline/commandlineoutput.xhtml)
|
||||
content/browser/devtools/commandlinetooltip.xhtml (commandline/commandlinetooltip.xhtml)
|
||||
content/browser/devtools/framework/toolbox-window.xul (framework/toolbox-window.xul)
|
||||
content/browser/devtools/framework/toolbox-options.xul (framework/toolbox-options.xul)
|
||||
content/browser/devtools/framework/toolbox-options.js (framework/toolbox-options.js)
|
||||
* content/browser/devtools/framework/toolbox.xul (framework/toolbox.xul)
|
||||
content/browser/devtools/framework/toolbox.css (framework/toolbox.css)
|
||||
content/browser/devtools/inspector/inspector.xul (inspector/inspector.xul)
|
||||
content/browser/devtools/inspector/inspector.css (inspector/inspector.css)
|
||||
content/browser/devtools/connect.xhtml (framework/connect/connect.xhtml)
|
||||
content/browser/devtools/connect.css (framework/connect/connect.css)
|
||||
content/browser/devtools/connect.js (framework/connect/connect.js)
|
||||
|
@ -82,7 +82,7 @@ Tools.jsdebugger = {
|
||||
ordinal: 2,
|
||||
killswitch: "devtools.debugger.enabled",
|
||||
icon: "chrome://browser/skin/devtools/tool-debugger.png",
|
||||
url: "chrome://browser/content/debugger.xul",
|
||||
url: "chrome://browser/content/devtools/debugger.xul",
|
||||
label: l10n("ToolboxDebugger.label", debuggerStrings),
|
||||
tooltip: l10n("ToolboxDebugger.tooltip", debuggerStrings),
|
||||
|
||||
@ -124,7 +124,7 @@ Tools.styleEditor = {
|
||||
accesskey: l10n("open.accesskey", styleEditorStrings),
|
||||
modifiers: "shift",
|
||||
icon: "chrome://browser/skin/devtools/tool-styleeditor.png",
|
||||
url: "chrome://browser/content/styleeditor.xul",
|
||||
url: "chrome://browser/content/devtools/styleeditor.xul",
|
||||
label: l10n("ToolboxStyleEditor.label", styleEditorStrings),
|
||||
tooltip: l10n("ToolboxStyleEditor.tooltip", styleEditorStrings),
|
||||
|
||||
@ -146,7 +146,7 @@ Tools.jsprofiler = {
|
||||
modifiers: "shift",
|
||||
killswitch: "devtools.profiler.enabled",
|
||||
icon: "chrome://browser/skin/devtools/tool-profiler.png",
|
||||
url: "chrome://browser/content/profiler.xul",
|
||||
url: "chrome://browser/content/devtools/profiler.xul",
|
||||
label: l10n("profiler.label", profilerStrings),
|
||||
tooltip: l10n("profiler.tooltip", profilerStrings),
|
||||
|
||||
|
@ -61,7 +61,7 @@ function ProfileUI(uid, name, panel) {
|
||||
this.iframe = doc.createElement("iframe");
|
||||
this.iframe.setAttribute("flex", "1");
|
||||
this.iframe.setAttribute("id", "profiler-cleo-" + uid);
|
||||
this.iframe.setAttribute("src", "devtools/cleopatra.html?" + uid);
|
||||
this.iframe.setAttribute("src", "cleopatra.html?" + uid);
|
||||
this.iframe.setAttribute("hidden", "true");
|
||||
|
||||
// Append our iframe and subscribe to postMessage events.
|
||||
|
@ -8,7 +8,7 @@
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/common.css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/splitview.css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/profiler.css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/splitview.css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/devtools/splitview.css"?>
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % profilerDTD SYSTEM "chrome://browser/locale/devtools/profiler.dtd">
|
||||
|
@ -11,7 +11,7 @@ const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
const SCRATCHPAD_WINDOW_URL = "chrome://browser/content/scratchpad.xul";
|
||||
const SCRATCHPAD_WINDOW_URL = "chrome://browser/content/devtools/scratchpad.xul";
|
||||
const SCRATCHPAD_WINDOW_FEATURES = "chrome,titlebar,toolbar,centerscreen,resizable,dialog=no";
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
@ -30,6 +30,12 @@ Cu.import("resource:///modules/devtools/gDevTools.jsm");
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "VariablesView",
|
||||
"resource:///modules/devtools/VariablesView.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "devtools",
|
||||
"resource:///modules/devtools/gDevTools.jsm");
|
||||
|
||||
const SCRATCHPAD_CONTEXT_CONTENT = 1;
|
||||
const SCRATCHPAD_CONTEXT_BROWSER = 2;
|
||||
const SCRATCHPAD_L10N = "chrome://browser/locale/devtools/scratchpad.properties";
|
||||
@ -38,7 +44,9 @@ const PREF_RECENT_FILES_MAX = "devtools.scratchpad.recentFilesMax";
|
||||
const BUTTON_POSITION_SAVE = 0;
|
||||
const BUTTON_POSITION_CANCEL = 1;
|
||||
const BUTTON_POSITION_DONT_SAVE = 2;
|
||||
const BUTTON_POSITION_REVERT=0;
|
||||
const BUTTON_POSITION_REVERT = 0;
|
||||
const VARIABLES_VIEW_URL = "chrome://browser/content/devtools/widgets/VariablesView.xul";
|
||||
|
||||
|
||||
/**
|
||||
* The scratchpad object handles the Scratchpad window functionality.
|
||||
@ -253,6 +261,18 @@ var Scratchpad = {
|
||||
return "Scratchpad/" + this._instanceId;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Sidebar that contains the VariablesView for object inspection.
|
||||
*/
|
||||
get sidebar()
|
||||
{
|
||||
if (!this._sidebar) {
|
||||
this._sidebar = new ScratchpadSidebar();
|
||||
}
|
||||
return this._sidebar;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the Cu.Sandbox object for the active tab content window object. Note
|
||||
* that the returned object is cached for later reuse. The cached object is
|
||||
@ -423,25 +443,35 @@ var Scratchpad = {
|
||||
|
||||
/**
|
||||
* Execute the selected text (if any) or the entire editor content in the
|
||||
* current context. The resulting object is opened up in the Property Panel
|
||||
* for inspection.
|
||||
* current context. If the result is primitive then it is written as a
|
||||
* comment. Otherwise, the resulting object is inspected up in the sidebar.
|
||||
*
|
||||
* @return Promise
|
||||
* The promise for the script evaluation result.
|
||||
*/
|
||||
inspect: function SP_inspect()
|
||||
{
|
||||
let promise = this.execute();
|
||||
promise.then(([aString, aError, aResult]) => {
|
||||
let deferred = Promise.defer();
|
||||
let reject = aReason => deferred.reject(aReason);
|
||||
|
||||
this.execute().then(([aString, aError, aResult]) => {
|
||||
let resolve = () => deferred.resolve([aString, aError, aResult]);
|
||||
|
||||
if (aError) {
|
||||
this.writeAsErrorComment(aError);
|
||||
resolve();
|
||||
}
|
||||
else if (!isObject(aResult)) {
|
||||
this.writeAsComment(aResult);
|
||||
resolve();
|
||||
}
|
||||
else {
|
||||
this.deselect();
|
||||
this.openPropertyPanel(aString, aResult);
|
||||
this.sidebar.open(aString, aResult).then(resolve, reject);
|
||||
}
|
||||
});
|
||||
return promise;
|
||||
}, reject);
|
||||
|
||||
return deferred.promise;
|
||||
},
|
||||
|
||||
/**
|
||||
@ -552,58 +582,6 @@ var Scratchpad = {
|
||||
this.writeAsComment(newComment);
|
||||
},
|
||||
|
||||
/**
|
||||
* Open the Property Panel to inspect the given object.
|
||||
*
|
||||
* @param string aEvalString
|
||||
* The string that was evaluated. This is re-used when the user updates
|
||||
* the properties list, by clicking the Update button.
|
||||
* @param object aOutputObject
|
||||
* The object to inspect, which is the aEvalString evaluation result.
|
||||
* @return object
|
||||
* The PropertyPanel object instance.
|
||||
*/
|
||||
openPropertyPanel: function SP_openPropertyPanel(aEvalString, aOutputObject)
|
||||
{
|
||||
let propPanel;
|
||||
// The property panel has a button:
|
||||
// `Update`: reexecutes the string executed on the command line. The
|
||||
// result will be inspected by this panel.
|
||||
let buttons = [];
|
||||
|
||||
// If there is a evalString passed to this function, then add a `Update`
|
||||
// button to the panel so that the evalString can be reexecuted to update
|
||||
// the content of the panel.
|
||||
if (aEvalString !== null) {
|
||||
buttons.push({
|
||||
label: this.strings.
|
||||
GetStringFromName("propertyPanel.updateButton.label"),
|
||||
accesskey: this.strings.
|
||||
GetStringFromName("propertyPanel.updateButton.accesskey"),
|
||||
oncommand: () => {
|
||||
this.evalForContext(aEvalString).then(([, aError, aResult]) => {
|
||||
if (!aError) {
|
||||
propPanel.treeView.data = { object: aResult };
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let doc = this.browserWindow.document;
|
||||
let parent = doc.getElementById("mainPopupSet");
|
||||
let title = String(aOutputObject);
|
||||
propPanel = new PropertyPanel(parent, title, { object: aOutputObject },
|
||||
buttons);
|
||||
|
||||
let panel = propPanel.panel;
|
||||
panel.setAttribute("class", "scratchpad_propertyPanel");
|
||||
panel.openPopup(null, "after_pointer", 0, 0, false, false);
|
||||
panel.sizeTo(200, 400);
|
||||
|
||||
return propPanel;
|
||||
},
|
||||
|
||||
// Menu Operations
|
||||
|
||||
/**
|
||||
@ -1495,6 +1473,132 @@ var Scratchpad = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Encapsulates management of the sidebar containing the VariablesView for
|
||||
* object inspection.
|
||||
*/
|
||||
function ScratchpadSidebar()
|
||||
{
|
||||
let ToolSidebar = devtools.require("devtools/framework/sidebar").ToolSidebar;
|
||||
let tabbox = document.querySelector("#scratchpad-sidebar");
|
||||
this._sidebar = new ToolSidebar(tabbox, this);
|
||||
this._splitter = document.querySelector(".devtools-side-splitter");
|
||||
}
|
||||
|
||||
ScratchpadSidebar.prototype = {
|
||||
/*
|
||||
* The ToolSidebar for this sidebar.
|
||||
*/
|
||||
_sidebar: null,
|
||||
|
||||
/*
|
||||
* The splitter element between the sidebar and the editor.
|
||||
*/
|
||||
_splitter: null,
|
||||
|
||||
/*
|
||||
* The VariablesView for this sidebar.
|
||||
*/
|
||||
variablesView: null,
|
||||
|
||||
/*
|
||||
* Whether the sidebar is currently shown.
|
||||
*/
|
||||
visible: false,
|
||||
|
||||
/**
|
||||
* Open the sidebar, if not open already, and populate it with the properties
|
||||
* of the given object.
|
||||
*
|
||||
* @param string aString
|
||||
* The string that was evaluated.
|
||||
* @param object aObject
|
||||
* The object to inspect, which is the aEvalString evaluation result.
|
||||
* @return Promise
|
||||
* A promise that will resolve once the sidebar is open.
|
||||
*/
|
||||
open: function SS_open(aEvalString, aObject)
|
||||
{
|
||||
this.show();
|
||||
|
||||
let deferred = Promise.defer();
|
||||
|
||||
let onTabReady = () => {
|
||||
if (!this.variablesView) {
|
||||
let window = this._sidebar.getWindowForTab("variablesview");
|
||||
let container = window.document.querySelector("#variables");
|
||||
this.variablesView = new VariablesView(container);
|
||||
}
|
||||
this._update(aObject).then(() => deferred.resolve());
|
||||
};
|
||||
|
||||
if (this._sidebar.getCurrentTabID() == "variablesview") {
|
||||
onTabReady();
|
||||
}
|
||||
else {
|
||||
this._sidebar.once("variablesview-ready", onTabReady);
|
||||
this._sidebar.addTab("variablesview", VARIABLES_VIEW_URL, true);
|
||||
}
|
||||
|
||||
return deferred.promise;
|
||||
},
|
||||
|
||||
/**
|
||||
* Show the sidebar.
|
||||
*/
|
||||
show: function SS_show()
|
||||
{
|
||||
if (!this.visible) {
|
||||
this.visible = true;
|
||||
this._sidebar.show();
|
||||
this._splitter.setAttribute("state", "open");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Hide the sidebar.
|
||||
*/
|
||||
hide: function SS_hide()
|
||||
{
|
||||
if (this.visible) {
|
||||
this.visible = false;
|
||||
this._sidebar.hide();
|
||||
this._splitter.setAttribute("state", "collapsed");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the object currently inspected by the sidebar.
|
||||
*
|
||||
* @param object aObject
|
||||
* The object to inspect in the sidebar.
|
||||
* @return Promise
|
||||
* A promise that resolves when the update completes.
|
||||
*/
|
||||
_update: function SS__update(aObject)
|
||||
{
|
||||
let deferred = Promise.defer();
|
||||
|
||||
this.variablesView.rawObject = aObject;
|
||||
|
||||
// In the future this will work on remote values (bug 825039).
|
||||
setTimeout(() => deferred.resolve(), 0);
|
||||
return deferred.promise;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Check whether a value is non-primitive.
|
||||
*/
|
||||
function isObject(aValue)
|
||||
{
|
||||
let type = typeof aValue;
|
||||
return type == "object" ? aValue != null : type == "function";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The PreferenceObserver listens for preference changes while Scratchpad is
|
||||
* running.
|
||||
|
@ -8,9 +8,11 @@
|
||||
<!ENTITY % scratchpadDTD SYSTEM "chrome://browser/locale/devtools/scratchpad.dtd" >
|
||||
%scratchpadDTD;
|
||||
]>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/common.css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/scratchpad.css"?>
|
||||
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://browser/content/source-editor-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://browser/content/devtools/source-editor-overlay.xul"?>
|
||||
|
||||
<window id="main-window"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
@ -23,7 +25,7 @@
|
||||
persist="screenX screenY width height sizemode">
|
||||
|
||||
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/scratchpad.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/devtools/scratchpad.js"/>
|
||||
|
||||
<commandset id="editMenuCommands"/>
|
||||
<commandset id="sourceEditorCommands"/>
|
||||
@ -280,7 +282,16 @@
|
||||
</popupset>
|
||||
|
||||
<notificationbox id="scratchpad-notificationbox" flex="1">
|
||||
<hbox id="scratchpad-editor" flex="1"/>
|
||||
<hbox flex="1">
|
||||
<vbox id="scratchpad-editor" flex="1"/>
|
||||
<splitter class="devtools-side-splitter"
|
||||
collapse="after"
|
||||
state="collapsed"/>
|
||||
<tabbox id="scratchpad-sidebar" class="devtools-sidebar-tabs" width="300">
|
||||
<tabs/>
|
||||
<tabpanels flex="1"/>
|
||||
</tabbox>
|
||||
</hbox>
|
||||
</notificationbox>
|
||||
|
||||
</window>
|
||||
|
@ -12,47 +12,35 @@ function test()
|
||||
openScratchpad(runTests);
|
||||
}, true);
|
||||
|
||||
content.location = "data:text/html,<title>foobarBug636725</title>" +
|
||||
"<p>test inspect() in Scratchpad";
|
||||
content.location = "data:text/html;charset=utf8,<p>test inspect() in Scratchpad</p>";
|
||||
}
|
||||
|
||||
function runTests()
|
||||
{
|
||||
let sp = gScratchpadWindow.Scratchpad;
|
||||
|
||||
sp.setText("document");
|
||||
sp.setText("({ a: 'foobarBug636725' })");
|
||||
|
||||
sp.inspect().then(function() {
|
||||
let sidebar = sp.sidebar;
|
||||
ok(sidebar.visible, "sidebar is open");
|
||||
|
||||
let propPanel = document.querySelector(".scratchpad_propertyPanel");
|
||||
ok(propPanel, "property panel is open");
|
||||
|
||||
propPanel.addEventListener("popupshown", function onPopupShown() {
|
||||
propPanel.removeEventListener("popupshown", onPopupShown, false);
|
||||
let found = false;
|
||||
|
||||
let tree = propPanel.querySelector("tree");
|
||||
ok(tree, "property panel tree found");
|
||||
|
||||
let column = tree.columns[0];
|
||||
let found = false;
|
||||
|
||||
for (let i = 0; i < tree.view.rowCount; i++) {
|
||||
let cell = tree.view.getCellText(i, column);
|
||||
if (cell == 'title: "foobarBug636725"') {
|
||||
found = true;
|
||||
break;
|
||||
outer: for (let scope in sidebar.variablesView) {
|
||||
for (let [, obj] in scope) {
|
||||
for (let [, prop] in obj) {
|
||||
if (prop.name == "a" && prop.value == "foobarBug636725") {
|
||||
found = true;
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
ok(found, "found the document.title property");
|
||||
}
|
||||
|
||||
executeSoon(function() {
|
||||
propPanel.hidePopup();
|
||||
ok(found, "found the property");
|
||||
|
||||
finish();
|
||||
});
|
||||
}, false);
|
||||
}, function() {
|
||||
notok(true, "document not found");
|
||||
finish();
|
||||
});
|
||||
}
|
||||
}
|
@ -16,7 +16,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "clipboardHelper",
|
||||
"@mozilla.org/widget/clipboardhelper;1",
|
||||
"nsIClipboardHelper");
|
||||
|
||||
const ORION_SCRIPT = "chrome://browser/content/orion.js";
|
||||
const ORION_SCRIPT = "chrome://browser/content/devtools/orion.js";
|
||||
const ORION_IFRAME = "data:text/html;charset=utf8,<!DOCTYPE html>" +
|
||||
"<html style='height:100%' dir='ltr'>" +
|
||||
"<head><link rel='stylesheet'" +
|
||||
|
@ -7,13 +7,13 @@
|
||||
%styleEditorDTD;
|
||||
]>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/splitview.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/devtools/splitview.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/common.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/splitview.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/styleeditor.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/devtools/styleeditor.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/devtools/styleeditor.css" type="text/css"?>
|
||||
<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://browser/content/source-editor-overlay.xul"?>
|
||||
<?xul-overlay href="chrome://browser/content/devtools/source-editor-overlay.xul"?>
|
||||
<xul:window xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
id="style-editor-chrome-window">
|
||||
|
@ -25,6 +25,7 @@ _BROWSER_TEST_FILES = \
|
||||
browser_styleeditor_private_perwindowpb.js \
|
||||
browser_styleeditor_sv_keynav.js \
|
||||
browser_styleeditor_sv_resize.js \
|
||||
browser_styleeditor_bug_740541_iframes.js \
|
||||
browser_styleeditor_bug_851132_middle_click.js \
|
||||
head.js \
|
||||
helpers.js \
|
||||
|
@ -0,0 +1,90 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test()
|
||||
{
|
||||
|
||||
function makeStylesheet(selector) {
|
||||
return ("data:text/css;charset=UTF-8," +
|
||||
encodeURIComponent(selector + " { }"));
|
||||
}
|
||||
|
||||
function makeDocument(stylesheets, framedDocuments) {
|
||||
stylesheets = stylesheets || [];
|
||||
framedDocuments = framedDocuments || [];
|
||||
return "data:text/html;charset=UTF-8," + encodeURIComponent(
|
||||
Array.prototype.concat.call(
|
||||
["<!DOCTYPE html>",
|
||||
"<html>",
|
||||
"<head>",
|
||||
"<title>Bug 740541</title>"],
|
||||
stylesheets.map(function (sheet) {
|
||||
return '<link rel="stylesheet" type="text/css" href="'+sheet+'">';
|
||||
}),
|
||||
["</head>",
|
||||
"<body>"],
|
||||
framedDocuments.map(function (doc) {
|
||||
return '<iframe src="'+doc+'"></iframe>';
|
||||
}),
|
||||
["</body>",
|
||||
"</html>"]
|
||||
).join("\n"));
|
||||
}
|
||||
|
||||
const DOCUMENT_WITH_INLINE_STYLE = "data:text/html;charset=UTF-8," +
|
||||
encodeURIComponent(
|
||||
["<!DOCTYPE html>",
|
||||
"<html>",
|
||||
" <head>",
|
||||
" <title>Bug 740541</title>",
|
||||
' <style type="text/css">',
|
||||
" .something {",
|
||||
" }",
|
||||
" </style>",
|
||||
" </head>",
|
||||
" <body>",
|
||||
" </body>",
|
||||
" </html>"
|
||||
].join("\n"));
|
||||
|
||||
const FOUR = TEST_BASE_HTTP + "four.html";
|
||||
|
||||
const SIMPLE = TEST_BASE_HTTP + "simple.css";
|
||||
|
||||
const SIMPLE_DOCUMENT = TEST_BASE_HTTP + "simple.html";
|
||||
|
||||
|
||||
const TESTCASE_URI = makeDocument(
|
||||
[makeStylesheet(".a")],
|
||||
[makeDocument([],
|
||||
[FOUR,
|
||||
DOCUMENT_WITH_INLINE_STYLE]),
|
||||
makeDocument([makeStylesheet(".b"),
|
||||
SIMPLE],
|
||||
[makeDocument([makeStylesheet(".c")],
|
||||
[])]),
|
||||
makeDocument([SIMPLE], []),
|
||||
SIMPLE_DOCUMENT
|
||||
]);
|
||||
|
||||
const EXPECTED_STYLE_SHEET_COUNT = 12;
|
||||
|
||||
waitForExplicitFinish();
|
||||
let styleSheetCount = 0;
|
||||
addTabAndOpenStyleEditor(function (aPanel) {
|
||||
aPanel.UI.on("editor-added", function () {
|
||||
++styleSheetCount;
|
||||
info(styleSheetCount+" out of "+
|
||||
EXPECTED_STYLE_SHEET_COUNT+" style sheets loaded");
|
||||
if (styleSheetCount == EXPECTED_STYLE_SHEET_COUNT) {
|
||||
ok(true, "all style sheets loaded");
|
||||
// The right number of events have been received; check that
|
||||
// they actually show up in the style editor UI.
|
||||
is(aPanel.UI.editors.length, EXPECTED_STYLE_SHEET_COUNT,
|
||||
"UI elements present");
|
||||
finish();
|
||||
}
|
||||
});
|
||||
});
|
||||
content.location = TESTCASE_URI;
|
||||
}
|
@ -62,7 +62,7 @@ function NetworkPanel(aParent, aHttpActivity, aWebConsoleFrame)
|
||||
|
||||
// Create the iframe that displays the NetworkPanel XHTML.
|
||||
this.iframe = createAndAppendElement(this.panel, "iframe", {
|
||||
src: "chrome://browser/content/NetworkPanel.xhtml",
|
||||
src: "chrome://browser/content/devtools/NetworkPanel.xhtml",
|
||||
type: "content",
|
||||
flex: "1"
|
||||
});
|
||||
|
@ -3483,7 +3483,7 @@ JSTerm.prototype = {
|
||||
aProperty.evaluationMacro = this._variablesViewSimpleValueEvalMacro;
|
||||
}
|
||||
|
||||
let grips = [aProperty.value, aProperty.gettter, aProperty.settter];
|
||||
let grips = [aProperty.value, aProperty.getter, aProperty.setter];
|
||||
grips.forEach(addActorForDescriptor);
|
||||
|
||||
let inspectable = !VariablesView.isPrimitive({ value: aProperty.value });
|
||||
|
5
browser/themes/linux/devtools/scratchpad.css
Normal file
5
browser/themes/linux/devtools/scratchpad.css
Normal file
@ -0,0 +1,5 @@
|
||||
/* 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/. */
|
||||
|
||||
%include ../../shared/devtools/scratchpad.inc.css
|
@ -171,6 +171,7 @@ browser.jar:
|
||||
skin/classic/browser/devtools/debugger.css (devtools/debugger.css)
|
||||
* skin/classic/browser/devtools/profiler.css (devtools/profiler.css)
|
||||
skin/classic/browser/devtools/netmonitor.css (devtools/netmonitor.css)
|
||||
* skin/classic/browser/devtools/scratchpad.css (devtools/scratchpad.css)
|
||||
skin/classic/browser/devtools/magnifying-glass.png (devtools/magnifying-glass.png)
|
||||
skin/classic/browser/devtools/option-icon.png (devtools/option-icon.png)
|
||||
skin/classic/browser/devtools/itemToggle.png (devtools/itemToggle.png)
|
||||
|
5
browser/themes/osx/devtools/scratchpad.css
Normal file
5
browser/themes/osx/devtools/scratchpad.css
Normal file
@ -0,0 +1,5 @@
|
||||
/* 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/. */
|
||||
|
||||
%include ../../shared/devtools/scratchpad.inc.css
|
@ -262,6 +262,7 @@ browser.jar:
|
||||
* skin/classic/browser/devtools/debugger.css (devtools/debugger.css)
|
||||
* skin/classic/browser/devtools/profiler.css (devtools/profiler.css)
|
||||
skin/classic/browser/devtools/netmonitor.css (devtools/netmonitor.css)
|
||||
* skin/classic/browser/devtools/scratchpad.css (devtools/scratchpad.css)
|
||||
skin/classic/browser/devtools/magnifying-glass.png (devtools/magnifying-glass.png)
|
||||
skin/classic/browser/devtools/option-icon.png (devtools/option-icon.png)
|
||||
skin/classic/browser/devtools/itemToggle.png (devtools/itemToggle.png)
|
||||
|
10
browser/themes/shared/devtools/scratchpad.inc.css
Normal file
10
browser/themes/shared/devtools/scratchpad.inc.css
Normal file
@ -0,0 +1,10 @@
|
||||
%if 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/. */
|
||||
%endif
|
||||
|
||||
#scratchpad-sidebar > tabs {
|
||||
height: 0;
|
||||
border: none;
|
||||
}
|
5
browser/themes/windows/devtools/scratchpad.css
Normal file
5
browser/themes/windows/devtools/scratchpad.css
Normal file
@ -0,0 +1,5 @@
|
||||
/* 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/. */
|
||||
|
||||
%include ../../shared/devtools/scratchpad.inc.css
|
@ -199,6 +199,7 @@ browser.jar:
|
||||
skin/classic/browser/devtools/debugger.css (devtools/debugger.css)
|
||||
* skin/classic/browser/devtools/profiler.css (devtools/profiler.css)
|
||||
skin/classic/browser/devtools/netmonitor.css (devtools/netmonitor.css)
|
||||
* skin/classic/browser/devtools/scratchpad.css (devtools/scratchpad.css)
|
||||
skin/classic/browser/devtools/magnifying-glass.png (devtools/magnifying-glass.png)
|
||||
skin/classic/browser/devtools/option-icon.png (devtools/option-icon.png)
|
||||
skin/classic/browser/devtools/itemToggle.png (devtools/itemToggle.png)
|
||||
@ -446,6 +447,7 @@ browser.jar:
|
||||
skin/classic/aero/browser/devtools/debugger.css (devtools/debugger.css)
|
||||
* skin/classic/aero/browser/devtools/profiler.css (devtools/profiler.css)
|
||||
skin/classic/aero/browser/devtools/netmonitor.css (devtools/netmonitor.css)
|
||||
* skin/classic/aero/browser/devtools/scratchpad.css (devtools/scratchpad.css)
|
||||
skin/classic/aero/browser/devtools/magnifying-glass.png (devtools/magnifying-glass.png)
|
||||
skin/classic/aero/browser/devtools/option-icon.png (devtools/option-icon.png)
|
||||
skin/classic/aero/browser/devtools/itemToggle.png (devtools/itemToggle.png)
|
||||
|
@ -668,9 +668,6 @@ DebuggerProgressListener.prototype = {
|
||||
}
|
||||
|
||||
if (isStart && aRequest instanceof Ci.nsIChannel) {
|
||||
// If the request is about to happen in a new window, we are not concerned
|
||||
// about the request.
|
||||
|
||||
// Proceed normally only if the debuggee is not paused.
|
||||
if (this._tabActor.threadActor.state == "paused") {
|
||||
aRequest.suspend();
|
||||
@ -679,6 +676,7 @@ DebuggerProgressListener.prototype = {
|
||||
this._tabActor._pendingNavigation = aRequest;
|
||||
}
|
||||
|
||||
this._tabActor.threadActor.disableAllBreakpoints();
|
||||
this._tabActor.conn.send({
|
||||
from: this._tabActor.actorID,
|
||||
type: "tabNavigated",
|
||||
|
@ -740,6 +740,22 @@ ThreadActor.prototype = {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Disassociate all breakpoint actors from their scripts and clear the
|
||||
* breakpoint handlers. This method can be used when the thread actor intends
|
||||
* to keep the breakpoint store, but needs to clear any actual breakpoints,
|
||||
* e.g. due to a page navigation. This way the breakpoint actors' script
|
||||
* caches won't hold on to the Debugger.Script objects leaking memory.
|
||||
*/
|
||||
disableAllBreakpoints: function () {
|
||||
for (let url in this._breakpointStore) {
|
||||
for (let line in this._breakpointStore[url]) {
|
||||
let bp = this._breakpointStore[url][line];
|
||||
bp.actor.removeScripts();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle a protocol request to pause the debuggee.
|
||||
*/
|
||||
@ -1268,8 +1284,11 @@ ThreadActor.prototype = {
|
||||
// affect the loop.
|
||||
for (let line = existing.length - 1; line >= 0; line--) {
|
||||
let bp = existing[line];
|
||||
// Limit search to the line numbers contained in the new script.
|
||||
if (bp && line >= aScript.startLine && line <= endLine) {
|
||||
// Only consider breakpoints that are not already associated with
|
||||
// scripts, and limit search to the line numbers contained in the new
|
||||
// script.
|
||||
if (bp && !bp.actor.scripts.length &&
|
||||
line >= aScript.startLine && line <= endLine) {
|
||||
this._setBreakpoint(bp);
|
||||
}
|
||||
}
|
||||
@ -2050,6 +2069,16 @@ BreakpointActor.prototype = {
|
||||
this.scripts.push(aScript);
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove the breakpoints from associated scripts and clear the script cache.
|
||||
*/
|
||||
removeScripts: function () {
|
||||
for (let script of this.scripts) {
|
||||
script.clearBreakpoint(this);
|
||||
}
|
||||
this.scripts = [];
|
||||
},
|
||||
|
||||
/**
|
||||
* A function that the engine calls when a breakpoint has been hit.
|
||||
*
|
||||
@ -2079,12 +2108,9 @@ BreakpointActor.prototype = {
|
||||
// Remove from the breakpoint store.
|
||||
let scriptBreakpoints = this.threadActor._breakpointStore[this.location.url];
|
||||
delete scriptBreakpoints[this.location.line];
|
||||
// Remove the actual breakpoint.
|
||||
this.threadActor._hooks.removeFromParentPool(this);
|
||||
for (let script of this.scripts) {
|
||||
script.clearBreakpoint(this);
|
||||
}
|
||||
this.scripts = null;
|
||||
// Remove the actual breakpoint from the associated scripts.
|
||||
this.removeScripts();
|
||||
|
||||
return { from: this.actorID };
|
||||
}
|
||||
|
@ -149,10 +149,14 @@ StyleEditorActor.prototype = {
|
||||
if (event) {
|
||||
this.win.removeEventListener("load", this._onDocumentLoaded, false);
|
||||
}
|
||||
let styleSheets = [];
|
||||
|
||||
if (this.doc.styleSheets.length) {
|
||||
this._addStyleSheets(this.doc.styleSheets);
|
||||
let documents = [this.doc];
|
||||
for (let doc of documents) {
|
||||
this._addStyleSheets(doc.styleSheets);
|
||||
// Recursively handle style sheets of the documents in iframes.
|
||||
for (let iframe of doc.getElementsByTagName("iframe")) {
|
||||
documents.push(iframe.contentDocument);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user