Bug 1519957, fix login manager to not rely on the password field to not yet be initialized. This was broken by the other patch for bug 1519957, but using the .value property is what it should be doing anyway, but leave the attribute setting just in case, r=mattn
authorNeil Deakin <neil@mozilla.com>
Fri, 01 Mar 2019 12:27:16 -0500
changeset 519983 57624be2e55cefabe21feb5e0169f33b283f9ddd
parent 519982 63908a1890a03509eb8176562b46fa484b71673e
child 519984 c5219b2bbf2b401c6d74e220df02636cc67d8a24
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattn
bugs1519957
milestone67.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 1519957, fix login manager to not rely on the password field to not yet be initialized. This was broken by the other patch for bug 1519957, but using the .value property is what it should be doing anyway, but leave the attribute setting just in case, r=mattn
toolkit/components/passwordmgr/LoginManagerPrompter.jsm
--- a/toolkit/components/passwordmgr/LoginManagerPrompter.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerPrompter.jsm
@@ -879,28 +879,31 @@ LoginManagerPrompter.prototype = {
       if (element) {
         element.setAttribute("buttonlabel", label);
         element.setAttribute("buttonaccesskey", accessKey);
         updateButtonStatus(element);
       }
     };
 
     let writeDataToUI = () => {
-      // setAttribute is used since the <textbox> binding may not be attached yet.
+      // setAttribute is used in addition to setting the property since the
+      // <textbox> binding may not be attached yet.
       chromeDoc.getElementById("password-notification-username")
                .setAttribute("placeholder", usernamePlaceholder);
-      chromeDoc.getElementById("password-notification-username")
-               .setAttribute("value", login.username);
+      let nameField = chromeDoc.getElementById("password-notification-username");
+      nameField.setAttribute("value", login.username);
+      nameField.value = login.username;
 
       let toggleCheckbox = chromeDoc.getElementById("password-notification-visibilityToggle");
       toggleCheckbox.removeAttribute("checked");
       let passwordField = chromeDoc.getElementById("password-notification-password");
       // Ensure the type is reset so the field is masked.
       passwordField.setAttribute("type", "password");
       passwordField.setAttribute("value", login.password);
+      passwordField.value = login.password;
       updateButtonLabel();
     };
 
     let readDataFromUI = () => {
       login.username =
         chromeDoc.getElementById("password-notification-username").value;
       login.password =
         chromeDoc.getElementById("password-notification-password").value;