Bug 644746 - Call updateVisibility when constructing the tabs container rather than when addProgressListener is called for the first time. r=gavin
authorDão Gottwald <dao@mozilla.com>
Fri, 06 Jan 2012 14:22:47 +0100
changeset 85224 840ffcc76aa3935e813a3def527ebae63b543775
parent 85223 440b585a289664f24e1a57e9a1498d28bc650918
child 85225 2843998a1579174c158432e02700695a21238c54
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs644746
milestone12.0a1
Bug 644746 - Call updateVisibility when constructing the tabs container rather than when addProgressListener is called for the first time. r=gavin
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -146,19 +146,16 @@
       </field>
       <field name="arrowKeysShouldWrap" readonly="true">
 #ifdef XP_MACOSX
         true
 #else
         false
 #endif
       </field>
-      <field name="mAddProgressListenerWasCalled">
-        false
-      </field>
       <field name="_browsers">
         null
       </field>
 
       <field name="_autoScrollPopup">
         null
       </field>
 
@@ -1907,21 +1904,16 @@
           <![CDATA[
             if (arguments.length != 1) {
               Components.utils.reportError("gBrowser.addProgressListener was " +
                                            "called with a second argument, " +
                                            "which is not supported. See bug " +
                                            "608628.");
             }
 
-            if (!this.mAddProgressListenerWasCalled) {
-              this.mAddProgressListenerWasCalled = true;
-              this.tabContainer.updateVisibility();
-            }
-
             this.mProgressListeners.push(aListener);
           ]]>
         </body>
       </method>
 
       <method name="removeProgressListener">
         <parameter name="aListener"/>
         <body>
@@ -2765,16 +2757,17 @@
           tab.setAttribute("crop", "end");
           tab.setAttribute("validate", "never");
           tab.setAttribute("onerror", "this.removeAttribute('image');");
           this.adjustTabstrip();
 
           Services.prefs.addObserver("browser.tabs.", this._prefObserver, false);
           window.addEventListener("resize", this, false);
 
+          this.updateVisibility();
           this._propagateVisibility();
         ]]>
       </constructor>
 
       <destructor>
         <![CDATA[
           Services.prefs.removeObserver("browser.tabs.", this._prefObserver);
         ]]>