Bug 1135451 - fillForm() cleanup part E: remove didFillForm. r=MattN
authorJustin Dolske <dolske@mozilla.com>
Fri, 27 Feb 2015 15:47:37 -0800
changeset 231346 d4f4f8cf938bb878083fee8b8d3264027db694b9
parent 231345 7171e15ba2ffd34b9f002b0ca7a68a331832e496
child 231347 a71d846d255caff98022b0ef2e8267b529adf3d0
push id28349
push userkwierso@gmail.com
push dateMon, 02 Mar 2015 20:41:54 +0000
treeherdermozilla-central@eaaa45f32e9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1135451
milestone39.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 1135451 - fillForm() cleanup part E: remove didFillForm. r=MattN
toolkit/components/passwordmgr/LoginManagerContent.jsm
--- a/toolkit/components/passwordmgr/LoginManagerContent.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm
@@ -737,17 +737,16 @@ var LoginManagerContent = {
         return;
       }
 
       selectedLogin = matchingLogins[0];
     }
 
     // We will always have a selectedLogin at this point.
 
-    var didFillForm = false;
     if (autofillForm && !isFormDisabled) {
       // Fill the form
 
       if (usernameField) {
         // Don't modify the username field if it's disabled or readOnly so we preserve its case.
         let disabledOrReadOnly = usernameField.disabled || usernameField.readOnly;
 
         let userNameDiffers = selectedLogin.username != usernameField.value;
@@ -759,28 +758,27 @@ var LoginManagerContent = {
 
         if (!disabledOrReadOnly && !userEnteredDifferentCase && userNameDiffers) {
           usernameField.setUserInput(selectedLogin.username);
         }
       }
       if (passwordField.value != selectedLogin.password) {
         passwordField.setUserInput(selectedLogin.password);
       }
-      didFillForm = true;
     } else if (!autofillForm) {
       log("autofillForms=false but form can be filled; notified observers");
       recordAutofillResult(AUTOFILL_RESULT.NO_AUTOFILL_FORMS);
+      return;
     } else if (isFormDisabled) {
       log("autocomplete=off but form can be filled; notified observers");
       recordAutofillResult(AUTOFILL_RESULT.AUTOCOMPLETE_OFF);
+      return;
     }
 
-    if (didFillForm) {
-      recordAutofillResult(AUTOFILL_RESULT.FILLED);
-    }
+    recordAutofillResult(AUTOFILL_RESULT.FILLED);
   },
 
 };
 
 var LoginUtils = {
   /*
    * _getPasswordOrigin
    *