Fix for caret problems in Ender text fields. r=saari

This commit is contained in:
hyatt%netscape.com 1999-12-08 20:55:45 +00:00
parent 5b5d567b93
commit 9f336df5c0
2 changed files with 16 additions and 16 deletions

View File

@ -194,6 +194,14 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
break;
case NS_GOTFOCUS:
{
if (!mDocument) {
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
if (presShell) {
presShell->GetDocument(&mDocument);
}
}
if (gLastFocusedDocument == mDocument)
break;
@ -221,14 +229,6 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
focusevent.eventStructType = NS_EVENT;
focusevent.message = NS_FOCUS_CONTENT;
if (!mDocument) {
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
if (presShell) {
presShell->GetDocument(&mDocument);
}
}
if (mDocument) {
// fire focus on window, not document
nsCOMPtr<nsIScriptGlobalObject> globalObject;

View File

@ -194,6 +194,14 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
break;
case NS_GOTFOCUS:
{
if (!mDocument) {
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
if (presShell) {
presShell->GetDocument(&mDocument);
}
}
if (gLastFocusedDocument == mDocument)
break;
@ -221,14 +229,6 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
focusevent.eventStructType = NS_EVENT;
focusevent.message = NS_FOCUS_CONTENT;
if (!mDocument) {
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
if (presShell) {
presShell->GetDocument(&mDocument);
}
}
if (mDocument) {
// fire focus on window, not document
nsCOMPtr<nsIScriptGlobalObject> globalObject;