Bug 822914 - Improve gBrowser.selectedTab getter efficiency. r=dao
authorithinc <ithinc@sohu.com>
Sat, 29 Dec 2012 15:12:00 +0800
changeset 117221 0b34087f3e7d55ee2cfe2968703357a70a2f8656
parent 117220 cdc397a8e017d4523e2ced42dca1424265ed2dac
child 117222 dd6590eb7e4ff1f63d0489688a4fe0cea1932651
push id24089
push usereakhgari@mozilla.com
push dateSun, 30 Dec 2012 01:15:32 +0000
treeherdermozilla-central@c6464865fe9f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs822914
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 822914 - Improve gBrowser.selectedTab getter efficiency. r=dao
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -871,17 +871,17 @@
                 (oldBrowser.pageReport && !newBrowser.pageReport) ||
                 (!oldBrowser.pageReport && newBrowser.pageReport))
               updatePageReport = true;
 
             newBrowser.setAttribute("type", "content-primary");
             newBrowser.docShellIsActive =
               (window.windowState != window.STATE_MINIMIZED);
             this.mCurrentBrowser = newBrowser;
-            this.mCurrentTab = this.selectedTab;
+            this.mCurrentTab = this.tabContainer.selectedItem;
             this.showTab(this.mCurrentTab);
 
             var backForwardContainer = document.getElementById("unified-back-forward-button");
             if (backForwardContainer) {
               backForwardContainer.setAttribute("switchingtabs", "true");
               window.addEventListener("MozAfterPaint", function removeSwitchingtabsAttr() {
                 window.removeEventListener("MozAfterPaint", removeSwitchingtabsAttr);
                 backForwardContainer.removeAttribute("switchingtabs");
@@ -2130,17 +2130,17 @@
             aEvent.stopPropagation();
           }
         ]]>
         </body>
       </method>
 
       <property name="selectedTab">
         <getter>
-          return this.mTabBox.selectedTab;
+          return this.mCurrentTab;
         </getter>
         <setter>
           <![CDATA[
           // Update the tab
           this.mTabBox.selectedTab = val;
           return val;
           ]]>
         </setter>