diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index cdc2e545dea2..4ae6eab1f59d 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml index a04b9542db61..72849bc5f6bc 100644 --- a/b2g/config/emulator-jb/sources.xml +++ b/b2g/config/emulator-jb/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml index 74414b9f0309..cce2d3db7e75 100644 --- a/b2g/config/emulator-kk/sources.xml +++ b/b2g/config/emulator-kk/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index cdc2e545dea2..4ae6eab1f59d 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 5f8b4e145494..fd2abd197ade 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -4,6 +4,6 @@ "branch": "", "revision": "" }, - "revision": "44e3bac38280fde9b088dfb501d567e0d0e17ccf", + "revision": "1ad040b490a7eca701eab481a3716c5404041c1b", "repo_path": "/integration/gaia-central" } diff --git a/b2g/config/hamachi/sources.xml b/b2g/config/hamachi/sources.xml index 67feba949b4a..89f17c6b6c39 100644 --- a/b2g/config/hamachi/sources.xml +++ b/b2g/config/hamachi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/helix/sources.xml b/b2g/config/helix/sources.xml index 34c8efe612af..65a0d7755e9a 100644 --- a/b2g/config/helix/sources.xml +++ b/b2g/config/helix/sources.xml @@ -15,7 +15,7 @@ - + diff --git a/b2g/config/inari/sources.xml b/b2g/config/inari/sources.xml index fea8c4df4600..ef7b11a31418 100644 --- a/b2g/config/inari/sources.xml +++ b/b2g/config/inari/sources.xml @@ -19,7 +19,7 @@ - + diff --git a/b2g/config/leo/sources.xml b/b2g/config/leo/sources.xml index d1af943cc0a8..728526e980f9 100644 --- a/b2g/config/leo/sources.xml +++ b/b2g/config/leo/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/mako/sources.xml b/b2g/config/mako/sources.xml index 5a8b139ac19f..b724a1699f4e 100644 --- a/b2g/config/mako/sources.xml +++ b/b2g/config/mako/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/b2g/config/wasabi/sources.xml b/b2g/config/wasabi/sources.xml index 126432147541..51725a01ad2f 100644 --- a/b2g/config/wasabi/sources.xml +++ b/b2g/config/wasabi/sources.xml @@ -17,7 +17,7 @@ - + diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 89b6c451a3d3..aae3856c2145 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1120,6 +1120,14 @@ pref("devtools.toolbox.toolbarSpec", '["splitconsole", "paintflashing toggle","t pref("devtools.toolbox.sideEnabled", true); pref("devtools.toolbox.zoomValue", "1"); +// Toolbox Button preferences +pref("devtools.command-button-pick.enabled", true); +pref("devtools.command-button-splitconsole.enabled", true); +pref("devtools.command-button-paintflashing.enabled", false); +pref("devtools.command-button-tilt.enabled", false); +pref("devtools.command-button-scratchpad.enabled", false); +pref("devtools.command-button-responsive.enabled", true); + // Inspector preferences // Enable the Inspector pref("devtools.inspector.enabled", true); diff --git a/browser/base/content/tab-shape.inc.svg b/browser/base/content/tab-shape.inc.svg index f97889389e21..ec2816f4a9fa 100644 --- a/browser/base/content/tab-shape.inc.svg +++ b/browser/base/content/tab-shape.inc.svg @@ -9,3 +9,7 @@ + + + + diff --git a/browser/components/customizableui/content/panelUI.inc.xul b/browser/components/customizableui/content/panelUI.inc.xul index c06e9cefc701..607059cabedc 100644 --- a/browser/components/customizableui/content/panelUI.inc.xul +++ b/browser/components/customizableui/content/panelUI.inc.xul @@ -237,7 +237,8 @@ flip="none" side="left" position="leftcenter topright" - noautohide="true"> + noautohide="true" + hidden="true"> diff --git a/browser/components/customizableui/src/CustomizeMode.jsm b/browser/components/customizableui/src/CustomizeMode.jsm index 7ee859f5bc71..8c3bfef3d63b 100644 --- a/browser/components/customizableui/src/CustomizeMode.jsm +++ b/browser/components/customizableui/src/CustomizeMode.jsm @@ -569,6 +569,7 @@ CustomizeMode.prototype = { }); } + this.tipPanel.hidden = false; this.tipPanel.openPopup(anchorNode); Services.prefs.setBoolPref(kShownPref, true); }, diff --git a/browser/devtools/framework/options-panel.css b/browser/devtools/framework/options-panel.css index 2ba4a9e8a9a4..1629f7f67eb2 100644 --- a/browser/devtools/framework/options-panel.css +++ b/browser/devtools/framework/options-panel.css @@ -47,11 +47,6 @@ padding: 4px 0 0; /* To align it with the checkbox */ } -.options-citation-label + label { - padding: 3px 0 0 !important; /* To align it with the checkbox */ - font-style: italic; -} - .hidden-labels-box:not(.visible) > label, .hidden-labels-box.visible ~ .hidden-labels-box > label:last-child { display: none; diff --git a/browser/devtools/framework/test/browser.ini b/browser/devtools/framework/test/browser.ini index 9803331ee3fb..27d77ccd0269 100644 --- a/browser/devtools/framework/test/browser.ini +++ b/browser/devtools/framework/test/browser.ini @@ -15,6 +15,7 @@ support-files = [browser_toolbox_highlight.js] [browser_toolbox_hosts.js] [browser_toolbox_options.js] +[browser_toolbox_options_disable_buttons.js] [browser_toolbox_options_disable_cache.js] [browser_toolbox_options_disable_js.js] # [browser_toolbox_raise.js] # Bug 962258 diff --git a/browser/devtools/framework/test/browser_toolbox_options_disable_buttons.js b/browser/devtools/framework/test/browser_toolbox_options_disable_buttons.js new file mode 100644 index 000000000000..6bd0a88a6442 --- /dev/null +++ b/browser/devtools/framework/test/browser_toolbox_options_disable_buttons.js @@ -0,0 +1,148 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +let doc = null, toolbox = null, panelWin = null, modifiedPrefs = []; + +function test() { + waitForExplicitFinish(); + + gBrowser.selectedTab = gBrowser.addTab(); + let target = TargetFactory.forTab(gBrowser.selectedTab); + + gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) { + gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true); + gDevTools.showToolbox(target) + .then(testSelectTool) + .then(testToggleToolboxButtons) + .then(testPrefsAreRespectedWhenReopeningToolbox) + .then(cleanup, errorHandler); + }, true); + + content.location = "data:text/html;charset=utf8,test for dynamically registering and unregistering tools"; +} + +function testPrefsAreRespectedWhenReopeningToolbox() { + let deferred = promise.defer(); + let target = TargetFactory.forTab(gBrowser.selectedTab); + + info ("Closing toolbox to test after reopening"); + gDevTools.closeToolbox(target).then(() => { + let target = TargetFactory.forTab(gBrowser.selectedTab); + gDevTools.showToolbox(target) + .then(testSelectTool) + .then(() => { + info ("Toolbox has been reopened. Checking UI state."); + testPreferenceAndUIStateIsConsistent(); + deferred.resolve(); + }); + }); + + return deferred.promise; +} + +function testSelectTool(aToolbox) { + let deferred = promise.defer(); + info ("Selecting the options panel"); + + toolbox = aToolbox; + doc = toolbox.doc; + toolbox.once("options-selected", (event, tool) => { + ok(true, "Options panel selected via selectTool method"); + panelWin = tool.panelWin; + deferred.resolve(); + }); + toolbox.selectTool("options"); + + return deferred.promise; +} + +function testPreferenceAndUIStateIsConsistent() { + let checkNodes = [...panelWin.document.querySelectorAll("#enabled-toolbox-buttons-box > checkbox")]; + let toolboxButtonNodes = [...doc.querySelectorAll("#toolbox-buttons > toolbarbutton")]; + let toggleableTools = toolbox.toolboxButtons; + + for (let tool of toggleableTools) { + let isVisible = getBoolPref(tool.visibilityswitch); + + let button = toolboxButtonNodes.filter(button=>button.id === tool.id)[0]; + is (!button.hasAttribute("hidden"), isVisible, "Button visibility matches pref for " + tool.id); + + let check = checkNodes.filter(node=>node.id === tool.id)[0]; + is (check.checked, isVisible, "Checkbox should be selected based on current pref for " + tool.id); + } +} + +function testToggleToolboxButtons() { + let checkNodes = [...panelWin.document.querySelectorAll("#enabled-toolbox-buttons-box > checkbox")]; + let toolboxButtonNodes = [...doc.querySelectorAll("#toolbox-buttons > toolbarbutton")]; + let visibleButtons = toolboxButtonNodes.filter(button=>!button.hasAttribute("hidden")); + let toggleableTools = toolbox.toolboxButtons; + + is (checkNodes.length, toggleableTools.length, "All of the buttons are toggleable." ); + is (checkNodes.length, toolboxButtonNodes.length, "All of the DOM buttons are toggleable." ); + + for (let tool of toggleableTools) { + let id = tool.id; + let matchedCheckboxes = checkNodes.filter(node=>node.id === id); + let matchedButtons = toolboxButtonNodes.filter(button=>button.id === id); + ok (matchedCheckboxes.length === 1, + "There should be a single toggle checkbox for: " + id); + ok (matchedButtons.length === 1, + "There should be a DOM button for: " + id); + is (matchedButtons[0], tool.button, + "DOM buttons should match for: " + id); + + is (matchedCheckboxes[0].getAttribute("label"), tool.label, + "The label for checkbox matches the tool definition.") + is (matchedButtons[0].getAttribute("tooltiptext"), tool.label, + "The tooltip for button matches the tool definition.") + } + + // Store modified pref names so that they can be cleared on error. + for (let tool of toggleableTools) { + let pref = tool.visibilityswitch; + modifiedPrefs.push(pref); + } + + // Try checking each checkbox, making sure that it changes the preference + for (let node of checkNodes) { + let tool = toggleableTools.filter(tool=>tool.id === node.id)[0]; + let isVisible = getBoolPref(tool.visibilityswitch); + + testPreferenceAndUIStateIsConsistent(); + toggleButton(node); + testPreferenceAndUIStateIsConsistent(); + + let isVisibleAfterClick = getBoolPref(tool.visibilityswitch); + + is (isVisible, !isVisibleAfterClick, + "Clicking on the node should have toggled visibility preference for " + tool.visibilityswitch); + } + + return promise.resolve(); +} + +function getBoolPref(key) { + return Services.prefs.getBoolPref(key); +} + +function toggleButton(node) { + node.scrollIntoView(); + EventUtils.synthesizeMouseAtCenter(node, {}, panelWin); +} + +function cleanup() { + toolbox.destroy().then(function() { + gBrowser.removeCurrentTab(); + for (let pref of modifiedPrefs) { + Services.prefs.clearUserPref(pref); + } + toolbox = doc = panelWin = modifiedPrefs = null; + finish(); + }); +} + +function errorHandler(error) { + ok(false, "Unexpected error: " + error); + cleanup(); +} diff --git a/browser/devtools/framework/toolbox-options.js b/browser/devtools/framework/toolbox-options.js index 06b6f2154d08..1eb67aadd27a 100644 --- a/browser/devtools/framework/toolbox-options.js +++ b/browser/devtools/framework/toolbox-options.js @@ -61,6 +61,7 @@ OptionsPanel.prototype = { return targetPromise.then(() => { this.setupToolsList(); + this.setupToolbarButtonsList(); this.populatePreferences(); this._disableJSClicked = this._disableJSClicked.bind(this); @@ -81,6 +82,43 @@ OptionsPanel.prototype = { }); }, + setupToolbarButtonsList: function() { + let enabledToolbarButtonsBox = this.panelDoc.getElementById("enabled-toolbox-buttons-box"); + enabledToolbarButtonsBox.textContent = ""; + + let toggleableButtons = this.toolbox.toolboxButtons; + let setToolboxButtonsVisibility = + this.toolbox.setToolboxButtonsVisibility.bind(this.toolbox); + + let onCheckboxClick = (checkbox) => { + let toolDefinition = toggleableButtons.filter(tool => tool.id === checkbox.id)[0]; + Services.prefs.setBoolPref(toolDefinition.visibilityswitch, checkbox.checked); + setToolboxButtonsVisibility(); + }; + + let createCommandCheckbox = tool => { + let checkbox = this.panelDoc.createElement("checkbox"); + checkbox.setAttribute("id", tool.id); + checkbox.setAttribute("label", tool.label); + checkbox.setAttribute("checked", this.getBoolPref(tool.visibilityswitch)); + checkbox.addEventListener("command", onCheckboxClick.bind(this, checkbox)); + return checkbox; + }; + + for (let tool of toggleableButtons) { + enabledToolbarButtonsBox.appendChild(createCommandCheckbox(tool)); + } + }, + + getBoolPref: function(key) { + try { + return Services.prefs.getBoolPref(key); + } + catch (ex) { + return true; + } + }, + setupToolsList: function() { let defaultToolsBox = this.panelDoc.getElementById("default-tools-box"); let additionalToolsBox = this.panelDoc.getElementById("additional-tools-box"); @@ -90,15 +128,6 @@ OptionsPanel.prototype = { defaultToolsBox.textContent = ""; additionalToolsBox.textContent = ""; - let pref = function(key) { - try { - return Services.prefs.getBoolPref(key); - } - catch (ex) { - return true; - } - }; - let onCheckboxClick = function(id) { let toolDefinition = gDevTools._tools.get(id); // Set the kill switch pref boolean to true @@ -124,7 +153,7 @@ OptionsPanel.prototype = { l10n("options.toolNotSupportedMarker", tool.label)); checkbox.setAttribute("unsupported", ""); } - checkbox.setAttribute("checked", pref(tool.visibilityswitch)); + checkbox.setAttribute("checked", this.getBoolPref(tool.visibilityswitch)); checkbox.addEventListener("command", onCheckboxClick.bind(checkbox, tool.id)); return checkbox; }; diff --git a/browser/devtools/framework/toolbox-options.xul b/browser/devtools/framework/toolbox-options.xul index e96ba7ba123a..b02f4e73e850 100644 --- a/browser/devtools/framework/toolbox-options.xul +++ b/browser/devtools/framework/toolbox-options.xul @@ -20,9 +20,12 @@