Closed Bug 1916983 Opened 2 months ago Closed 2 months ago

Improved formautofill regular expression matching heuristic

Categories

(Toolkit :: Form Autofill, task, P3)

task

Tracking

()

RESOLVED DUPLICATE of bug 1882842

People

(Reporter: dimi, Unassigned)

Details

Attachments

(1 obsolete file)

Problem
Our field matching heuristic operates on a 'first match wins' basis[1], meaning the first regex match always wins. This approach often causes issues that when a field actually will match multiple regexpression but we select the wrong one (first one)

Possible Solution
We could implement a more sophisticated heuristic that considers matches from all regular expression and then selects the most appropriate one based on context from surrounding fields. The problem is that this solution might be quite complicated

A Simplified Version of the Possible Solution
We could categorize our matches into "credit card" and "address" groups. A field could match a regex from both categories, but by default, we would still use the field name from the first match. However, if the field type of the previous field differs from the type of the first match, and given that fields of the same type are typically close together, we could use the field name from the "second" match instead.

Drawback
If there are both credit card and address sections in a form, we might use the wrong fieldn ame when the field is in the beginning of the second section

[1] https://searchfox.org/mozilla-central/rev/cc01f11adfacca9cd44a75fd140d2fdd8f9a48d4/toolkit/components/formautofill/shared/FormAutofillHeuristics.sys.mjs#886-903

This is just a protyotype

Status: NEW → RESOLVED
Closed: 2 months ago
Duplicate of bug: 1882842
Resolution: --- → DUPLICATE
Attachment #9422823 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: