Closed Bug 1880450 Opened 7 months ago Closed 7 months ago

Do not use visiblity to filter out elements for autofilling, but use visibility check to classify sections

Categories

(Toolkit :: Form Autofill, task, P2)

task

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: dimi, Assigned: dimi)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxcm-addr-compatibility])

Attachments

(1 file, 1 obsolete file)

No description provided.
Whiteboard: [fxcm-addr-compatibility]

We introduced visibility/focusability check to filter out invisible or unfocusable elements
to address the following issues:

  1. Bug 1688209: The website's credit card form contains hidden credit card fields beneath the visible ones.

Example:
<input id="cc-number" autocomplete="cc-number">
<input id="hidden-cc-number" autocomplete="cc-number" hidden>.
<input id="cc-name" autocomplete="cc-name">

The issue occurs because when our heuristic encounters consecutive fields that should not appear multiple times in a row,
we divide them and treat them as separate sections. In this example, the
visible cc-number and visible cc-name are put in different sections so we don't autofill both of the fields at the same time.

  1. Bug 1822494: There is one hidden cc-exp-month field and one visible cc-exp field.

Example:
<input id="cc-exp" autocomplete="cc-exp">
<input id="hidden-cc-exp" autocomplete="cc-exp" hidden>.

When two cc-exp-* fields appear consecutively, our heuristic adjusts the first one to cc-exp-month and the second one to cc-exp-year.
However, in this bug, we should just honor the autocomplete attribute and do not change the field name

Bug 1753669: An invisible country field is located between tel-* fields.

Example:
<input id="country" autocomplete="country">
<input id="tel-area-code" autocomplete="tel-area-code">
<input id="hidden-country" autocomplete="country" hidden>
<input id="tel-local" autocomplete="tel-local">


When the heuristic sees the hidden country field, since it has already identified another country field previously,
our heuristic creates a new section upon encountering the invisible country field. This results that
we don't put tel-local field in the same section as the rest of the address fields.

However, introducing visibility and focusability checks also brings issues.

Some websites implement their own dropdowns for certain fields, like province, and include an invisible or unfocusable
field to store the value, as seen in Bug 1873202 and Bug 1836036.

We also see, in some cases, websites prefill certain address fields for users, and those fields are unfocusable.
For example, websites can use known-address data to determine the "state/province" field so users don't have to fill it.
But in these cases, we still want to identify this type of field so we can capture the data after users submit the form.

So, given the information collected so far, I think we should not filter out unfocusable or invisible elements before
running heuristics. Instead, we should adjust our heuristic to consider invisible elements in some cases. For example,
we should not create a new section upon encountering an invisible field, recognizing that it's common for websites to
place an invisible field near a visible field of the same type for various reasons.

Attachment #9380819 - Attachment is obsolete: true
Pushed by dlee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4834f2a068cc Do not use visiblity to filter out elements for autofilling, but use visibility check when classify sections r=credential-management-reviewers,jneuberger,issammani
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
Blocks: 1835753
Blocks: 1873202
Blocks: 1836036

Hi Ailea, Could you help verify Bug 1688209, Bug 1822494, and Bug 1753669 remain fixed after introducing this change? thank you!

Flags: needinfo?(ailea)

Hi Dimi,
I just verified all 3 bugs mentioned in comment 5 and I can confirm that all 3 issues remained fixed.

Flags: needinfo?(ailea)

(In reply to Alin Ilea, Desktop QA from comment #6)

Hi Dimi,
I just verified all 3 bugs mentioned in comment 5 and I can confirm that all 3 issues remained fixed.

Great, thank you!

Summary: Formautofill heuristic improvement → Do not use visiblity to filter out elements for autofilling, but use visibility check to classify sections
Blocks: 1887730
No longer blocks: 1887730
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: