mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-06 00:10:25 +00:00
Bug 485841 - Get rid of some timeouts and avoid boxObject where appropriate in tabbrowser, part 1. r=enn
This commit is contained in:
parent
9830f8fd52
commit
b1dd797636
@ -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
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user