Bug 1827771 - Clear the revealed state when input type is changed from password. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D175516
This commit is contained in:
Masatoshi Kimura
2023-04-15 02:30:35 +00:00
parent f79bfc7f38
commit b4394efbb8
2 changed files with 18 additions and 0 deletions

View File

@@ -4416,6 +4416,12 @@ void HTMLInputElement::HandleTypeChange(FormControlType aNewType,
fm->NeedsFlushBeforeEventHandling(this);
}
if (oldType == FormControlType::InputPassword &&
State().HasState(ElementState::REVEALED)) {
// Modify the state directly to avoid dispatching events.
RemoveStates(ElementState::REVEALED);
}
if (aNewType == FormControlType::InputFile ||
oldType == FormControlType::InputFile) {
if (aNewType == FormControlType::InputFile) {