From 89fd8b91ad705abb15d5d4f67ddb06fd2e6ecec0 Mon Sep 17 00:00:00 2001 From: "kin%netscape.com" Date: Thu, 28 Feb 2002 22:30:01 +0000 Subject: [PATCH] Fix for bug 127368 (Can't type in textfields in pages with an iframe and body with marginheight and marginwidth=0) Modified HandleEvent() to prevent forwarding KeyEvents to views with a different ViewManager. r=roc+moz@cs.cmu.edu sr=sfraser@netscape.com a=shaver@mozilla.org git-svn-id: svn://10.0.0.236/trunk@115508 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsViewManager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index e2ba74df0e0..e00edcf3d67 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -2040,7 +2040,11 @@ nsEventStatus nsViewManager::HandleEvent(nsView* aView, nsGUIEvent* aEvent, PRBo if (nsnull != obs) { obs->HandleEvent(v, aEvent, &status, i == targetViews.Count() - 1, handled); } - } else { + } else if (!NS_IS_KEY_EVENT(aEvent)) { + // Forward aEvent to v's ViewManager observer, but only if it + // isn't a key event, since that should always be dispatched + // to the widget that has focus. + nsIViewObserver* vobs = nsnull; vVM->GetViewObserver(vobs); if (nsnull != vobs) {