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

git-svn-id: svn://10.0.0.236/trunk@135298 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
aaronl%netscape.com
2002-12-14 08:05:51 +00:00
parent 780fef7a28
commit ed5fb21283
4 changed files with 161 additions and 11 deletions

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