Bug 1559824 - ensure the right tab is visible when opening more than 1 background tab, r=dao

Differential Revision: https://phabricator.services.mozilla.com/D35285

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gijs Kruitbosch 2019-06-19 13:37:55 +00:00
Родитель ae6e0cf4a3
Коммит 8c3c1936f4
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -947,13 +947,13 @@
{left: lastTabRect.left, right: lastTabRect.right},
selectedTab,
];
}).then(([tabUsed, scrollRect, tabRect, selectedRect]) => {
}).then(([tabToScrollIntoView, scrollRect, tabRect, selectedRect]) => {
// First off, remove the promise so we can re-enter if necessary.
delete this._backgroundTabScrollPromise;
// Then, if the layout info isn't for the last-scrolled-to-tab, re-run
// the code above to get layout info for *that* tab, and don't do
// anything here, as we really just want to run this for the last-opened tab.
if (this._lastTabToScrollIntoView != tabUsed) {
if (this._lastTabToScrollIntoView != tabToScrollIntoView) {
this._notifyBackgroundTab(this._lastTabToScrollIntoView);
return;
}
@ -967,7 +967,7 @@
if (!selectedRect ||
Math.max(tabRect.right - selectedRect.left, selectedRect.right - tabRect.left) <=
scrollRect.width) {
this.arrowScrollbox.ensureElementIsVisible(aTab);
this.arrowScrollbox.ensureElementIsVisible(tabToScrollIntoView);
return;
}