Bug 1577005 - [4.1] Fix inconsistent naming. r=geckoview-reviewers,agi
authorEugen Sawin <esawin@me73.com>
Fri, 15 Nov 2019 15:49:10 +0000
changeset 502192 f1815ce6163ae0d87e38b0690ef659f6d6a10767
parent 502191 a69b9ff498cd1774ac76af6071e2022a3ea742e5
child 502193 3aa81d10fb7e357d4704556aa0adc550ca6d2f60
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, agi
bugs1577005
milestone72.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 1577005 - [4.1] Fix inconsistent naming. r=geckoview-reviewers,agi Differential Revision: https://phabricator.services.mozilla.com/D51923
mobile/android/modules/geckoview/GeckoViewAutofill.jsm
--- a/mobile/android/modules/geckoview/GeckoViewAutofill.jsm
+++ b/mobile/android/modules/geckoview/GeckoViewAutofill.jsm
@@ -19,20 +19,20 @@ XPCOMUtils.defineLazyModuleGetters(this,
   LoginManagerChild: "resource://gre/modules/LoginManagerChild.jsm",
 });
 
 const { debug, warn } = GeckoViewUtils.initLogging("Autofill"); // eslint-disable-line no-unused-vars
 
 class GeckoViewAutofill {
   constructor(aEventDispatcher) {
     this._eventDispatcher = aEventDispatcher;
-    this._autoFillId = 0;
-    this._autoFillElements = undefined;
-    this._autoFillInfos = undefined;
-    this._autoFillTasks = undefined;
+    this._autofillId = 0;
+    this._autofillElements = undefined;
+    this._autofillInfos = undefined;
+    this._autofillTasks = undefined;
   }
 
   /**
    * Process an auto-fillable form and send the relevant details of the form
    * to Java. Multiple calls within a short time period for the same form are
    * coalesced, so that, e.g., if multiple inputs are added to a form in
    * succession, we will only perform one processing pass. Note that for inputs
    * without forms, FormLikeFactory treats the document as the "form", but
@@ -40,26 +40,26 @@ class GeckoViewAutofill {
    *
    * @param aFormLike A FormLike object produced by FormLikeFactory.
    */
   addElement(aFormLike) {
     this._addElement(aFormLike, /* fromDeferredTask */ false);
   }
 
   _getInfo(aElement, aParent, aRoot, aUsernameField) {
-    let info = this._autoFillInfos.get(aElement);
+    let info = this._autofillInfos.get(aElement);
     if (info) {
       return info;
     }
 
     const window = aElement.ownerGlobal;
     const bounds = aElement.getBoundingClientRect();
 
     info = {
-      id: ++this._autoFillId,
+      id: ++this._autofillId,
       parent: aParent,
       root: aRoot,
       tag: aElement.tagName,
       type: aElement instanceof window.HTMLInputElement ? aElement.type : null,
       value: aElement.value,
       editable:
         aElement instanceof window.HTMLInputElement &&
         [
@@ -95,44 +95,44 @@ class GeckoViewAutofill {
         bottom: bounds.bottom,
       },
     };
 
     if (aElement === aUsernameField) {
       info.autofillhint = "username"; // AUTOFILL.HINT.USERNAME
     }
 
-    this._autoFillInfos.set(aElement, info);
-    this._autoFillElements.set(info.id, Cu.getWeakReference(aElement));
+    this._autofillInfos.set(aElement, info);
+    this._autofillElements.set(info.id, Cu.getWeakReference(aElement));
     return info;
   }
 
   _updateInfoValues(aElements) {
-    if (!this._autoFillInfos) {
+    if (!this._autofillInfos) {
       return;
     }
 
     const updated = [];
     for (const element of aElements) {
-      const info = this._autoFillInfos.get(element);
+      const info = this._autofillInfos.get(element);
       if (!info || info.value === element.value) {
         continue;
       }
       debug`Updating value ${info.value} to ${element.value}`;
 
       info.value = element.value;
-      this._autoFillInfos.set(element, info);
+      this._autofillInfos.set(element, info);
       updated.push(info);
     }
     return updated;
   }
 
   _addElement(aFormLike, aFromDeferredTask) {
     let task =
-      this._autoFillTasks && this._autoFillTasks.get(aFormLike.rootElement);
+      this._autofillTasks && this._autofillTasks.get(aFormLike.rootElement);
     if (task && !aFromDeferredTask) {
       // We already have a pending task; cancel that and start a new one.
       debug`Canceling previous auto-fill task`;
       task.disarm();
       task = null;
     }
 
     if (!task) {
@@ -140,30 +140,30 @@ class GeckoViewAutofill {
         // Canceled before we could run the task.
         debug`Auto-fill task canceled`;
         return;
       }
       // Start a new task so we can coalesce adding elements in one batch.
       debug`Deferring auto-fill task`;
       task = new DeferredTask(() => this._addElement(aFormLike, true), 100);
       task.arm();
-      if (!this._autoFillTasks) {
-        this._autoFillTasks = new WeakMap();
+      if (!this._autofillTasks) {
+        this._autofillTasks = new WeakMap();
       }
-      this._autoFillTasks.set(aFormLike.rootElement, task);
+      this._autofillTasks.set(aFormLike.rootElement, task);
       return;
     }
 
     debug`Adding auto-fill ${aFormLike.rootElement.tagName}`;
 
-    this._autoFillTasks.delete(aFormLike.rootElement);
+    this._autofillTasks.delete(aFormLike.rootElement);
 
-    if (!this._autoFillInfos) {
-      this._autoFillInfos = new WeakMap();
-      this._autoFillElements = new Map();
+    if (!this._autofillInfos) {
+      this._autofillInfos = new WeakMap();
+      this._autofillElements = new Map();
     }
 
     const window = aFormLike.rootElement.ownerGlobal;
     // Get password field to get better form data via LoginManagerChild.
     let passwordField;
     for (const field of aFormLike.elements) {
       if (
         ChromeUtils.getClassName(field) === "HTMLInputElement" &&
@@ -204,17 +204,17 @@ class GeckoViewAutofill {
         // `responses` is an object with IDs as keys.
         debug`Performing auto-fill ${Object.keys(responses)}`;
 
         const AUTOFILL_STATE = "-moz-autofill";
         const winUtils = window.windowUtils;
 
         for (const id in responses) {
           const entry =
-            this._autoFillElements && this._autoFillElements.get(+id);
+            this._autofillElements && this._autofillElements.get(+id);
           const element = entry && entry.get();
           const value = responses[id] || "";
 
           if (
             element instanceof window.HTMLInputElement &&
             !element.disabled &&
             element.parentElement
           ) {
@@ -251,17 +251,17 @@ class GeckoViewAutofill {
    * Called when an auto-fillable field is focused or blurred.
    *
    * @param aTarget Focused element, or null if an element has lost focus.
    */
   onFocus(aTarget) {
     debug`Auto-fill focus on ${aTarget && aTarget.tagName}`;
 
     const info =
-      aTarget && this._autoFillInfos && this._autoFillInfos.get(aTarget);
+      aTarget && this._autofillInfos && this._autofillInfos.get(aTarget);
     if (!aTarget || info) {
       this._eventDispatcher.dispatch("GeckoView:OnAutofillFocus", info);
     }
   }
 
   commitAutofill(aFormLike) {
     if (!aFormLike) {
       throw new Error("null-form on autofill commit");
@@ -287,19 +287,19 @@ class GeckoViewAutofill {
   }
 
   /**
    * Clear all tracked auto-fill forms and notify Java.
    */
   clearElements() {
     debug`Clearing auto-fill`;
 
-    this._autoFillTasks = undefined;
-    this._autoFillInfos = undefined;
-    this._autoFillElements = undefined;
+    this._autofillTasks = undefined;
+    this._autofillInfos = undefined;
+    this._autofillElements = undefined;
 
     this._eventDispatcher.sendRequest({
       type: "GeckoView:ClearAutofill",
     });
   }
 
   /**
    * Scan for auto-fillable forms and add them if necessary. Called when a page