author | Sean Lee <selee@mozilla.com> |
Wed, 20 Sep 2017 08:10:38 +0800 | |
changeset 381863 | 6918dea06b7bfb2bd6d26da1640cd0a0d6da341c |
parent 381862 | 8918870e7a2028ff664d553bb3c78e001160cf52 |
child 381864 | d78e78de5d8a271b12f869483b5e91dcb7b5a4e3 |
push id | 32542 |
push user | kwierso@gmail.com |
push date | Wed, 20 Sep 2017 21:07:55 +0000 |
treeherder | mozilla-central@319a34bea9e4 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | lchang |
bugs | 1400147 |
milestone | 57.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
browser/extensions/formautofill/FormAutofillHeuristics.jsm | file | annotate | diff | comparison | revisions |
--- a/browser/extensions/formautofill/FormAutofillHeuristics.jsm +++ b/browser/extensions/formautofill/FormAutofillHeuristics.jsm @@ -471,16 +471,33 @@ this.FormAutofillHeuristics = { "cc-name", "cc-number", "cc-exp-month", "cc-exp-year", "cc-exp", ]; let regexps = isAutoCompleteOff ? FIELDNAMES_IGNORING_AUTOCOMPLETE_OFF : Object.keys(this.RULES); + if (!FormAutofillUtils.isAutofillCreditCardsAvailable) { + if (isAutoCompleteOff) { + if (!this._regexpListOf_CcUnavailable_AcOff) { + this._regexpListOf_CcUnavailable_AcOff = regexps.filter(name => !FormAutofillUtils.isCreditCardField(name)); + } + regexps = this._regexpListOf_CcUnavailable_AcOff; + } else { + if (!this._regexpListOf_CcUnavailable_AcOn) { + this._regexpListOf_CcUnavailable_AcOn = regexps.filter(name => !FormAutofillUtils.isCreditCardField(name)); + } + regexps = this._regexpListOf_CcUnavailable_AcOn; + } + } + if (regexps.length == 0) { + return null; + } + let labelStrings; let getElementStrings = {}; getElementStrings[Symbol.iterator] = function* () { yield element.id; yield element.name; if (!labelStrings) { labelStrings = []; let labels = LabelUtils.findLabelElements(element);