Bug 1607025 - Port |Bug 822068 - Don't call tab.focus() in gBrowser.moveTabBackward/moveTabForward| to SeaMonkey. r=frg

This commit is contained in:
Ian Neal 2020-01-06 15:35:58 +01:00
Родитель f7a783723f
Коммит b0893b2da6
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -2481,6 +2481,8 @@
this.mTabFilters.splice(aDestIndex, 0, this.mTabFilters.splice(aSrcIndex, 1)[0]);
this.mTabListeners.splice(aDestIndex, 0, this.mTabListeners.splice(aSrcIndex, 1)[0]);
let wasFocused = (document.activeElement == this.mCurrentTab);
this.mCurrentTab._selected = false;
if (aDestIndex >= aSrcIndex)
@ -2488,6 +2490,10 @@
var tab = this.tabContainer.insertBefore(this.tabs[aSrcIndex], this.tabs.item(aDestIndex));
this.mCurrentTab._selected = true;
if (wasFocused)
this.mCurrentTab.focus();
this.tabContainer._handleTabSelect(false);
tab.dispatchEvent(new UIEvent("TabMove",
@ -2562,7 +2568,6 @@
var tabPos = this.tabContainer.selectedIndex;
if (tabPos < this.browsers.length - 1) {
this.moveTabTo(tabPos, tabPos + 1);
this.mCurrentTab.focus();
}
else if (this.arrowKeysShouldWrap)
this.moveTabToStart();
@ -2576,7 +2581,6 @@
var tabPos = this.tabContainer.selectedIndex;
if (tabPos > 0) {
this.moveTabTo(tabPos, tabPos - 1);
this.mCurrentTab.focus();
}
else if (this.arrowKeysShouldWrap)
this.moveTabToEnd();
@ -2590,7 +2594,6 @@
var tabPos = this.tabContainer.selectedIndex;
if (tabPos > 0) {
this.moveTabTo(tabPos, 0);
this.mCurrentTab.focus();
}
]]>
</body>
@ -2602,7 +2605,6 @@
var tabPos = this.tabContainer.selectedIndex;
if (tabPos < this.browsers.length - 1) {
this.moveTabTo(tabPos, this.browsers.length - 1);
this.mCurrentTab.focus();
}
]]>
</body>