Bug 485841 - Get rid of some timeouts and avoid boxObject where appropriate in tabbrowser, part 4. r=enn

This commit is contained in:
Dão Gottwald 2009-07-10 14:19:07 +02:00
Родитель e3bb6039f6
Коммит 3b8851247e
1 изменённых файлов: 15 добавлений и 18 удалений

Просмотреть файл

@ -1274,21 +1274,21 @@
}
}
// |setTimeout| here to ensure we're post reflow
var _delayedUpdate = function(aTabContainer) {
aTabContainer.adjustTabstrip();
this.tabContainer.adjustTabstrip();
// Do this asynchronically, as we don't know yet if the tab
// will be selected.
setTimeout(function (aTabContainer) {
if (aTabContainer.selectedItem != t)
aTabContainer._notifyBackgroundTab(t);
}, 0, this.tabContainer);
// XXXmano: this is a temporary workaround to bug 343585
// We need to manually update the scroll buttons disabled state
// if a tab was inserted to the overflow area or removed from it
// without any scrolling and when the tabbar has already
// overflowed.
aTabContainer.mTabstrip._updateScrollButtonsDisabledState();
}
setTimeout(_delayedUpdate, 0, this.mTabContainer);
// XXXmano: this is a temporary workaround for bug 345399
// We need to manually update the scroll buttons disabled state
// if a tab was inserted to the overflow area or removed from it
// without any scrolling and when the tabbar has already
// overflowed.
this.tabContainer.mTabstrip._updateScrollButtonsDisabledState();
// Dispatch a new tab notification. We do this once we're
// entirely done, so that things are in a consistent state
@ -1496,15 +1496,12 @@
while (this._removingTabs.length)
this._endRemoveTab([this._removingTabs[0], false]);
} else if (!this._windowIsClosing) {
// see notes in addTab
function _delayedUpdate(aTabContainer) {
aTabContainer.adjustTabstrip();
aTabContainer.mTabstrip._updateScrollButtonsDisabledState();
};
setTimeout(_delayedUpdate, 0, this.tabContainer);
if (aNewTab && gURLBar)
gURLBar.focus();
this.tabContainer.adjustTabstrip();
// workaround for bug 345399
this.tabContainer.mTabstrip._updateScrollButtonsDisabledState();
}
// We're going to remove the tab and the browser now.