Bug 1488953 - Disable smooth scroll on tabbar scrollbox to avoid stopping scrolling the last tab on race conditions. r=bgrins

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Hiroyuki Ikezoe 2019-06-10 03:06:25 +00:00
parent d427e7411c
commit 50c389b817

View File

@ -42,6 +42,12 @@ add_task(async function() {
async function overflowTabs() { async function overflowTabs() {
let arrowScrollbox = gBrowser.tabContainer.arrowScrollbox; let arrowScrollbox = gBrowser.tabContainer.arrowScrollbox;
const originalSmoothScroll = arrowScrollbox.smoothScroll;
arrowScrollbox.smoothScroll = false;
registerCleanupFunction(() => {
arrowScrollbox.smoothScroll = originalSmoothScroll;
});
let width = ele => ele.getBoundingClientRect().width; let width = ele => ele.getBoundingClientRect().width;
let tabMinWidth = parseInt(getComputedStyle(gBrowser.selectedTab, null).minWidth); let tabMinWidth = parseInt(getComputedStyle(gBrowser.selectedTab, null).minWidth);
let tabCountForOverflow = Math.ceil(width(arrowScrollbox) / tabMinWidth * 1.1); let tabCountForOverflow = Math.ceil(width(arrowScrollbox) / tabMinWidth * 1.1);