Fix bug 396417 - [Mac] Datepicker freezes after changing month/year. r=ssitter
authorPhilipp Kewisch <mozilla@kewis.ch>
Tue, 10 Jan 2012 14:31:31 +0100
changeset 10384 298e996a1267f37e41239a435609fb96ffb18454
parent 10383 619bee8cb53cded516e52383b0059009bd72106b
child 10385 5885cc4465d8ade83488a4eb641eb1f6fc77d4f4
push id402
push userbugzilla@standard8.plus.com
push dateTue, 13 Mar 2012 21:17:18 +0000
treeherdercomm-beta@d080a8ebf16a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersssitter
bugs396417
Fix bug 396417 - [Mac] Datepicker freezes after changing month/year. r=ssitter
calendar/resources/content/datetimepickers/datetimepickers.xml
--- a/calendar/resources/content/datetimepickers/datetimepickers.xml
+++ b/calendar/resources/content/datetimepickers/datetimepickers.xml
@@ -304,39 +304,22 @@
           }
 
           this.kTextBox.kDatePicker = this; // enable call back to method in Moz1.7
           this.kTextBox.menupopup.kDatePicker = this;
           this.kMinimonth = this.kTextBox.menupopup.firstChild;
           this.mInPopup = false;
           this.kMinimonth.addEventListener("select", this.clickDate, false);
 
-          this.mUseReshowHack = true;
-#ifdef XP_MACOSX
-          // doesn't work on Mac: Sunbird works around in widget code, Lightning could not:
-          const kSUNBIRD_UID = "{718e30fb-e89b-41dd-9da7-e25a45638b28}";
-          var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
-                                  .getService(Components.interfaces.nsIXULAppInfo);
-          this.mUseReshowHack = (appInfo.ID == kSUNBIRD_UID);
-#endif
-          if (this.mUseReshowHack) {
-              this.kMinimonth.addEventListener("monthchange", this.reshowPopup, false);
-              this.kMinimonth.addEventListener("popuplisthidden", this.reshowPopup, false);
-          }
-          this.mIsReshowing = false;
         ]]>
       </constructor>
 
       <destructor>
         <![CDATA[
           this.kMinimonth.removeEventListener("select", this.clickDate, false);
-          if (this.mUseReshowHack) {
-              this.kMinimonth.removeEventListener("monthchange", this.reshowPopup, false);
-              this.kMinimonth.removeEventListener("popuplisthidden", this.reshowPopup, false);
-          }
         ]]>
       </destructor>
 
       <method name="update">
         <parameter name="aValue"/>
         <parameter name="aRefresh"/>
         <body>
           <![CDATA[
@@ -370,42 +353,21 @@
             }
           ]]>
         </body>
       </method>
 
       <method name="onPopup">
         <body>
           <![CDATA[
-            // avoid reinitializing during reshow, for bugs 273914 & 278877 workaround
-            if (! this.mIsReshowing) { 
-              this.mInPopup = true;
-              this.kMinimonth.update( this.mValue );
-              this.mInPopup = false;
-              // select all to remove cursor since can't type while popped-up
-              this.select();
-            }
-          ]]>
-        </body>
-      </method>
-
-      <!-- Reshow hides and shows parent popup without reinitializing in onPopup 
-           to workaround bugs 273914 (update title) & 278877 (avoid freeze) -->
-      <method name="reshowPopup">
-        <parameter name="aEvent"/>
-        <body>
-          <![CDATA[
-          var datepicker = aEvent.target.parentNode.parentNode.kDatePicker;
-          datepicker.mIsReshowing = true;
-          try { 
-            aEvent.target.parentNode.hidePopup();
-            aEvent.target.parentNode.openPopup(aEvent.target);
-          } finally {
-            datepicker.mIsReshowing = false;
-          }
+            this.mInPopup = true;
+            this.kMinimonth.update( this.mValue );
+            this.mInPopup = false;
+            // select all to remove cursor since can't type while popped-up
+            this.select();
           ]]>
         </body>
       </method>
 
       <method name="parseTextBoxDate">
         <parameter name="aRefresh"/>
         <body>
           <![CDATA[