Bug 1401657 - Make editor value changes always notify. r=masayuki

Not doing so is unsound in some cases, see the two referenced bugs.

Differential Revision: https://phabricator.services.mozilla.com/D66697
This commit is contained in:
Emilio Cobos Álvarez
2020-03-13 02:29:48 +00:00
parent b3ea564be0
commit 7ff0856a8d
8 changed files with 20 additions and 35 deletions

View File

@@ -1112,7 +1112,7 @@ void HTMLTextAreaElement::InitializeKeyboardEventListeners() {
mState->InitializeKeyboardEventListeners();
}
void HTMLTextAreaElement::OnValueChanged(bool aNotify, ValueChangeKind aKind) {
void HTMLTextAreaElement::OnValueChanged(ValueChangeKind aKind) {
if (aKind != ValueChangeKind::Internal) {
mLastValueChangeWasInteractive = aKind == ValueChangeKind::UserInteraction;
}
@@ -1123,9 +1123,8 @@ void HTMLTextAreaElement::OnValueChanged(bool aNotify, ValueChangeKind aKind) {
UpdateTooShortValidityState();
UpdateValueMissingValidityState();
if (validBefore != IsValid() ||
HasAttr(kNameSpaceID_None, nsGkAtoms::placeholder)) {
UpdateState(aNotify);
if (validBefore != IsValid() || HasAttr(nsGkAtoms::placeholder)) {
UpdateState(true);
}
}