Bug 1323429 - [1.1] Don't verify IME root content with e10s enabled. r=jchen
This commit is contained in:
@@ -2763,12 +2763,19 @@ nsWindow::GeckoViewSupport::FlushIMEChanges(FlushChangesFlag aFlags)
|
|||||||
nsCOMPtr<nsIContent> imeRoot;
|
nsCOMPtr<nsIContent> imeRoot;
|
||||||
|
|
||||||
// If we are receiving notifications, we must have selection/root content.
|
// If we are receiving notifications, we must have selection/root content.
|
||||||
MOZ_ALWAYS_SUCCEEDS(IMEStateManager::GetFocusSelectionAndRoot(
|
nsresult rv = IMEStateManager::GetFocusSelectionAndRoot(
|
||||||
getter_AddRefs(imeSelection), getter_AddRefs(imeRoot)));
|
getter_AddRefs(imeSelection), getter_AddRefs(imeRoot));
|
||||||
|
|
||||||
|
// With e10s enabled, GetFocusSelectionAndRoot will fail because the IME
|
||||||
|
// content observer is out of process.
|
||||||
|
const bool e10sEnabled = rv == NS_ERROR_NOT_AVAILABLE;
|
||||||
|
if (!e10sEnabled) {
|
||||||
|
MOZ_ALWAYS_SUCCEEDS(rv);
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure we still have a valid selection/root. We can potentially get
|
// Make sure we still have a valid selection/root. We can potentially get
|
||||||
// a stale selection/root if the editor becomes hidden, for example.
|
// a stale selection/root if the editor becomes hidden, for example.
|
||||||
NS_ENSURE_TRUE_VOID(imeRoot->IsInComposedDoc());
|
NS_ENSURE_TRUE_VOID(e10sEnabled || imeRoot->IsInComposedDoc());
|
||||||
|
|
||||||
RefPtr<nsWindow> kungFuDeathGrip(&window);
|
RefPtr<nsWindow> kungFuDeathGrip(&window);
|
||||||
window.UserActivity();
|
window.UserActivity();
|
||||||
@@ -2817,7 +2824,7 @@ nsWindow::GeckoViewSupport::FlushIMEChanges(FlushChangesFlag aFlags)
|
|||||||
change.mNewEnd - change.mStart);
|
change.mNewEnd - change.mStart);
|
||||||
window.DispatchEvent(&event);
|
window.DispatchEvent(&event);
|
||||||
NS_ENSURE_TRUE_VOID(event.mSucceeded);
|
NS_ENSURE_TRUE_VOID(event.mSucceeded);
|
||||||
NS_ENSURE_TRUE_VOID(event.mReply.mContentsRoot == imeRoot.get());
|
NS_ENSURE_TRUE_VOID(e10sEnabled || event.mReply.mContentsRoot == imeRoot.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldAbort()) {
|
if (shouldAbort()) {
|
||||||
@@ -2838,7 +2845,7 @@ nsWindow::GeckoViewSupport::FlushIMEChanges(FlushChangesFlag aFlags)
|
|||||||
window.DispatchEvent(&event);
|
window.DispatchEvent(&event);
|
||||||
|
|
||||||
NS_ENSURE_TRUE_VOID(event.mSucceeded);
|
NS_ENSURE_TRUE_VOID(event.mSucceeded);
|
||||||
NS_ENSURE_TRUE_VOID(event.mReply.mContentsRoot == imeRoot.get());
|
NS_ENSURE_TRUE_VOID(e10sEnabled || event.mReply.mContentsRoot == imeRoot.get());
|
||||||
|
|
||||||
if (shouldAbort()) {
|
if (shouldAbort()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user