Open Bug 1613577 Opened 5 years ago Updated 2 years ago

Some pending/discarded tabs are loaded when dragged to an existing window

Categories

(Firefox :: Tabbed Browser, defect, P3)

72 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: tom_mozilla, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

  1. Have at least two windows, at least one of which has at least four tabs. The Auto Tab Discard extension is helpful but not required.
  2. Select a window with at least four tabs.
  3. Select the leftmost tab (tab 1).
  4. Discard the other tabs. If using the Auto Tab Discard extension, right-click on the active tab and select "Auto Tab Discard", then "Discard Other Tabs in This Window". Alternatively, restart Firefox and restore the session.
  5. Shift-click on tab 4 to highlight tabs 1-4.
  6. Click on tab 3 and drag the highlighted tabs to the tab bar of any other window.
  7. Repeat with different selections in steps 2, 4, and 5.

Actual results:

Tabs 1-4 are moved to the other window. Tab 1 remains loaded, tab 2 remains unloaded, tab 3 begins to load before moving, and tab 4 begins to load after moving.

More generally, any highlighted pending/discarded tabs to right of the active tab are loaded when moved to an existing window. This is consistent whether the left or right edge is selected first. The same tabs remain unloaded if moved to a new window instead, either by dragging or with the "Move to New Window" context menu item.

Expected results:

Pending/discarded tabs should remain pending/discarded when moved.

It looks like browser/components/sessionstore/test/browser_movePendingTabToNewWindow.js tries to test for this, but it uses the rightmost tab as the active tab, so no additional tabs are loaded.

Component: Untriaged → Tabbed Browser

This is implemented in browser/base/content/tabbrowser-tabs.js. It looks like dragging tabs to an existing window uses on_drop and dragging tabs to a new window uses on_dragend.

on_dragend calls gBrowser.replaceTabsWithWindow, which says "to avoid multiple tab-switches in the original window, the other tabs should be adopted before the selected one". on_drop appears to simply call adoptTab on each tab sequentially. If I understand correctly, adopting the active tab activates the tab that was to its right, which is immediately adopted, activating the tab that was to its right, and so on.

Do you see the same thing when using the context menu and "move tab to new window" ?

Flags: needinfo?(tom_mozilla)
Blocks: lazytabs
Priority: -- → P3

(In reply to :Gijs (he/him) from comment #3)

Do you see the same thing when using the context menu and "move tab to new window" ?

The other tabs remain unloaded when using "Move to New Window" context menu item. I have a patch that makes on_drop adopt the active tab last, which seems to fix the problem for dragging. The tabs.move extension API appears to have the same problem, also from calling adoptTab sequentially.

Flags: needinfo?(tom_mozilla)
Summary: Some pending/discarded tabs are loaded when moved to an existing window → Some pending/discarded tabs are loaded when dragged to an existing window
See Also: → 1615500
See Also: → 1521346

(In reply to Thomas Arnett from comment #4)

(In reply to :Gijs (he/him) from comment #3)

Do you see the same thing when using the context menu and "move tab to new window" ?

The other tabs remain unloaded when using "Move to New Window" context menu item. I have a patch that makes on_drop adopt the active tab last, which seems to fix the problem for dragging. The tabs.move extension API appears to have the same problem, also from calling adoptTab sequentially.

A patch for this would be great, let me know if I can help in some way.

Severity: normal → S3

Yo, what happened with that patch? Could've closed this bug 3 years ago SMH

Flags: needinfo?(tom_mozilla)

(In reply to movisivi from comment #6)

Yo, what happened with that patch? Could've closed this bug 3 years ago SMH

Thomas isn't employed by Mozilla. Please don't be rude to people, especially volunteer contributors.

Redirect a needinfo that is pending on an inactive user to the triage owner.
:dao, since the bug has recent activity, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(tom_mozilla) → needinfo?(dao+bmo)
You need to log in before you can comment on or make changes to this bug.