Bug 1491786 - Access selectedItem only once in _notifyBackgroundTab. r=dao
authorMarkus Staab <markus.staab@redaxo.de>
Thu, 20 Sep 2018 08:39:48 +0000
changeset 437391 90b5ea4678b3e45c7508a3a8f6280e6ad148114e
parent 437390 d51a5d2bc3a9daf39e9eb8812ce091e411f601ab
child 437392 ea436a9177b5632ae099c9f111e840875ca3bbf6
push id34681
push userebalazs@mozilla.com
push dateThu, 20 Sep 2018 13:21:10 +0000
treeherdermozilla-central@10664ff20476 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1491786
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1491786 - Access selectedItem only once in _notifyBackgroundTab. r=dao Differential Revision: https://phabricator.services.mozilla.com/D6321
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -759,18 +759,19 @@
           // DOMRect left/right properties are immutable.
           tab = {left: tab.left, right: tab.right};
 
           // Is the new tab already completely visible?
           if (scrollRect.left <= tab.left && tab.right <= scrollRect.right)
             return;
 
           if (this.arrowScrollbox.smoothScroll) {
-            let selected = !this.selectedItem.pinned &&
-                           this.selectedItem.getBoundingClientRect();
+            let selectedTab = this.selectedItem;
+            let selected = !selectedTab.pinned &&
+                           selectedTab.getBoundingClientRect();
 
             // Can we make both the new tab and the selected tab completely visible?
             if (!selected ||
                 Math.max(tab.right - selected.left, selected.right - tab.left) <=
                   scrollRect.width) {
               this.arrowScrollbox.ensureElementIsVisible(aTab);
               return;
             }