Bug 1559824 - ensure the right tab is visible when opening more than 1 background tab, r=dao, a=jcristau
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 19 Jun 2019 13:37:55 +0000
changeset 537047 b1de8ed9345fc424712567779a42e80b34c9a5d0
parent 537046 a8ecdca33940bf2783bd97ce72c08fc5e9881670
child 537048 34e40ed5a5e9f3ff55572270ac66e1309374eaab
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, jcristau
bugs1559824
milestone68.0
Bug 1559824 - ensure the right tab is visible when opening more than 1 background tab, r=dao, a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D35285
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -939,37 +939,37 @@
                 selectedTab = {left: selectedTab.left, right: selectedTab.right};
               }
               return [
                 this._lastTabToScrollIntoView,
                 this.arrowScrollbox.scrollClientRect,
                 {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;
               }
               delete this._lastTabToScrollIntoView;
               // Is the new tab already completely visible?
               if (scrollRect.left <= tabRect.left && tabRect.right <= scrollRect.right)
                 return;
 
               if (this.arrowScrollbox.smoothScroll) {
                 // Can we make both the new tab and the selected tab completely visible?
                 if (!selectedRect ||
                     Math.max(tabRect.right - selectedRect.left, selectedRect.right - tabRect.left) <=
                       scrollRect.width) {
-                  this.arrowScrollbox.ensureElementIsVisible(aTab);
+                  this.arrowScrollbox.ensureElementIsVisible(tabToScrollIntoView);
                   return;
                 }
 
                 this.arrowScrollbox.scrollByPixels(RTL_UI ?
                                                      selectedRect.right - scrollRect.right :
                                                      selectedRect.left - scrollRect.left);
               }