From 6a6b5b84308c355816c72c8abad93ff96393969b Mon Sep 17 00:00:00 2001 From: Razvan Maries Date: Thu, 10 Sep 2020 01:46:46 +0300 Subject: [PATCH] Backed out changeset ffe1c9f9f9df (bug 1663173) for multiple bc perma failures. CLOSED TREE --- browser/base/content/browser-customization.js | 40 +----------------- .../customizableui/test/browser.ini | 1 - .../browser_disable_commands_customize.js | 42 ------------------- 3 files changed, 1 insertion(+), 82 deletions(-) delete mode 100644 browser/components/customizableui/test/browser_disable_commands_customize.js diff --git a/browser/base/content/browser-customization.js b/browser/base/content/browser-customization.js index 938d2ed19e88..163e4f4df4ee 100644 --- a/browser/base/content/browser-customization.js +++ b/browser/base/content/browser-customization.js @@ -12,25 +12,6 @@ * events. */ var CustomizationHandler = { - // These are the commands we continue to leave enabled while in customize mode. - // All other commands are disabled, and we remove the disabled attribute when - // leaving customize mode. - enabledCommands: new Set([ - "cmd_newNavigator", - "cmd_newNavigatorTab", - "cmd_newNavigatorTabNoEvent", - "cmd_close", - "cmd_closeWindow", - "cmd_quitApplication", - "View:FullScreen", - "Browser:NextTab", - "Browser:PrevTab", - "Browser:NewUserContextTab", - "Tools:PrivateBrowsing", - "minimizeWindow", - "zoomWindow", - ]), - handleEvent(aEvent) { switch (aEvent.type) { case "customizationstarting": @@ -53,16 +34,6 @@ var CustomizationHandler = { childNode.setAttribute("disabled", true); } - for (let command of document.querySelectorAll("command")) { - if (!command.id || !this.enabledCommands.has(command.id)) { - if (command.getAttribute("disabled") != "true") { - command.setAttribute("disabled", true); - } else { - command.setAttribute("wasdisabled", true); - } - } - } - let cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.setAttribute("disabled", "true"); @@ -79,17 +50,8 @@ var CustomizationHandler = { PlacesToolbarHelper.customizeDone(); - for (let command of document.querySelectorAll("command")) { - if (!command.id || !this.enabledCommands.has(command.id)) { - if (command.getAttribute("wasdisabled") != "true") { - command.removeAttribute("disabled"); - } else { - command.removeAttribute("wasdisabled"); - } - } - } - XULBrowserWindow.asyncUpdateUI(); + // Re-enable parts of the UI we disabled during the dialog let menubar = document.getElementById("main-menubar"); for (let childNode of menubar.children) { diff --git a/browser/components/customizableui/test/browser.ini b/browser/components/customizableui/test/browser.ini index 9bb1fc060279..61bd60f4cef8 100644 --- a/browser/components/customizableui/test/browser.ini +++ b/browser/components/customizableui/test/browser.ini @@ -144,7 +144,6 @@ skip-if = os == "win" && bits == 64 # 1526429 [browser_customizemode_dragspace.js] skip-if = os == "linux" # linux doesn't get drag space (no tabsintitlebar) [browser_customizemode_uidensity.js] -[browser_disable_commands_customize.js] [browser_drag_outside_palette.js] [browser_exit_background_customize_mode.js] [browser_flexible_space_area.js] diff --git a/browser/components/customizableui/test/browser_disable_commands_customize.js b/browser/components/customizableui/test/browser_disable_commands_customize.js deleted file mode 100644 index c58d59d9cffd..000000000000 --- a/browser/components/customizableui/test/browser_disable_commands_customize.js +++ /dev/null @@ -1,42 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -/** - * Most commands don't make sense in customize mode. Check that they're - * disabled, so shortcuts can't activate them either. Also check that - * some basic commands (close tab/window, quit, new tab, new window) - * remain functional. - */ -add_task(async function test_disable_commands() { - await startCustomizing(); - let disabledCommands = ["cmd_print", "Browser:SavePage", "Browser:SendLink"]; - let enabledCommands = [ - "cmd_newNavigatorTab", - "cmd_newNavigator", - "cmd_quitApplication", - "cmd_close", - "cmd_closeWindow", - ]; - for (let cmd of disabledCommands) { - is( - document.getElementById(cmd).getAttribute("disabled"), - "true", - `Command ${cmd} should be disabled` - ); - } - for (let cmd of enabledCommands) { - ok( - !document.getElementById(cmd).hasAttribute("disabled"), - `Command ${cmd} should NOT be disabled` - ); - } - await endCustomizing(); - for (let cmd of disabledCommands.concat(enabledCommands)) { - ok( - !document.getElementById(cmd).hasAttribute("disabled"), - `Command ${cmd} should NOT be disabled after customize mode` - ); - } -});