Bug 1946868 - Remove "Turn on/off Vertical Tabs" in the tab context menu r=sidebar-reviewers,tabbrowser-reviewers,nsharpley,dao
Backout of Bug 1944016 - Add new strings to tab context menu for switching to/from vertical tabs. Differential Revision: https://phabricator.services.mozilla.com/D238106
This commit is contained in:
@@ -100,8 +100,6 @@
|
||||
<menuitem id="context_fullscreenExit"
|
||||
contexttype="fullscreen"
|
||||
data-lazy-l10n-id="full-screen-exit"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="context_toggleVerticalTabs" data-lazy-l10n-id="tab-context-enable-vertical-tabs"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="open-tab-group-context-menu">
|
||||
|
||||
@@ -104,9 +104,6 @@ document.addEventListener(
|
||||
case "context_fullscreenExit":
|
||||
BrowserCommands.fullScreen();
|
||||
break;
|
||||
case "context_toggleVerticalTabs":
|
||||
SidebarController.toggleVerticalTabs();
|
||||
break;
|
||||
|
||||
// == open-tab-group-context-menu ==
|
||||
case "open-tab-group-context-menu_moveToNewWindow":
|
||||
|
||||
@@ -157,59 +157,6 @@ add_task(async function test_sidebar_extension_context_menu() {
|
||||
await BrowserTestUtils.closeWindow(win);
|
||||
});
|
||||
|
||||
add_task(async function test_toggle_vertical_tabs_from_a_tab() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["sidebar.verticalTabs", false]],
|
||||
});
|
||||
Assert.equal(
|
||||
Services.prefs.getStringPref("sidebar.visibility"),
|
||||
"hide-sidebar",
|
||||
"Sanity check the visibilty pref is updated when verticalTabs are disabled"
|
||||
);
|
||||
|
||||
info("Enable vertical tabs from a tab.");
|
||||
const tabContextMenu = document.getElementById("tabContextMenu");
|
||||
const toggleMenuItem = document.getElementById("context_toggleVerticalTabs");
|
||||
await openAndWaitForContextMenu(tabContextMenu, gBrowser.selectedTab, () => {
|
||||
Assert.deepEqual(
|
||||
document.l10n.getAttributes(toggleMenuItem),
|
||||
{ id: "tab-context-enable-vertical-tabs", args: null },
|
||||
"Context menu item indicates that it enables vertical tabs."
|
||||
);
|
||||
toggleMenuItem.click();
|
||||
});
|
||||
await TestUtils.waitForCondition(
|
||||
() => gBrowser.tabContainer.verticalMode,
|
||||
"Vertical tabs are enabled."
|
||||
);
|
||||
Assert.equal(
|
||||
Services.prefs.getStringPref("sidebar.visibility"),
|
||||
"always-show",
|
||||
"Sanity check the visibilty pref is updated when verticalTabs are enabled"
|
||||
);
|
||||
|
||||
info("Disable vertical tabs from a tab.");
|
||||
await openAndWaitForContextMenu(tabContextMenu, gBrowser.selectedTab, () => {
|
||||
Assert.deepEqual(
|
||||
document.l10n.getAttributes(toggleMenuItem),
|
||||
{ id: "tab-context-disable-vertical-tabs", args: null },
|
||||
"Context menu item indicates that it disables vertical tabs."
|
||||
);
|
||||
toggleMenuItem.click();
|
||||
});
|
||||
await TestUtils.waitForCondition(
|
||||
() => !gBrowser.tabContainer.verticalMode,
|
||||
"Vertical tabs are disabled."
|
||||
);
|
||||
Assert.equal(
|
||||
Services.prefs.getStringPref("sidebar.visibility"),
|
||||
"hide-sidebar",
|
||||
"Sanity check the visibilty pref is updated when verticalTabs are disabled"
|
||||
);
|
||||
|
||||
await SpecialPowers.popPrefEnv();
|
||||
});
|
||||
|
||||
add_task(async function test_toggle_vertical_tabs_from_tab_strip() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["sidebar.verticalTabs", false]],
|
||||
|
||||
@@ -8498,17 +8498,6 @@ var TabContextMenu = {
|
||||
: "close-tabs-to-the-end"
|
||||
);
|
||||
|
||||
// Update context menu item for "Turn (on/off) Vertical Tabs".
|
||||
const toggleVerticalTabsItem = document.getElementById(
|
||||
"context_toggleVerticalTabs"
|
||||
);
|
||||
document.l10n.setAttributes(
|
||||
toggleVerticalTabsItem,
|
||||
gBrowser.tabContainer?.verticalMode
|
||||
? "tab-context-disable-vertical-tabs"
|
||||
: "tab-context-enable-vertical-tabs"
|
||||
);
|
||||
|
||||
// Disable "Close Tabs to the Left/Right" if there are no tabs
|
||||
// preceding/following it.
|
||||
let noTabsToStart = !gBrowser._getTabsToTheStartFrom(this.contextTab)
|
||||
|
||||
@@ -91,10 +91,6 @@ tab-context-close-duplicate-tabs =
|
||||
tab-context-share-url =
|
||||
.label = Share
|
||||
.accesskey = h
|
||||
tab-context-enable-vertical-tabs =
|
||||
.label = Turn on Vertical Tabs
|
||||
tab-context-disable-vertical-tabs =
|
||||
.label = Turn off Vertical Tabs
|
||||
|
||||
## Variables:
|
||||
## $tabCount (Number): the number of tabs that are affected by the action.
|
||||
|
||||
Reference in New Issue
Block a user