Closed Bug 1687684 Opened 5 years ago Closed 4 years ago

[UK][next.co.uk] Cardholder Name is not autofilled due to site prefill

Categories

(Toolkit :: Form Autofill, defect, P2)

Desktop
All
defect

Tracking

()

VERIFIED FIXED
93 Branch
Tracking Status
firefox84 --- disabled
firefox85 --- disabled
firefox86 --- disabled
firefox93 --- verified

People

(Reporter: tbabos, Assigned: tgiles)

References

(Blocks 3 open bugs, Regression, )

Details

Attachments

(4 files, 1 obsolete file)

Affected Versions:

  • All latest Firefox versions using force enable (Nightly 86, Beta RC 85.0, Release 84.0.2)

Tested on:

  • MacOS 10.15
  • Windows 10 x64

Prerequisites:

  • browser.search.region UK
  • extensions.formautofill.supportedCountries UK
  • download latest Firefox Nightly with region locale (switch extensions.formautofill.available to "on" for testing non-Nightly builds)

Steps to Reproduce:

  1. Launch Firefox
  2. Go to and reach the payment form next.co.uk
  3. Using autofill feature, fill in 1 saved CC entry - observe Bug 1
  4. Fill in manually new CC info and submit the form - observe Bug 2

Expected Results:

  1. Selecting a saved CC entry from the dropdown should will in all fields (even site prefilled ones)
  2. Submitting the form with new CC info should trigger the Credit Card save doorhanger

Actual Results:

  1. Bug 1: Cardholder name is not autofilled
  2. Bug 2: CC save doorhanger is not displayed upon form submission

Notes:

  • Severity: S3 severity, due to lack of Save doorhanger
  • Reproducible on Chrome?: No for both issues
  • Regression-range: reproducible on all latest versions, this site was never tested before, can look for regression-range if need be
  • issue with identifying a name field, or we ignore it due to prefilled text
Priority: -- → P2
Blocks: 1720546
No longer blocks: 1720546

Renaming this bug as the CC save doorhanger not appearing is not due to the cardholder name issue in this bug.

Summary: [UK][next.co.uk] Cardholder Name is not autofilled due to site prefill and CC save doorhanger is not displayed → [UK][next.co.uk] Cardholder Name is not autofilled due to site prefill

Since the cardholder name is filled by the site, we won't autofill the cardholder name because it already has a value. I'm not sure how we're going to handle this case without accidentally autofilling...as checking if the element has a value before filling is how we prevent manual entries from being overwritten since autocomplete and autofill both use this autofillFields function.

Attached file reproducible example (obsolete) —

Attaching a complete web page that reproduces the bug. Should make solving the bug a little quicker than having to create a test account on this site and all that.

See Also: → 1688609
Assignee: nobody → tgiles
Status: NEW → ASSIGNED
Attachment #9231220 - Attachment is obsolete: true

Enables autofilling into fields that may have been filled by the site.
Enables autofill preview to work as expected if a field already has a value.
Ensures autofill does not restore the default value if the user manually clears out the field's value.

This fixes the case on next.co.uk where the value of the cardholder name is being used as a placeholder.

Hi Emilio,
Needinfo here in case you didn't see the ping in the phabricator.
https://phabricator.services.mozilla.com/D123260#inline-682663

Flags: needinfo?(emilio)

Thanks, yeah, pings in phab are so easy to miss.

If we always want to have the value hidden if we set a previewValue, then I think we want to change this selector to be:

:not(:-moz-autofill-preview)::-moz-text-control-editing-root,
...

And that'd be a simpler fix. Note that the user wouldn't be able to type while the preview is on, but perhaps that's reasonable as IIUC the preview is only temporary?

Flags: needinfo?(emilio)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #8)

:not(:-moz-autofill-preview)::-moz-text-control-editing-root,
...

And that'd be a simpler fix. Note that the user wouldn't be able to type while the preview is on, but perhaps that's reasonable as IIUC the preview is only temporary?

Thank you for the help! Yes, the preview is only temporary.

Hi Tim, could you help test what Emilio suggested? thanks!

Flags: needinfo?(tgiles)

I agree that the user not being able to type is perfectly reasonable since previewed text is temporary. I'll test out that selector change and see what happens.

Flags: needinfo?(tgiles)

Hmm, adding that selector won't make the difference we need for this bug unfortunately. While adding the :not(:-moz-autofill-preview)::-moz-text-control-editing-root selector does solve the preview value overlapping the actual value, form autofill still needs to remove the "placeholder" value from the field in order for autofill to work as expected. Otherwise the preview will show that the prefilled value will be autofilled...but then does not actually autofill over the prefilled value.

I suppose I can keep the selector change, since modifying a field while previewing seems like something we shouldn't allow anyway.

Blocks: 1728663
Blocks: 1728812
Pushed by tgiles@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1d81d6c502d9 Always hide the value of a field when previewing form fields. r=emilio https://hg.mozilla.org/integration/autoland/rev/bdf61151a654 Fix credit card autofill not working due to site prefilling fields. r=dimi,sfoster
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch

Verified-fixed on the latest Firefox Nightly 93.0a1 (2021-09-05) (64-bit) on macOS 10.15.
Although the Cardholder Name is pre-filled by the site, it will be correctly auto-filled and the autofill dropdown can be toggled from this field.

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

Attachment

General

Created:
Updated:
Size: