Bug 1450219 - followup: Fix the XBL implementation as well.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 16 Nov 2018 18:25:12 +0100
changeset 446794 e97253b0e95c20792e31a72a435be3f1c50195f4
parent 446793 59d8473f176488a5e8aa95b8ca34d0ac4f0e0840
child 446795 1d50d21da50d91de52719decd7bf3e942a9ac89f
push id35052
push userapavel@mozilla.com
push dateSat, 17 Nov 2018 11:25:40 +0000
treeherdermozilla-central@efc1da42132b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1450219
milestone65.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 1450219 - followup: Fix the XBL implementation as well.
toolkit/content/widgets/datetimebox.xml
--- a/toolkit/content/widgets/datetimebox.xml
+++ b/toolkit/content/widgets/datetimebox.xml
@@ -589,28 +589,34 @@
       <method name="rebuildEditFieldsIfNeeded">
         <body>
         <![CDATA[
           if ((this.shouldShowSecondField() == this.hasSecondField()) &&
               (this.shouldShowMillisecField() == this.hasMillisecField())) {
             return;
           }
 
+          let focused = this.mInputElement.matches(":focus");
+
           let root =
             document.getAnonymousElementByAttribute(this, "anonid", "edit-wrapper");
           while (root.firstChild) {
             root.firstChild.remove();
           }
 
           this.mHourField = null;
           this.mMinuteField = null;
           this.mSecondField = null;
           this.mMillisecField = null;
 
           this.buildEditFields();
+
+          if (focused) {
+            this.focusInnerTextBox();
+          }
         ]]>
         </body>
       </method>
 
       <method name="buildEditFields">
         <body>
         <![CDATA[
           const HTML_NS = "http://www.w3.org/1999/xhtml";