Backed out changeset 068e6a4704bf (bug 1922276) for causing bc failures on browser_tab_groups.js.

This commit is contained in:
Iulian Moraru 2024-11-05 01:45:16 +02:00
parent 2f58067369
commit 9f3814a261
3 changed files with 6 additions and 35 deletions

View File

@ -2903,10 +2903,6 @@
* @param {object[]} tabs
* The set of tabs to include in the group.
* @param {object} [options]
* @param {string} [options.id]
* Optionally assign an ID to the tab group. Useful when rebuilding an
* existing group e.g. when restoring. A pseudorandom string will be
* generated if not set.
* @param {string} [options.color]
* Color for the group label. See tabgroup-menu.js for possible values.
* If no color specified, will attempt to assign an unused group color.
@ -2916,18 +2912,10 @@
* An optional argument that accepts a single tab, which, if passed, will
* cause the group to be inserted just before this tab in the tab strip. By
* default, the group will be created at the end of the tab strip.
* @param {boolean} [options.showCreateUI]
* Set this to true to show the post-creation group edtior.
*/
addTabGroup(
tabs,
{
id = null,
color = null,
label = "",
insertBefore = null,
showCreateUI = false,
} = {}
{ id = null, color = null, label = "", insertBefore = null } = {}
) {
if (!tabs?.length) {
throw new Error("Cannot create tab group with zero tabs");
@ -2946,13 +2934,8 @@
insertBefore?.group ?? insertBefore
);
group.addTabs(tabs);
group.dispatchEvent(
new CustomEvent("TabGroupCreate", {
bubbles: true,
detail: { showCreateUI },
})
);
group.dispatchEvent(new CustomEvent("TabGroupCreate", { bubbles: true }));
return group;
},
@ -6378,9 +6361,7 @@
}
break;
case "TabGroupCreate":
if (aEvent.detail.showCreateUI) {
this.tabGroupMenu.openCreateModal(aEvent.target);
}
this.tabGroupMenu.openCreateModal(aEvent.target);
break;
case "activate":
// Intentional fallthrough
@ -8502,7 +8483,7 @@ var TabContextMenu = {
moveTabsToNewGroup() {
gBrowser.addTabGroup(
this.contextTab.multiselected ? gBrowser.selectedTabs : [this.contextTab],
{ insertBefore: this.contextTab, showCreateUI: true }
{ insertBefore: this.contextTab }
);
},

View File

@ -962,7 +962,6 @@
if (groupTab) {
gBrowser.addTabGroup([groupTab, ...movingTabs], {
insertBefore: draggedTab,
showCreateUI: true,
});
}
}

View File

@ -1151,13 +1151,8 @@ add_task(async function test_tabGroupCreatePanel() {
let tab = BrowserTestUtils.addTab(gBrowser, "about:blank");
let panelShown = BrowserTestUtils.waitForPopupEvent(tabgroupPanel, "shown");
let group = gBrowser.addTabGroup([tab], {
color: "cyan",
label: "Food",
showCreateUI: true,
});
let group = gBrowser.addTabGroup([tab], { color: "cyan", label: "Food" });
await panelShown;
Assert.equal(tabgroupPanel.state, "open", "Create panel is visible");
Assert.ok(tabgroupEditor.createMode, "Group editor is in create mode");
// Edit panel should be populated with correct group details
Assert.equal(
@ -1183,11 +1178,7 @@ add_task(async function test_tabGroupCreatePanel() {
Assert.ok(!tab.group, "Tab is ungrouped after hitting Cancel");
panelShown = BrowserTestUtils.waitForPopupEvent(tabgroupPanel, "shown");
group = gBrowser.addTabGroup([tab], {
color: "cyan",
label: "Food",
showCreateUI: true,
});
group = gBrowser.addTabGroup([tab], { color: "cyan", label: "Food" });
await panelShown;
// Panel inputs should work correctly