mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 646297 - On tab close in Fennec, switch to sibling before parent [r=mfinkle]
This commit is contained in:
parent
5c6ac73f77
commit
009f7fb2ca
@ -880,6 +880,8 @@ var BrowserUI = {
|
||||
if (browser.canGoBack) {
|
||||
browser.goBack();
|
||||
} else if (tab.owner) {
|
||||
// When going back, always return to the owner (not a sibling).
|
||||
Browser.selectedTab = tab.owner;
|
||||
this.closeTab(tab);
|
||||
}
|
||||
#ifdef ANDROID
|
||||
|
@ -717,7 +717,12 @@ var Browser = {
|
||||
|
||||
let nextTab = this._selectedTab;
|
||||
if (nextTab == aTab) {
|
||||
nextTab = aTab.owner || this.getTabAtIndex(tabIndex + 1) || this.getTabAtIndex(tabIndex - 1);
|
||||
nextTab = this.getTabAtIndex(tabIndex + 1) || this.getTabAtIndex(tabIndex - 1);
|
||||
|
||||
// If the next tab is not a sibling, switch back to the parent.
|
||||
if (aTab.owner && nextTab.owner != aTab.owner)
|
||||
nextTab = aTab.owner;
|
||||
|
||||
if (!nextTab)
|
||||
return null;
|
||||
}
|
||||
|
@ -83,6 +83,8 @@ function tab_switch_02() {
|
||||
|
||||
//Add new tab
|
||||
new_tab_03 = Browser.addTab(testURL_03, true, new_tab_01);
|
||||
new_tab_04 = Browser.addTab(testURL_03, false, new_tab_01);
|
||||
|
||||
checkExpectedSize();
|
||||
new_tab_03.browser.addEventListener("load", tab_switch_03, true);
|
||||
}
|
||||
@ -93,7 +95,11 @@ function tab_switch_03() {
|
||||
is(Browser.selectedTab.notification, Elements.browsers.selectedPanel, "Deck has correct browser");
|
||||
|
||||
Browser.closeTab(new_tab_03, { forceClose: true });
|
||||
is(Browser.selectedTab, new_tab_01, "Closing tab 03 returns to owner");
|
||||
is(Browser.selectedTab, new_tab_04, "Closing tab 03 goes to sibling");
|
||||
is(Browser.selectedTab.notification, Elements.browsers.selectedPanel, "Deck has correct browser");
|
||||
|
||||
Browser.closeTab(new_tab_04, { forceClose: true });
|
||||
is(Browser.selectedTab, new_tab_01, "Closing tab 04 returns to owner");
|
||||
is(Browser.selectedTab.notification, Elements.browsers.selectedPanel, "Deck has correct browser");
|
||||
|
||||
new_tab_03 = Browser.addTab(testURL_03, true, new_tab_01);
|
||||
|
Loading…
Reference in New Issue
Block a user