Bug 1254629 - Ensure content root is in document when flushing IME changes; r=esawin, a=lizzard

One work-around for the bug is to ensure that our content root is in a
document when flushing IME changes, because when an input becomes
hidden, the previous content root is removed from the document.
This commit is contained in:
Jim Chen 2016-03-11 13:47:22 -05:00
parent 36bb717e92
commit 26cd334498

View File

@ -2674,6 +2674,10 @@ nsWindow::GeckoViewSupport::FlushIMEChanges(FlushChangesFlag aFlags)
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(IMEStateManager::GetFocusSelectionAndRoot(
getter_AddRefs(imeSelection), getter_AddRefs(imeRoot))));
// Make sure we still have a valid selection/root. We can potentially get
// a stale selection/root if the editor becomes hidden, for example.
NS_ENSURE_TRUE_VOID(imeRoot->IsInComposedDoc());
RefPtr<nsWindow> kungFuDeathGrip(&window);
window.UserActivity();