Bug 1234120 part.1 IMEHandler should request all notifications which are requested by either IMMHander or TSFTextStore when IMM is available in TSF mode r=m_kato

This commit is contained in:
Masayuki Nakano 2015-12-22 14:58:48 +09:00
parent 563e7c94aa
commit 2cb5ab63e0
2 changed files with 15 additions and 1 deletions

View File

@ -71,6 +71,11 @@ struct nsIMEUpdatePreference final
{
}
nsIMEUpdatePreference operator|(const nsIMEUpdatePreference& aOther) const
{
return nsIMEUpdatePreference(aOther.mWantUpdates | mWantUpdates);
}
void DontNotifyChangesCausedByComposition()
{
mWantUpdates &= ~DEFAULT_CONDITIONS_OF_NOTIFYING_CHANGES;

View File

@ -334,7 +334,16 @@ IMEHandler::GetUpdatePreference()
#ifdef NS_ENABLE_TSF
if (IsTSFAvailable()) {
return TSFTextStore::GetIMEUpdatePreference();
if (!sIsIMMEnabled) {
return TSFTextStore::GetIMEUpdatePreference();
}
// Even if TSF is available, the active IME may be an IMM-IME.
// Unfortunately, changing the result of GetUpdatePreference() while an
// editor has focus isn't supported by IMEContentObserver nor
// ContentCacheInParent. Therefore, we need to request whole notifications
// which are necessary either IMMHandler or TSFTextStore.
return IMMHandler::GetIMEUpdatePreference() |
TSFTextStore::GetIMEUpdatePreference();
}
#endif //NS_ENABLE_TSF