Bug 1360162 - Don't call UpdateOverlayTextVisibility twice by input.value setter when input element has focus. r=masayuki

When editor has focus, input.value setter will call UpdateOverlayTextVisibility via nsTextInputListener::EditAction -> nsTextControlFrame::SetValueChanged at first.  But SetValue will call UpdateOverlayTextVisibility again via ValueWasChanged.

So it is unnecessary to call UpdateOverlayTextVisibility on nsTextEditorState::SetValue when we have the editor.

MozReview-Commit-ID: Hw3Bh64Euo6

--HG--
extra : rebase_source : f33132e668fff48230f79990802a3d7e23e85207
This commit is contained in:
Makoto Kato 2017-06-21 13:10:58 +09:00
Родитель 2b19da6e08
Коммит 19d01399e6
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -2695,6 +2695,11 @@ nsTextEditorState::SetValue(const nsAString& aValue, const nsAString* aOldValue,
mTextListener->SetValueChanged(true);
mTextListener->SettingValue(false);
if (!notifyValueChanged) {
// Listener doesn't update frame, but it is required for placeholder
ValueWasChanged(true);
}
}
if (!weakFrame.IsAlive()) {
@ -2757,11 +2762,11 @@ nsTextEditorState::SetValue(const nsAString& aValue, const nsAString* aOldValue,
props.SetIsDirty();
}
}
}
// If we've reached the point where the root node has been created, we
// can assume that it's safe to notify.
ValueWasChanged(!!mRootNode);
// If we've reached the point where the root node has been created, we
// can assume that it's safe to notify.
ValueWasChanged(!!mRootNode);
}
mTextCtrlElement->OnValueChanged(/* aNotify = */ !!mRootNode,
/* aWasInteractiveUserChange = */ false);