Bug 110718. During the 'transferring' when the currently visible document is a zombie, the keyboard is dead for the entire document. r=bryner, sr=hyatt+scc

This commit is contained in:
aaronl@netscape.com
2002-12-14 08:05:51 +00:00
parent 7b78ff51ef
commit 3ba628372c
4 changed files with 161 additions and 11 deletions
+17
View File
@@ -117,6 +117,7 @@
#include "nsIExternalProtocolService.h"
#include "nsIFocusController.h"
#include "nsIEventStateManager.h"
#include "nsITextToSubURI.h"
@@ -4614,6 +4615,22 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer)
}
}
// Eliminate the focus ring in the current docshell, which is
// now a zombie. If we key navigate, it won't be within this
// docshell, until the newly loading document is displayed.
if (mItemType == typeContent) {
nsCOMPtr<nsIPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));
if (presContext) {
nsCOMPtr<nsIEventStateManager> esm;
presContext->GetEventStateManager(getter_AddRefs(esm));
if (esm) {
esm->SetFocusedContent(nsnull);
esm->SetContentState(nsnull, NS_EVENT_STATE_FOCUS);
}
}
}
// It is necessary to obtain the focus controller to utilize its ability
// to suppress focus. This is necessary to fix Win32-only bugs related to
// a loss of focus when mContentViewer is set to null. The internal window