Bug 1521884 - Use proper case for maxLength attribute in datetimebox widget. r=Gijs
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 23 Jan 2019 14:48:42 +0000
changeset 515269 08c85a7f6bcc
parent 515268 76c397291c5f
child 515270 b4dbd3d276f6
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1521884
milestone66.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 1521884 - Use proper case for maxLength attribute in datetimebox widget. r=Gijs In non-HTML documents, getAttribute is not case-insensitive. Differential Revision: https://phabricator.services.mozilla.com/D17355
toolkit/content/widgets/datetimebox.js
--- a/toolkit/content/widgets/datetimebox.js
+++ b/toolkit/content/widgets/datetimebox.js
@@ -1499,17 +1499,17 @@ this.TimeInputImplWidget = class extends
     if (targetField.classList.contains("numeric") && key.match(/[0-9]/)) {
       let buffer = targetField.getAttribute("typeBuffer") || "";
 
       buffer = buffer.concat(key);
       this.setFieldValue(targetField, buffer);
 
       let n = Number(buffer);
       let max = targetField.getAttribute("max");
-      let maxLength = targetField.getAttribute("maxLength");
+      let maxLength = targetField.getAttribute("maxlength");
       if (buffer.length >= maxLength || n * 10 > max) {
         buffer = "";
         this.advanceToNextField();
       }
       targetField.setAttribute("typeBuffer", buffer);
       this.setInputValueFromFields();
     }
   }