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

This commit is contained in:
Dão Gottwald 2009-07-10 09:02:12 +02:00
parent 9830f8fd52
commit b1dd797636
2 changed files with 4 additions and 8 deletions

View File

@ -1189,16 +1189,13 @@
this.mTabContainer.appendChild(t);
if (document.defaultView
.getComputedStyle(this.mTabContainer, "")
.direction == "rtl") {
if (this.tabContainer.mTabstrip._isRTLScrollbox) {
/* In RTL UI, the tab is visually added to the left side of the
* tabstrip. This means the tabstip has to be scrolled back in
* order to make sure the same set of tabs is visible before and
* after the new tab is added */
this.mTabContainer.mTabstrip.scrollBoxObject
.scrollBy(this.mTabContainer.firstChild.boxObject.width, 0);
this.tabContainer.mTabstrip.scrollByPixels(this.mTabs[0].clientWidth);
}
// invalidate cache, because mTabContainer is about to change

View File

@ -1889,9 +1889,8 @@ SessionStoreService.prototype = {
if (aTabs.length > 0) {
// Determine if we can optimize & load visible tabs first
let tabScrollBoxObject = tabbrowser.tabContainer.mTabstrip.scrollBoxObject;
let tabBoxObject = aTabs[0].boxObject;
let maxVisibleTabs = Math.ceil(tabScrollBoxObject.width / tabBoxObject.width);
let maxVisibleTabs = Math.ceil(tabbrowser.tabContainer.mTabstrip.scrollClientSize /
aTabs[0].clientWidth);
// make sure we restore visible tabs first, if there are enough
if (maxVisibleTabs < aTabs.length && aSelectTab > 1) {