I looked into chromium’s implementation, and it’s a bit more complex than what I described in the description. Details are in TabStripModelOrderController::DetermineNewSelectedIndex(…)¹.
I think it would be worth identifying what in chromium’s implementation we want to replicate. One thing that wasn’t reported as part of this bug is that when opening background tabs from a given page, they should be placed to the right of the opener, in sequence (i.e. if I open B, C and D as background tabs from A, the order of the tabs should be A-B-C-D, not A-D-C-B as it is currently). This should probably be implemented as part of this bug. ¹ https://cs.chromium.org/chromium/src/chrome/browser/ui/tabs/tab_strip_model_order_controller.cc?l=52 -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to webbrowser-app in Ubuntu. https://bugs.launchpad.net/bugs/1664990 Title: Restore focus on parent tab when closing child tab Status in webbrowser-app package in Ubuntu: In Progress Bug description: (follow-up to https://code.launchpad.net/~fboucault/webbrowser- app/background_open_tabs_adjacent/+merge/316226) In chromium on desktop, when opening a link in a new tab (for instance when Ctrl+clicking on a hyperlink), the new tab is open next to the parent tab. When closing that child tab, the parent tab is the one that becomes current. In webbrowser-app, when closing the child tab, the next one in the list becomes current. It would be nice if webbrowser-app implemented the same behaviour as chromium. Steps to reproduce: 1) Start webbrowser-app, and open two tabs, e.g. http://example.org and http://start.ubuntu.com 2) Focus the first tab (example.org) and right click on the "More information…" link (this opens a new tab in second position and focuses it 3) Press Ctrl+W to close the current tab Expected result: the first tab (example.org) is the one that gets focused. Actual result: the second tab (start.ubuntu.com) is the one that gets focused. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/webbrowser-app/+bug/1664990/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp

