Closed Bug 1849122 Opened 1 year ago Closed 4 months ago

[CA][ca.boohoo.com] The Address dropdown is not displayed and the autofill is not working for none of the fields after clearing the form once

Categories

(Toolkit :: Form Autofill, task)

Firefox 118
Desktop
All
task

Tracking

()

VERIFIED FIXED
128 Branch
Tracking Status
firefox118 --- wontfix
firefox128 --- verified

People

(Reporter: ailea, Assigned: enndeakin)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [fxcm-addr-compatibility])

Attachments

(4 files)

Attached video 2023-08-17_12h32_40.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://ca.boohoo.com
  2. Click on any Address field and select any Address entry from the dropdown
  3. Click on any field and choose the Clear Form option
  4. Click on any Shipping Information section field
  5. Click on any Shipping section field

Expected result

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

Actual result

  • The address autofill dropdown is not displayed for none of the fields after step 3, after clearing the form. For the form section (Shipping Information), the dropdown is not displayed at all and for the second section (Shipping), the Clear Form dropdown is displayed even if the fields are already empty.

Regression range

  • N/A

Aditional Notes

The issue here is that the page hides the address form elements when the form is cleared, however the autofill highlight state is only cleared in response to an input event. Because the form element is hidden, the event will not fire. We should instead be explicitly resetting the form highlight state when clearing a form field.

Whiteboard: fxcm-addr-compatibility
Whiteboard: fxcm-addr-compatibility → [fxcm-addr-compatibility]
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Blocks: 1359355

The existing autofill state is set on the form element using nsIDOMWindowUtils::AddManuallyManagedState, but a separate map #filledStateByElement within FormAutofillHandler.sys.mjs is used to keep track of which elements are filled in. However, this relies on input events that don't fire when form elements are hidden. In addition, when a page modifies the form field value directly, the preview state can be modified but the #filledStateByElement map is not.

Instead, remove the extra map, and just use the form field's autofill state directly. The form field will take responsibility for removing the preview state when its value changes.

This behaviour applies to single field input elements and select elements.

Depends on D210999

Attachment #9402898 - Attachment description: WIP: Bug 1849122, allowing getting and modifying the autofill state directly within the input and select elements, and reset this state when its value changes. → Bug 1849122, allowing getting and modifying the autofill state directly within the input and select elements, and reset this state when its value changes, r=#dom-core
Attachment #9402899 - Attachment description: WIP: Bug 1849122, set the autofill state directly on the input and select elements rather than using windowUtils and a separate hash that can be out of sync with each other, r=#credential-management-reviewers → Bug 1849122, set the autofill state directly on the input and select elements rather than using windowUtils and a separate hash that can be out of sync with each other, r=#credential-management-reviewers
Pushed by neil@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ce62044e34cc
allowing getting and modifying the autofill state directly within the input and select elements, and reset this state when its value changes, r=webidl,emilio
https://hg.mozilla.org/integration/autoland/rev/c7c873318c54
set the autofill state directly on the input and select elements rather than using windowUtils and a separate hash that can be out of sync with each other, r=credential-management-reviewers,dimi
https://hg.mozilla.org/integration/autoland/rev/8bb1cc02549c
tests for when a form field is modified using script or by the user when it is autofilled, and additional tests for when the form fields are hidden and modified, r=credential-management-reviewers,dimi
Regressions: 1899451
See Also: → 1899559
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
Regressions: 1904593

Verified - Fixed in Release 128, Beta 129.0b3 and Nightly 130.0a1 (2024-07-15).

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: