Bug 1234120 part.2 TSFTextStore should ignore unnecessary text and selection changes which are caused by composition r=m_kato

This commit is contained in:
Masayuki Nakano 2015-12-22 14:58:48 +09:00
parent 2cb5ab63e0
commit d586464951

View File

@ -4567,6 +4567,12 @@ TSFTextStore::OnTextChangeInternal(const IMENotification& aIMENotification)
GetSinkMaskNameStr(mSinkMask).get(),
GetBoolName(mComposition.IsComposing())));
if (textChangeData.mCausedByComposition) {
// Ignore text change notifications caused by composition since it's
// already been handled internally.
return NS_OK;
}
mDeferNotifyingTSF = false;
if (IsReadLocked()) {
@ -4653,6 +4659,12 @@ TSFTextStore::OnSelectionChangeInternal(const IMENotification& aIMENotification)
GetBoolName(mIsRecordingActionsWithoutLock),
GetBoolName(mComposition.IsComposing())));
if (selectionChangeData.mCausedByComposition) {
// Ignore selection change notifications caused by composition since it's
// already been handled internally.
return NS_OK;
}
mDeferNotifyingTSF = false;
// A compositionstart event handler can change selection before actually