Backed out changeset 71ef10fe925e (bug 1300996)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 07 Jun 2017 11:46:12 +0200
changeset 413147 a7bf7405ed8a99f8eaf05abd348a94bf4d0519e5
parent 413146 520ab29a56decd094c94005a44a32876b43538ed
child 413148 42e1d71558918e5b43d2bdd313a40cb096cf392a
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1300996
milestone55.0a1
backs out71ef10fe925e44b0b3e3ad10efeab9931d7bf39e
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
Backed out changeset 71ef10fe925e (bug 1300996)
browser/extensions/formautofill/FormAutofillHandler.jsm
--- a/browser/extensions/formautofill/FormAutofillHandler.jsm
+++ b/browser/extensions/formautofill/FormAutofillHandler.jsm
@@ -129,67 +129,18 @@ FormAutofillHandler.prototype = {
             option.selected = true;
             element.dispatchEvent(new Event("input", {"bubbles": true}));
             element.dispatchEvent(new Event("change", {"bubbles": true}));
             this.changeFieldState(fieldDetail, "AUTO_FILLED");
             break;
           }
         }
       }
-
-      // Unlike using setUserInput directly, FormFillController dispatches an
-      // asynchronous "DOMAutoComplete" event with an "input" event follows right
-      // after. So, we need to suppress the first "input" event fired off from
-      // focused input to make sure the latter change handler won't be affected
-      // by auto filling.
-      if (element === focusedInput) {
-        const suppressFirstInputHandler = e => {
-          if (e.isTrusted) {
-            e.stopPropagation();
-            element.removeEventListener("input", suppressFirstInputHandler);
-          }
-        };
-
-        element.addEventListener("input", suppressFirstInputHandler);
-      }
       element.previewValue = "";
     }
-
-    // Handle the highlight style resetting caused by user's correction afterward.
-    log.debug("register change handler for filled form:", this.form);
-    const onChangeHandler = e => {
-      let hasFilledFields;
-
-      if (!e.isTrusted) {
-        return;
-      }
-
-      for (let fieldDetail of this.fieldDetails) {
-        let element = fieldDetail.elementWeakRef.get();
-
-        if (!element) {
-          return;
-        }
-
-        if (e.target == element || (e.target == element.form && e.type == "reset")) {
-          this.changeFieldState(fieldDetail, "NORMAL");
-        }
-
-        hasFilledFields |= (fieldDetail.state == "AUTO_FILLED");
-      }
-
-      // Unregister listeners once no field is in AUTO_FILLED state.
-      if (!hasFilledFields) {
-        this.form.rootElement.removeEventListener("input", onChangeHandler);
-        this.form.rootElement.removeEventListener("reset", onChangeHandler);
-      }
-    };
-
-    this.form.rootElement.addEventListener("input", onChangeHandler);
-    this.form.rootElement.addEventListener("reset", onChangeHandler);
   },
 
   /**
    * Populates result to the preview layers with given profile.
    *
    * @param {Object} profile
    *        A profile to be previewed with
    */