Closed Bug 1759858 Opened 2 years ago Closed 2 years ago

gBrowser.tabContainer.on_drop should take into account that adoptTab can abort

Categories

(Firefox :: Tabbed Browser, defect)

defect

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: Oriol, Assigned: Oriol)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

  1. Run this code in the browser console

    gBrowser.selectedTabs = [
      gBrowser.addTab("data:text/html,<title>Drag me!</title>Drag me!", {
        triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
        allowInheritPrincipal: true,
        index: 0,
      }),
      gBrowser.addTab("about:preferences", {
        createLazyBrowser: true,
        triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
        allowInheritPrincipal: true,
        index: 0,
      }),
    ];
    

    The 1st tab in the window will be a lazy about:preferences, the 2nd tab will be "Drag me!". Both will be multiselected, with the "Drag me!" selected.

  2. Open a new window, it will have an empty tab.

  3. Go back to the old window, drag the 2nd tab ("Drag me!") into the new window, into the very beginning of the tabbar.

Due to bug 1758307, the lazy tab won't be adopted into the new window.
But the new window should then have "Drag me!" as the 1st tab, and the empty tab becoming 2nd.
However, the "Drag me!" is the 2nd tab, after the empty tab, even if it was dragged before it!

Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/1a63c7a2d4ea
Make gBrowser.tabContainer.on_drop handle adoptTab failures. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: