From 9f336df5c069388d29fdd3ec2201bdee7b68328e Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Wed, 8 Dec 1999 20:55:45 +0000 Subject: [PATCH] Fix for caret problems in Ender text fields. r=saari --- content/events/src/nsEventStateManager.cpp | 16 ++++++++-------- layout/events/src/nsEventStateManager.cpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index 79026987c0ef..0575d0817493 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -194,6 +194,14 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, break; case NS_GOTFOCUS: { + if (!mDocument) { + nsCOMPtr 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 presShell; - aPresContext->GetShell(getter_AddRefs(presShell)); - if (presShell) { - presShell->GetDocument(&mDocument); - } - } - if (mDocument) { // fire focus on window, not document nsCOMPtr globalObject; diff --git a/layout/events/src/nsEventStateManager.cpp b/layout/events/src/nsEventStateManager.cpp index 79026987c0ef..0575d0817493 100644 --- a/layout/events/src/nsEventStateManager.cpp +++ b/layout/events/src/nsEventStateManager.cpp @@ -194,6 +194,14 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, break; case NS_GOTFOCUS: { + if (!mDocument) { + nsCOMPtr 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 presShell; - aPresContext->GetShell(getter_AddRefs(presShell)); - if (presShell) { - presShell->GetDocument(&mDocument); - } - } - if (mDocument) { // fire focus on window, not document nsCOMPtr globalObject;