Bug 1904593, don't clear the autofill state when modified by script, r=dom-core,credential-management-reviewers,dimi,sefeng
It turns out that many sites are modifying the field state immediately after a value has been autofilled, typically to format the value such as add spaces between parts of a credit card number Differential Revision: https://phabricator.services.mozilla.com/D215113
This commit is contained in:
@@ -7057,7 +7057,8 @@ void HTMLInputElement::OnValueChanged(ValueChangeKind aKind,
|
||||
if (aKind != ValueChangeKind::Internal) {
|
||||
mLastValueChangeWasInteractive = aKind == ValueChangeKind::UserInteraction;
|
||||
|
||||
if (State().HasState(ElementState::AUTOFILL)) {
|
||||
if (mLastValueChangeWasInteractive &&
|
||||
State().HasState(ElementState::AUTOFILL)) {
|
||||
RemoveStates(ElementState::AUTOFILL | ElementState::AUTOFILL_PREVIEW);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user