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

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 eb65d5bc9f
commit 2b624272eb

View File

@ -2691,6 +2691,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();