Commit b1dd7976 authored by Dão Gottwald's avatar Dão Gottwald
Browse files

Bug 485841 - Get rid of some timeouts and avoid boxObject where appropriate in...

Bug 485841 - Get rid of some timeouts and avoid boxObject where appropriate in tabbrowser, part 1. r=enn
parent 9830f8fd
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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
+2 −3
Original line number Diff line number Diff line
@@ -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) {