зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1501376 - Part 1. Pasting into GeckoView briefly displays text content in password field. r=masayuki
When inputting any character in password field, character isn't masked immediately since echo password is turned on Android. But when pasting text, the text is masked immediately on Blink and Android OS. So we should adopt this behaviour on Gecko too. Differential Revision: https://phabricator.services.mozilla.com/D10530 --HG-- extra : rebase_source : b4bc026569e61fee697cb538719216fb258a11ae
This commit is contained in:
Родитель
379404ac50
Коммит
ad68faeb0f
|
@ -768,7 +768,7 @@ TextEditRules::WillInsertText(EditSubAction aEditSubAction,
|
|||
// manage the password buffer
|
||||
mPasswordText.Insert(*outString, start);
|
||||
|
||||
if (LookAndFeel::GetEchoPassword() && !DontEchoPassword()) {
|
||||
if (!DontEchoPassword()) {
|
||||
nsresult rv = HideLastPasswordInputInternal();
|
||||
mLastStart = start;
|
||||
mLastLength = outString->Length();
|
||||
|
@ -901,8 +901,7 @@ TextEditRules::WillSetText(bool* aCancel,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
if (IsPasswordEditor() && LookAndFeel::GetEchoPassword() &&
|
||||
!DontEchoPassword()) {
|
||||
if (IsPasswordEditor() && !DontEchoPassword()) {
|
||||
// Echo password timer will implement on InsertText.
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1865,7 +1864,19 @@ TextEditRules::IsMailEditor() const
|
|||
bool
|
||||
TextEditRules::DontEchoPassword() const
|
||||
{
|
||||
return mTextEditor ? mTextEditor->DontEchoPassword() : false;
|
||||
if (!mTextEditor) {
|
||||
// XXX Why do we use echo password if editor is null?
|
||||
return false;
|
||||
}
|
||||
if (!LookAndFeel::GetEchoPassword() || mTextEditor->DontEchoPassword()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mTextEditor->GetEditAction() != EditAction::eDrop &&
|
||||
mTextEditor->GetEditAction() != EditAction::ePaste) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче