summaryrefslogtreecommitdiffstats
path: root/toolkit/components/formautofill/FormAutofillChild.ios.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /toolkit/components/formautofill/FormAutofillChild.ios.sys.mjs
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/formautofill/FormAutofillChild.ios.sys.mjs')
-rw-r--r--toolkit/components/formautofill/FormAutofillChild.ios.sys.mjs14
1 files changed, 13 insertions, 1 deletions
diff --git a/toolkit/components/formautofill/FormAutofillChild.ios.sys.mjs b/toolkit/components/formautofill/FormAutofillChild.ios.sys.mjs
index 1aa713b5b7..3183319fd9 100644
--- a/toolkit/components/formautofill/FormAutofillChild.ios.sys.mjs
+++ b/toolkit/components/formautofill/FormAutofillChild.ios.sys.mjs
@@ -6,6 +6,7 @@
import { FormAutofillUtils } from "resource://gre/modules/shared/FormAutofillUtils.sys.mjs";
import { FormStateManager } from "resource://gre/modules/shared/FormStateManager.sys.mjs";
import { CreditCardRecord } from "resource://gre/modules/shared/CreditCardRecord.sys.mjs";
+import { AddressRecord } from "resource://gre/modules/shared/AddressRecord.sys.mjs";
export class FormAutofillChild {
/**
@@ -77,7 +78,7 @@ export class FormAutofillChild {
this._doIdentifyAutofillFields(element);
}
- onSubmit(evt) {
+ onSubmit(_event) {
if (!this.fieldDetailsManager.activeHandler) {
return;
}
@@ -100,6 +101,17 @@ export class FormAutofillChild {
}
fillFormFields(payload) {
+ // In iOS, we have access only to valid fields (https://github.com/mozilla/application-services/blob/9054db4bb5031881550ceab3448665ef6499a706/components/autofill/src/autofill.udl#L59-L76) for an address;
+ // all additional data must be computed. On Desktop, computed fields are handled in FormAutofillStorageBase.sys.mjs at the time of saving. Ideally, we should centralize
+ // all transformations, computations, and normalization processes within AddressRecord.sys.mjs to maintain a unified implementation across both platforms.
+ // This will be addressed in FXCM-810, aiming to simplify our data representation for both credit cards and addresses.
+ if (
+ FormAutofillUtils.isAddressField(
+ this.fieldDetailsManager.activeFieldDetail?.fieldName
+ )
+ ) {
+ AddressRecord.computeFields(payload);
+ }
this.fieldDetailsManager.activeHandler.autofillFormFields(payload);
}
}