зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1350264 - Allow users to re-enable form autofill feature after all populated fields were cleared manually, r=lchang
MozReview-Commit-ID: DG31YXJuT2t --HG-- extra : rebase_source : 2a027b4d8ccdf0b385454783901dece914003623
This commit is contained in:
Родитель
4a3a84f39f
Коммит
d309b485e7
|
@ -185,10 +185,11 @@ FormAutofillHandler.prototype = {
|
|||
hasFilledFields |= (fieldDetail.state == "AUTO_FILLED");
|
||||
}
|
||||
|
||||
// Unregister listeners once no field is in AUTO_FILLED state.
|
||||
// Unregister listeners and clear guid once no field is in AUTO_FILLED state.
|
||||
if (!hasFilledFields) {
|
||||
this.form.rootElement.removeEventListener("input", onChangeHandler);
|
||||
this.form.rootElement.removeEventListener("reset", onChangeHandler);
|
||||
this.filledProfileGUID = null;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -164,6 +164,18 @@ add_task(async function check_fallback_after_form_autofill() {
|
|||
checkMenuEntries(["1-234-567-890"]);
|
||||
});
|
||||
|
||||
// Resume form autofill once all the autofilled fileds are changed.
|
||||
add_task(async function check_form_autofill_resume() {
|
||||
document.querySelector("#tel").blur();
|
||||
document.querySelector("#form1").reset();
|
||||
await setInput("#tel", "");
|
||||
doKey("down");
|
||||
await expectPopup();
|
||||
checkMenuEntries(MOCK_STORAGE.map(address =>
|
||||
JSON.stringify({primary: address.tel, secondary: address["street-address"]})
|
||||
));
|
||||
});
|
||||
|
||||
registerPopupShownListener(popupShownListener);
|
||||
|
||||
</script>
|
||||
|
|
Загрузка…
Ссылка в новой задаче