Migrating the strings used by the edit dialogs also allows/requires for their migration elsewhere.
Some streamlining is applied to how autofillEditForms.js gets access to e.g. FormFillUtils methods, so that they are no longer routed via the XHTML files' script tags. The prior independence of this file from internal dependencies appears to have been in place to support its use as a part of the Payments API's UI, but that was dropped in bug 1721229.
The Fluent migration script included in this patch also covers changes from the immediately preceding patch.
The intl documentation change is a typo correction that was noticed while working on this patch.
Differential Revision: https://phabricator.services.mozilla.com/D155705
A new FTL file for the extension is added under `browser/preferences/` rather than `browser/extensions/formautofill/`, as the former is a more common location for FTL localizations, and the extension already relies on an FTL file hosted outside its own directory, `toolkit/payments/payments.ftl`.
The dialogs are not fully migrated in this patch, as some of the strings are shared with the edit dialogs and are migrated separately.
A Fluent migration for the localization changes applied here is included in the next patch after this one.
Differential Revision: https://phabricator.services.mozilla.com/D155478
Migrating the strings used by the edit dialogs also allows/requires for their migration elsewhere.
Some streamlining is applied to how autofillEditForms.js gets access to e.g. FormFillUtils methods, so that they are no longer routed via the XHTML files' script tags. The prior independence of this file from internal dependencies appears to have been in place to support its use as a part of the Payments API's UI, but that was dropped in bug 1721229.
The Fluent migration script included in this patch also covers changes from the immediately preceding patch.
The intl documentation change is a typo correction that was noticed while working on this patch.
Depends on D155478
Differential Revision: https://phabricator.services.mozilla.com/D155705
A new FTL file for the extension is added under `browser/preferences/` rather than `browser/extensions/formautofill/`, as the former is a more common location for FTL localizations, and the extension already relies on an FTL file hosted outside its own directory, `toolkit/payments/payments.ftl`.
The dialogs are not fully migrated in this patch, as some of the strings are shared with the edit dialogs and are migrated separately.
A Fluent migration for the localization changes applied here is included in the next patch after this one.
Differential Revision: https://phabricator.services.mozilla.com/D155478
In nightly and early beta, we still use 0.5 as the threshold so we can collect more data.
In release, use 0.95 as the threshold
Differential Revision: https://phabricator.services.mozilla.com/D155486
`parseFloat` returns NaN when we pass null to it.
Since we use "null" to distinguish the case when the pref is set or
not, this patch moves `parseFloat` inside the if statemenet so we only
call it when the pref is set.
Differential Revision: https://phabricator.services.mozilla.com/D154666
This makes it easier to get parity between legacy and regular flex
without having to either have tons of arbitrary attribute selectors in
the xul sheet, nor adding attribute lookup hacks to the html flexbox
layout.
Also, reimplement the remaining supported flex attribute-values (0 and 1)
purely in terms of CSS rules in xul.css (regardless of whether
emulate-moz-box-with-flex is enabled).
In practice these are pretty uncommon and the style attribute does the
trick in every case I've tried.
Add a debug-only assertion to ensure we preserve behavior for now.
Add a new test with another behavior difference between flexbox
emulation and old xul layout because the old reftest now passes. Use
replaced elements, which in modern flex are treated differently.
Differential Revision: https://phabricator.services.mozilla.com/D154394
This makes it easier to get parity between legacy and regular flex
without having to either have tons of arbitrary attribute selectors in
the xul sheet, nor adding attribute lookup hacks to the html flexbox
layout.
Also, reimplement the remaining supported flex attribute-values (0 and 1)
purely in terms of CSS rules in xul.css (regardless of whether
emulate-moz-box-with-flex is enabled).
In practice these are pretty uncommon and the style attribute does the
trick in every case I've tried.
Add a debug-only assertion to ensure we preserve behavior for now.
Add a new test with another behavior difference between flexbox
emulation and old xul layout because the old reftest now passes. Use
replaced elements, which in modern flex are treated differently.
Differential Revision: https://phabricator.services.mozilla.com/D154394
Before this patch, we consider credit card sections with only one cc-number
field to be valid sections ONLY IF its cc-number field has
"autocomplete=cc-number". In other words, if we infer the field is
a cc-number field because of our detection heuristic, the section
is considered to be invalid.
In this patch, we remove the "autocomplete=cc-number" constrain, which
means as long as a credit card section has a cc-number field, it is a
valid cc section.
Differential Revision: https://phabricator.services.mozilla.com/D151806
This rewrites the lazy getters, so that the lazy getter is defined at the call point, which makes it
easier for linters to understand what is being defined.
In some cases, the log is not being used, so the definition code is removed.
Differential Revision: https://phabricator.services.mozilla.com/D149716
Accessing control via `label.control` requires a call to native HTMLLabelElement::GetLabeledElement.
And for unmapped label case, we call
`this._unmappedLabels.filter(label => label.control == element);`
for every input element in the form. This means if a form has 10 labels
and 10 elements, a `identifyAutofillFields` call to the form may invoke up to 100 (10x10)
HTMLLabelElement::GetLabeledElement call.
This patch fixes this issue by storing the reference of the control elements in
`this._unmappedLabelControls` to reduce the number of HTMLLabelElement::GetLabeledElement calls
(10 HTMLLabelElement::GetLabeledElement calls in the foregoing example).
Differential Revision: https://phabricator.services.mozilla.com/D146669
The improvement includes:
1. Train the model with more en-US, fr-FR and de-DE samples
2. Add de-DE and fr-FR keywords
3. Remove nagative lookbehind and negative lookahead from regular
expressions.
4. Check <td> and <dd> when searching labels
5. Add rule to look at the closest label
6. Remove IsNotVisble rule from cc-number and cc-name ruleset
Differential Revision: https://phabricator.services.mozilla.com/D146791