Improve FormAutofillHeuristics.jsm
Categories
(Toolkit :: Form Autofill, task, P3)
Tracking
()
People
(Reporter: serg, Unassigned)
References
(Blocks 1 open bug)
Details
Let's walk over that file and see what can be improved, simplified or generalized.
Random thoughts:
- For example, RegExpListCache can be restructured a bit to deal with cache concern in one fn only.
- Perhaps there are more generic ways to specify patterns we are trying to classify sections.
- There is an overlap with
heuristicsRegexp.js
, there must be a way to remove copy/paste. - _parsePhoneFields() looks complicated, a lot of index based operations
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Something we can do for _getRegExpList
is simplify and/or remove the cache entirely.
An example of simplifying the _getRegExpList
:
const key = {
isAutoCompleteOff,
isAutofillCreditCardsAvailable: FormAutofill.isAutofillCreditCardsAvailable,
isSelectElem
};
let entry = this._regexpList.get(key);
if(!entry) {
entry = this._computeEntry(key);
this._regexpList.set(key, entry);
}
return entry;
In _parseAddressFields
we need to determine why we are using the "1" character in the various address-line regex and not using the "1" character in these same regexs in heuristicsRegexp.js
. Fathom may help handle this case in the future.
In _parsePhoneFields
we can simplify the function into more logical chunks in order to increase readability of the code. There's also the potential that Fathom could handle some of the lifting of the this function, thus simplifying the heuristics code.
Updated•3 years ago
|
Comment 2•3 years ago
|
||
The product::component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.
Reporter | ||
Updated•3 years ago
|
Description
•