зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1189396 part.6 IMEContentObserver shouldn't notify IME of selection change when the range isn't actually changed r=smaug
This commit is contained in:
Родитель
0ac9d740da
Коммит
121929fce3
|
@ -1086,6 +1086,7 @@ IMEContentObserver::SelectionChangeEvent::Run()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
SelectionChangeData lastSelChangeData = mIMEContentObserver->mSelectionData;
|
||||
if (NS_WARN_IF(!mIMEContentObserver->UpdateSelectionCache())) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1103,6 +1104,17 @@ IMEContentObserver::SelectionChangeEvent::Run()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// If the selection isn't changed actually, we shouldn't notify IME of
|
||||
// selection change.
|
||||
SelectionChangeData& newSelChangeData = mIMEContentObserver->mSelectionData;
|
||||
if (lastSelChangeData.IsValid() &&
|
||||
lastSelChangeData.mOffset == newSelChangeData.mOffset &&
|
||||
lastSelChangeData.String() == newSelChangeData.String() &&
|
||||
lastSelChangeData.GetWritingMode() == newSelChangeData.GetWritingMode() &&
|
||||
lastSelChangeData.mReversed == newSelChangeData.mReversed) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
IMENotification notification(NOTIFY_IME_OF_SELECTION_CHANGE);
|
||||
notification.SetData(mIMEContentObserver->mSelectionData,
|
||||
mCausedByComposition, mCausedBySelectionEvent);
|
||||
|
|
Загрузка…
Ссылка в новой задаче