Skip to content

Commit

Permalink
merge fx-team to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Jul 22, 2016
2 parents d8f16c1 + 919a539 commit 4225c85
Show file tree
Hide file tree
Showing 86 changed files with 411 additions and 2,030 deletions.
4 changes: 4 additions & 0 deletions addon-sdk/source/lib/dev/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ validate.define(Panel, contract({
invertIconForLightTheme: {
is: ["boolean", "undefined"],
msg: "The `options.invertIconForLightTheme` must be a boolean."
},
invertIconForDarkTheme: {
is: ["boolean", "undefined"],
msg: "The `options.invertIconForDarkTheme` must be a boolean."
}
}));

Expand Down
5 changes: 3 additions & 2 deletions addon-sdk/source/lib/dev/toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const Tool = Class({
this.themes = themes;

each(([key, Panel]) => {
const { url, label, tooltip, icon,
invertIconForLightTheme } = validate(Panel.prototype);
const { url, label, tooltip, icon, invertIconForLightTheme,
invertIconForDarkTheme } = validate(Panel.prototype);
const { id } = Panel.prototype;

gDevTools.registerTool({
Expand All @@ -53,6 +53,7 @@ const Tool = Class({
tooltip: tooltip,
icon: icon,
invertIconForLightTheme: invertIconForLightTheme,
invertIconForDarkTheme: invertIconForDarkTheme,
isTargetSupported: target => target.isLocalTab,
build: (window, toolbox) => {
const panel = new Panel();
Expand Down
2 changes: 2 additions & 0 deletions browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,7 @@
notificationbox.id = uniqueId;
aTab.linkedPanel = uniqueId;
aTab.linkedBrowser = browser;
aTab.hasBrowser = true;
this._tabForBrowser.set(browser, aTab);
// Inject the <browser> into the DOM if necessary.
Expand Down Expand Up @@ -4470,6 +4471,7 @@
this.mCurrentTab.lastAccessed = Infinity;
this.mCurrentTab.cachePosition = 0;
this.mCurrentTab.linkedBrowser = this.mCurrentBrowser;
this.mCurrentTab.hasBrowser = true;
this._tabForBrowser.set(this.mCurrentBrowser, this.mCurrentTab);
// set up the shared autoscroll popup
Expand Down
4 changes: 2 additions & 2 deletions browser/components/nsBrowserGlue.js
Original file line number Diff line number Diff line change
Expand Up @@ -2791,7 +2791,6 @@ ContentPermissionPrompt.prototype = {
if (!(requestingURI instanceof Ci.nsIStandardURL))
return;

var autoAllow = false;
var permissionKey = kFeatureKeys[perm.type];
var result = Services.perms.testExactPermissionFromPrincipal(requestingPrincipal, permissionKey);

Expand All @@ -2801,7 +2800,8 @@ ContentPermissionPrompt.prototype = {
}

if (result == Ci.nsIPermissionManager.ALLOW_ACTION) {
autoAllow = true;
request.allow();
return;
}

var browser = this._getBrowserForRequest(request);
Expand Down
30 changes: 15 additions & 15 deletions devtools/client/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Tools.options = {
ordinal: 0,
url: "chrome://devtools/content/framework/toolbox-options.xhtml",
icon: "chrome://devtools/skin/images/tool-options.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
bgTheme: "theme-body",
label: l10n("options.label", toolboxStrings),
iconOnly: true,
Expand All @@ -87,7 +87,7 @@ Tools.inspector = {
ordinal: 1,
modifiers: osString == "Darwin" ? "accel,alt" : "accel,shift",
icon: "chrome://devtools/skin/images/tool-inspector.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/inspector/inspector.xul",
label: l10n("inspector.label", inspectorStrings),
panelLabel: l10n("inspector.panelLabel", inspectorStrings),
Expand Down Expand Up @@ -123,7 +123,7 @@ Tools.webConsole = {
modifiers: Services.appinfo.OS == "Darwin" ? "accel,alt" : "accel,shift",
ordinal: 2,
icon: "chrome://devtools/skin/images/tool-webconsole.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/webconsole/webconsole.xul",
label: l10n("ToolboxTabWebconsole.label", webConsoleStrings),
menuLabel: l10n("MenuWebconsole.label", webConsoleStrings),
Expand Down Expand Up @@ -161,7 +161,7 @@ Tools.jsdebugger = {
modifiers: osString == "Darwin" ? "accel,alt" : "accel,shift",
ordinal: 3,
icon: "chrome://devtools/skin/images/tool-debugger.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
highlightedicon: "chrome://devtools/skin/images/tool-debugger-paused.svg",
url: "chrome://devtools/content/debugger/debugger.xul",
label: l10n("ToolboxDebugger.label", debuggerStrings),
Expand Down Expand Up @@ -190,7 +190,7 @@ Tools.styleEditor = {
accesskey: l10n("open.accesskey", styleEditorStrings),
modifiers: "shift",
icon: "chrome://devtools/skin/images/tool-styleeditor.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/styleeditor/styleeditor.xul",
label: l10n("ToolboxStyleEditor.label", styleEditorStrings),
panelLabel: l10n("ToolboxStyleEditor.panelLabel", styleEditorStrings),
Expand All @@ -215,7 +215,7 @@ Tools.shaderEditor = {
ordinal: 5,
visibilityswitch: "devtools.shadereditor.enabled",
icon: "chrome://devtools/skin/images/tool-shadereditor.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/shadereditor/shadereditor.xul",
label: l10n("ToolboxShaderEditor.label", shaderEditorStrings),
panelLabel: l10n("ToolboxShaderEditor.panelLabel", shaderEditorStrings),
Expand All @@ -235,7 +235,7 @@ Tools.canvasDebugger = {
ordinal: 6,
visibilityswitch: "devtools.canvasdebugger.enabled",
icon: "chrome://devtools/skin/images/tool-canvas.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/canvasdebugger/canvasdebugger.xul",
label: l10n("ToolboxCanvasDebugger.label", canvasDebuggerStrings),
panelLabel: l10n("ToolboxCanvasDebugger.panelLabel", canvasDebuggerStrings),
Expand All @@ -256,7 +256,7 @@ Tools.performance = {
id: "performance",
ordinal: 7,
icon: "chrome://devtools/skin/images/tool-profiler.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
highlightedicon: "chrome://devtools/skin/images/tool-profiler-active.svg",
url: "chrome://devtools/content/performance/performance.xul",
visibilityswitch: "devtools.performance.enabled",
Expand Down Expand Up @@ -284,7 +284,7 @@ Tools.memory = {
id: "memory",
ordinal: 8,
icon: "chrome://devtools/skin/images/tool-memory.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
highlightedicon: "chrome://devtools/skin/images/tool-memory-active.svg",
url: "chrome://devtools/content/memory/memory.xhtml",
visibilityswitch: "devtools.memory.enabled",
Expand All @@ -293,7 +293,7 @@ Tools.memory = {
tooltip: l10n("memory.tooltip", memoryStrings),

isTargetSupported: function (target) {
return target.getTrait("heapSnapshots");
return target.getTrait("heapSnapshots") && !target.isAddon;
},

build: function (frame, target) {
Expand All @@ -309,7 +309,7 @@ Tools.netMonitor = {
modifiers: osString == "Darwin" ? "accel,alt" : "accel,shift",
visibilityswitch: "devtools.netmonitor.enabled",
icon: "chrome://devtools/skin/images/tool-network.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/netmonitor/netmonitor.xul",
label: l10n("netmonitor.label", netMonitorStrings),
panelLabel: l10n("netmonitor.panelLabel", netMonitorStrings),
Expand All @@ -336,7 +336,7 @@ Tools.storage = {
modifiers: "shift",
visibilityswitch: "devtools.storage.enabled",
icon: "chrome://devtools/skin/images/tool-storage.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/storage/storage.xul",
label: l10n("storage.label", storageStrings),
menuLabel: l10n("storage.menuLabel", storageStrings),
Expand All @@ -362,7 +362,7 @@ Tools.webAudioEditor = {
ordinal: 11,
visibilityswitch: "devtools.webaudioeditor.enabled",
icon: "chrome://devtools/skin/images/tool-webaudio.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/webaudioeditor/webaudioeditor.xul",
label: l10n("ToolboxWebAudioEditor1.label", webAudioEditorStrings),
panelLabel: l10n("ToolboxWebAudioEditor1.panelLabel", webAudioEditorStrings),
Expand All @@ -382,7 +382,7 @@ Tools.scratchpad = {
ordinal: 12,
visibilityswitch: "devtools.scratchpad.enabled",
icon: "chrome://devtools/skin/images/tool-scratchpad.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/scratchpad/scratchpad.xul",
label: l10n("scratchpad.label", scratchpadStrings),
panelLabel: l10n("scratchpad.panelLabel", scratchpadStrings),
Expand All @@ -407,7 +407,7 @@ Tools.dom = {
modifiers: osString == "Darwin" ? "accel,alt" : "accel,shift",
visibilityswitch: "devtools.dom.enabled",
icon: "chrome://devtools/skin/images/tool-dom.svg",
invertIconForLightTheme: true,
invertIconForDarkTheme: true,
url: "chrome://devtools/content/dom/dom.html",
label: l10n("dom.label", domStrings),
panelLabel: l10n("dom.panelLabel", domStrings),
Expand Down
4 changes: 3 additions & 1 deletion devtools/client/framework/toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,9 @@ Toolbox.prototype = {
radio.setAttribute("ordinal", toolDefinition.ordinal);
radio.setAttribute("tooltiptext", toolDefinition.tooltip);
if (toolDefinition.invertIconForLightTheme) {
radio.setAttribute("icon-invertable", "true");
radio.setAttribute("icon-invertable", "light-theme");
} else if (toolDefinition.invertIconForDarkTheme) {
radio.setAttribute("icon-invertable", "dark-theme");
}

radio.addEventListener("command", () => {
Expand Down
48 changes: 21 additions & 27 deletions devtools/client/inspector/inspector-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ function InspectorPanel(iframeWindow, toolbox) {
this.onNewSelection = this.onNewSelection.bind(this);
this.onBeforeNewSelection = this.onBeforeNewSelection.bind(this);
this.onDetached = this.onDetached.bind(this);
this.onPaneToggleButtonActivated = this.onPaneToggleButtonActivated.bind(this);
this.onPaneToggleButtonPressed = this.onPaneToggleButtonPressed.bind(this);
this.onPaneToggleButtonClicked = this.onPaneToggleButtonClicked.bind(this);
this._onMarkupFrameLoad = this._onMarkupFrameLoad.bind(this);

let doc = this.panelDoc;
Expand Down Expand Up @@ -464,43 +463,53 @@ InspectorPanel.prototype = {
}

this.setupSidebarToggle();
this.setupSidebarWidth();
this.setupSidebarSize();

this.sidebar.show(defaultTab);
},

/**
* Sidebar width is currently driven by vbox.inspector-sidebar-container
* element, which is located at the left side of the side bar splitter.
* It's width is changed by the splitter and stored into preferences.
* Sidebar size is currently driven by vbox.inspector-sidebar-container
* element, which is located at the left/bottom side of the side bar splitter.
* Its size is changed by the splitter and stored into preferences.
* As soon as bug 1260552 is fixed and new HTML based splitter in place
* the width can be driven by div.inspector-sidebar element. This element
* represents the ToolSidebar and so, the entire logic related to width
* the size can be driven by div.inspector-sidebar element. This element
* represents the ToolSidebar and so, the entire logic related to size
* persistence can be done inside the ToolSidebar.
*/
setupSidebarWidth: function () {
setupSidebarSize: function () {
let sidePaneContainer = this.panelDoc.querySelector(
"#inspector-sidebar-container");

this.sidebar.on("show", () => {
try {
sidePaneContainer.width = Services.prefs.getIntPref(
"devtools.toolsidebar-width.inspector");
sidePaneContainer.height = Services.prefs.getIntPref(
"devtools.toolsidebar-height.inspector");
} catch (e) {
// The default width is the min-width set in CSS
// for #inspector-sidebar-container
// Set width and height of the sidebar container. Only one
// value is really useful at a time depending on the current
// toolbox orientation and having both doesn't break anything.
sidePaneContainer.width = 450;
sidePaneContainer.height = 450;
}
});

this.sidebar.on("hide", () => {
Services.prefs.setIntPref("devtools.toolsidebar-width.inspector",
sidePaneContainer.width);
Services.prefs.setIntPref("devtools.toolsidebar-height.inspector",
sidePaneContainer.height);
});

this.sidebar.on("destroy", () => {
Services.prefs.setIntPref("devtools.toolsidebar-width.inspector",
sidePaneContainer.width);
Services.prefs.setIntPref("devtools.toolsidebar-height.inspector",
sidePaneContainer.height);
});
},

Expand All @@ -512,8 +521,7 @@ InspectorPanel.prototype = {
"devtools/client/shared/components/sidebar-toggle"));

let sidebarToggle = SidebarToggle({
onClick: this.onPaneToggleButtonActivated,
onKeyDown: this.onPaneToggleButtonPressed,
onClick: this.onPaneToggleButtonClicked,
collapsed: false,
expandPaneTitle: strings.GetStringFromName("inspector.expandPane"),
collapsePaneTitle: strings.GetStringFromName("inspector.collapsePane"),
Expand Down Expand Up @@ -1208,37 +1216,23 @@ InspectorPanel.prototype = {
},

/**
* When the pane toggle button is pressed with space and return keys toggle
* the pane, change the button state and tooltip.
*/
onPaneToggleButtonPressed: function (event) {
if (ViewHelpers.isSpaceOrReturn(event)) {
this.onPaneToggleButtonActivated(event);
}
},

/**
* When the pane toggle button is clicked, toggle the pane, change the button
* When the pane toggle button is clicked or pressed, toggle the pane, change the button
* state and tooltip.
*/
onPaneToggleButtonActivated: function (e) {
onPaneToggleButtonClicked: function (e) {
let sidePaneContainer = this.panelDoc.querySelector("#inspector-sidebar-container");
let isVisible = !this._sidebarToggle.state.collapsed;
let sidePane = this.panelDoc.querySelector(
"#inspector-sidebar .devtools-sidebar-tabs");

// Make sure the sidebar has width and height attributes before collapsing
// because ViewHelpers needs it.
if (isVisible) {
let rect = sidePaneContainer.getBoundingClientRect();
if (!sidePaneContainer.hasAttribute("width")) {
sidePaneContainer.setAttribute("width", rect.width);
sidePane.style.width = rect.width + "px";
}
// always refresh the height attribute before collapsing, it could have
// been modified by resizing the container.
sidePaneContainer.setAttribute("height", rect.height);
sidePane.style.height = rect.height + "px";
}

let onAnimationDone = () => {
Expand Down
2 changes: 1 addition & 1 deletion devtools/client/preferences/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pref("devtools.debugger.ui.variables-only-enum-visible", false);
pref("devtools.debugger.ui.variables-searchbox-visible", false);

// Enable the Memory tools
pref("devtools.memory.enabled", false);
pref("devtools.memory.enabled", true);

pref("devtools.memory.custom-census-displays", "{}");
pref("devtools.memory.custom-label-displays", "{}");
Expand Down
15 changes: 5 additions & 10 deletions devtools/client/responsive.html/images/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 5 additions & 15 deletions devtools/client/responsive.html/images/rotate-viewport.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 6 additions & 12 deletions devtools/client/responsive.html/images/screenshot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4225c85

Please sign in to comment.