From 0cae72fd004dfb7bcba67f2983eb1936d1dca92e Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Tue, 17 Mar 2015 18:57:12 +0900 Subject: [PATCH] Cancel previous scroll if the new to-be-scrolled tab is in the viewport --- modules/browser.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/browser.js b/modules/browser.js index c610c097..2ea3582d 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -6654,7 +6654,11 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { scrollToTab : function TSTBrowser_scrollToTab(aTab, aOnlyWhenCurrentTabIsInViewport) { - if (!aTab || !aTab.parentNode || this.isTabInViewport(aTab)) + if (!aTab || !aTab.parentNode) + return; + + this.cancelPerformingAutoScroll(true); + if (this.isTabInViewport(aTab)) return; var b = this.mTabBrowser;