Closed Bug 1809364 Opened 1 year ago Closed 1 year ago

tabs.move is broken when moving multiple tabs into a different window

Categories

(WebExtensions :: Frontend, defect, P3)

defect

Tracking

(firefox-esr102 wontfix, firefox108 wontfix, firefox109 wontfix, firefox110 wontfix, firefox111 fixed)

RESOLVED FIXED
111 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox108 --- wontfix
firefox109 --- wontfix
firefox110 --- wontfix
firefox111 --- fixed

People

(Reporter: Oriol, Assigned: Oriol)

References

(Regressed 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

So, bug 1323311 tried to improve browser.tabs.move, but:

  • The logic doesn't really make sense (e.g. why use 2 different maps to track indices?).
  • It broke moving multiple tabs between windows, they appear in the wrong order. That's because it used nativeTab._tPos > insertionPoint where insertionPoint may be referring to a different window so comparing with _tPos is wrong.

Bug 1323311 tried to improve browser.tabs.move, but the logic didn't
really make sense (e.g. why use 2 different maps to track indices?),
and it broke moving multiple tabs between windows: they would appear
in the wrong order.

Example:

var tabs = await Promise.all([
  browser.tabs.create({url: "about:blank?1", index: 1}),
  browser.tabs.create({url: "about:blank?2", index: 2}),
  browser.tabs.create({url: "about:blank?3", index: 3}),
]);
var win2 = await browser.windows.create();
browser.tabs.move(tabs.map(t => t.id), {index: 0, windowId: win2.id})

The tabs in the new window will be about:blank?1, about:blank?3, about:blank?2, New Tab.

The order should be about:blank?1, about:blank?2, about:blank?3, New Tab.

Set release status flags based on info from the regressing bug 1323311

Severity: -- → S4
Priority: -- → P3
Pushed by oriol-bugzilla@hotmail.com:
https://hg.mozilla.org/integration/autoland/rev/e402dcbe2983
Make tabs.move on multiple tabs more reliable (2). r=robwu
Regressions: 1811273
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Duplicate of this bug: 1400456
Duplicate of this bug: 1766159
Duplicate of this bug: 1394477
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: