Open Bug 1730016 Opened 2 years ago Updated 1 year ago

[meta] Redesign how we search for credit card fields in forms


(Toolkit :: Form Autofill, enhancement)





(Reporter: tgiles, Unassigned)


(Depends on 8 open bugs, Blocks 3 open bugs)


(Keywords: meta, Whiteboard: [fxcm-redesign-searching-for-fields])

Due to certain patterns on the web, our current "searching for fields" process will not work as expected. This could be due to a myriad of reasons:

  1. Form has duplicate credit card fields, some of which are visibly hidden.
    Our current logic will determine that these hidden fields are the fields we should be filling into. If the website doesn't have some kind of sync between hidden and visible fields, then we aren't helping people get through the payment process. See Bug 1684938, Bug 1688576 and Bug 1727701 as examples.

Calculating visibility of a field can be a very expensive operation, and so solving this will result in compromises between completeness and performance. See Bug 1247245 for more thoughts on this process, specifically Comment #6.

  1. There are nested forms/nested iframes on a payment page.
    Our current logic will find the nearest form ancestor for an element in order to determine what fields should be considered a "credit card section" (and address section, to be clear). Since the nearest form isn't the "root" form in these cases, we will fail to successfully determine credit card sections and not help people get through the payment process.

Additionally in this case, this nested form will break our other logic and potentially prevent the other credit card fields from being considered valid. In Bug 1682161, the nested form has the cc-number field as a child element. This prevents the cc-number field from being considered as part of the "other" credit card section, but will also prevent any other credit card section from being valid! This is because of the "isValidSection()" check needing a cc-number field in order to be valid.

  1. A field has an ID that contains text that better matches address or other credit card field type.
    In Bug 1682161, there are two fields that have IDs that contain "Ecom_BillTo_Postal_Name_". In the current logic, we parse phone fields, then address fields, then credit card fields. When we parse phone fields, we also try to find matches for the field name if the field doesn't already have an autocomplete attribute. Unfortunately, in the current order, we check for postal codes before cc-name fields. Due to this, we end up matching these name fields as postal code fields and not name fields!

  2. The credit card number field is split into four separate sections.
    Our current logic will not handle duplicate credit card number fields and prevent the autocomplete popup from appearing from all but the last one (as long as there are other valid cc fields following the last cc-number field). See Bug 1688607 for an example. We will need a way to determine if there are multiple cc-number fields and aggregate them into the credit card section, as well as change the filling logic so that each cc-number field receives the correct four digits of the credit card.

Keywords: meta
Depends on: 1688206
Depends on: 1688618
Depends on: 1688619
Blocks: 1657900
Blocks: 1688604
Whiteboard: [fxcm-redesign-searching-for-fields]
Blocks: 1452605
Depends on: 1775458
Depends on: 1775468
Depends on: 1786964
You need to log in before you can comment on or make changes to this bug.