Bug 1314542 - Verify millisecond field when setting input time elemet's value. r=mconley
authorJessica Jong <jjong@mozilla.com>
Fri, 04 Nov 2016 00:59:00 -0400
changeset 351472 eab190f5dc945bbc9a09bfd776ccba99a9d81496
parent 351471 b15e9c4c5b6a1ecf073085208bf82ecc4023cef0
child 351473 a0ff94cf57e7a15c359dd8b343b5f2f3f8fcd0b1
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1314542
milestone52.0a1
Bug 1314542 - Verify millisecond field when setting input time elemet's value. r=mconley
toolkit/content/widgets/datetimebox.xml
--- a/toolkit/content/widgets/datetimebox.xml
+++ b/toolkit/content/widgets/datetimebox.xml
@@ -202,17 +202,18 @@
       </method>
 
       <method name="setInputValueFromFields">
         <body>
         <![CDATA[
           if (this.isEmpty(this.mHourField.value) ||
               this.isEmpty(this.mMinuteField.value) ||
               (this.mDayPeriodField && this.isEmpty(this.mDayPeriodField.value)) ||
-              (this.mSecondField && this.isEmpty(this.mSecondField.value))) {
+              (this.mSecondField && this.isEmpty(this.mSecondField.value)) ||
+              (this.mMillisecField && this.isEmpty(this.mMillisecField.value))) {
             // We still need to notify picker in case any of the field has
             // changed. If we can set input element value, then notifyPicker
             // will be called in setFieldsFromInputValue().
             this.notifyPicker();
             return;
           }
 
           let hour = Number(this.mHourField.value);
@@ -323,17 +324,17 @@
 
             if (aTargetField == this.mHourField) {
               value = now.getHours() % this.mMaxHourInHour12 ||
                 this.mMaxHourInHour12;
             } else if (aTargetField == this.mMinuteField) {
               value = now.getMinutes();
             } else if (aTargetField == this.mSecondField) {
               value = now.getSeconds();
-            } else if (aTargetField == this.mMillisecondsField) {
+            } else if (aTargetField == this.mMillisecField) {
               value = now.getMilliseconds();
             } else {
               this.log("Field not supported in incrementFieldValue.");
               return;
             }
           } else {
             value = Number(aTargetField.value);
           }