Open Bug 1849137 Opened 1 year ago Updated 3 months ago

[CA][almay.com] The address dropdown and the autofill are not working for email, name and state fields

Categories

(Toolkit :: Form Autofill, task, P3)

Firefox 118
Desktop
All
task

Tracking

()

Tracking Status
firefox118 --- affected

People

(Reporter: ailea, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [fxcm-addr-compatibility])

Attachments

(1 file)

Attached video 2023-08-17_14h56_59.mp4

Found in

  • 118.0a1

Affected versions

  • 118.0a1

Tested platforms

  • Affected platforms: Windows 10

Preconditions

  • browser.search.region = CA
  • Have at least one Address already saved

Steps to reproduce

  1. Reach the Address form on https://www.almay.com
  2. Click on the email address field
  3. Click on the First Name field from the Shipping section
  4. Click on the First Name and Last Name from the Billing section
  5. Click on the City field on any section and select an address from the dropdown

Expected result

  • The address dropdown should be displayed for all the eligible fields and all the fields should be autofilled.

Actual result

  • The address dropdown is not displayed for the email field, First Name field from the Shipping section and First Name and Last Name from the Billing section. Also, the State field (dropdown) is not autofilled.

Regression range

  • N/A

Aditional Notes

Three comments:

  1. The site almay.com doesn't seem to support non-US addresses. Is the region for this bug incorrect? The site does fill in the state correctly when a US state is available.
  2. Both the first name and last name input fields have the same form field name 'shippingFirstName'. The field that is intended to
    be the last name field is filled in with the first name instead. Despite the web site error, Chrome fills the names in correctly. Perhaps we should handle this case by using the first field with that name as the first name, and if there is a second field, use it for the last name. It is a likely a bit of code to add for this edge case however. The billing section works correctly for me.
  3. To investigate: why the autofill doesn't occur for the email field.

(In reply to Neil Deakin from comment #1)

  1. Both the first name and last name input fields have the same form field name 'shippingFirstName'. The field that is intended to
    be the last name field is filled in with the first name instead. Despite the web site error, Chrome fills the names in correctly. Perhaps we should handle this case by using the first field with that name as the first name, and if there is a second field, use it for the last name. It is a likely a bit of code to add for this edge case however. The billing section works correctly for me.

Hi Neil, do you mean we do recognize both the name fields, but we treat both of them as "name" instead of "given name" & "family name"?
If yes, there are two solutions for this issue:

  1. Check the markup to see if we are able to classify the first name and last name correctly by adding missing keywords in
    https://searchfox.org/mozilla-central/rev/0e9ea50a999420d93df0e4e27094952af48dd3b8/toolkit/components/formautofill/shared/HeuristicsRegExp.sys.mjs

  2. Add a _parseNameFields in https://searchfox.org/mozilla-central/rev/0e9ea50a999420d93df0e4e27094952af48dd3b8/toolkit/components/formautofill/shared/FormAutofillHeuristics.sys.mjs#564-570 that when we see consecutive two "name" fields, we update them to "given-name" and "family-name"

Yes, we treat both fields as 'given-name'. If I manually modify the second form field to be 'shippingLastName' instead, then autofill works for the both name fields correctly.

The id and placeholder attributes on both fields is correct, just the name is incorrect.

Originally i thought if we see two same consecutive name fields ("name, name", "given-name, given-name", or "family-name, family-name"), we could just update the two fields to "given-name" and "family-name". But then i realized that this will not work for countries that put "family-name" before "given-name". I'll have to think about whether there is a better solution.

One approach we might consider is when we see consecutive name fields are identified with the same field name, such as first name + first name or last name + last name. We could treat the two name fields as name-1 and name-2. During the capturing or autofilling process, we could first check if the captured or autofilled name is a CJK name. If it is a CJK name, we would treat name-1 as the family name and name-2 as the given name. Conversely, if it is not a CJK name, we would treat name-1 as the given name and name-2 as the family name.

Whiteboard: fxcm-addr-compatibility
Whiteboard: fxcm-addr-compatibility → [fxcm-addr-compatibility]
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: