Bug 1211352 part.4 PuppetWidget::GetIMEUpdatePreference() should request only position change notifications while a plugin has focus r=m_kato

This commit is contained in:
Masayuki Nakano 2015-10-10 10:21:02 +09:00
Родитель c892b229d9
Коммит ecbd3e99b6
2 изменённых файлов: 10 добавлений и 0 удалений

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

@ -647,6 +647,8 @@ NS_IMETHODIMP_(void)
PuppetWidget::SetInputContext(const InputContext& aContext,
const InputContextAction& aAction)
{
mInputContext = aContext;
#ifndef MOZ_CROSS_PROCESS_IME
return;
#endif
@ -737,6 +739,13 @@ PuppetWidget::GetIMEUpdatePreference()
// content event only with the parent process. Therefore, this process
// needs to receive a lot of information from the focused editor to sent
// the latest content to the parent process.
if (mInputContext.mIMEState.mEnabled == IMEState::PLUGIN) {
// But if a plugin has focus, we cannot receive text nor selection change
// in the plugin. Therefore, PuppetWidget needs to receive only position
// change event for updating the editor rect cache.
return nsIMEUpdatePreference(mIMEPreferenceOfParent.mWantUpdates |
nsIMEUpdatePreference::NOTIFY_POSITION_CHANGE);
}
return nsIMEUpdatePreference(mIMEPreferenceOfParent.mWantUpdates |
nsIMEUpdatePreference::NOTIFY_SELECTION_CHANGE |
nsIMEUpdatePreference::NOTIFY_TEXT_CHANGE |

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

@ -320,6 +320,7 @@ private:
mozilla::RefPtr<DrawTarget> mDrawTarget;
// IME
nsIMEUpdatePreference mIMEPreferenceOfParent;
InputContext mInputContext;
ContentCacheInChild mContentCache;
bool mNeedIMEStateInit;