[CA][almay.com] The address dropdown and the autofill are not working for email, name and state fields
Categories
(Toolkit :: Form Autofill, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox118 | --- | affected |
People
(Reporter: ailea, Unassigned)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [fxcm-addr-compatibility])
Attachments
(1 file)
1.87 MB,
video/mp4
|
Details |
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
- Reach the Address form on https://www.almay.com
- Click on the email address field
- Click on the First Name field from the Shipping section
- Click on the First Name and Last Name from the Billing section
- 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
Comment 1•6 months ago
|
||
Three comments:
- 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.
- 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. - To investigate: why the autofill doesn't occur for the email field.
Comment 2•6 months ago
|
||
(In reply to Neil Deakin from comment #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:
-
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 -
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"
Comment 3•6 months ago
|
||
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.
Comment 4•6 months ago
•
|
||
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.
Comment 5•5 months ago
|
||
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.
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•3 months ago
|
Description
•