Backed out changeset ffe1c9f9f9df (bug 1663173) for multiple bc perma failures. CLOSED TREE

This commit is contained in:
Razvan Maries 2020-09-10 01:46:46 +03:00
Родитель 423307263a
Коммит 6a6b5b8430
3 изменённых файлов: 1 добавлений и 82 удалений

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

@ -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) {

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

@ -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]

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

@ -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`
);
}
});