зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ae6e0cf4a3
Коммит
8c3c1936f4
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче