From 16645fef06fcd007e41a8d4dff317e30443b40d9 Mon Sep 17 00:00:00 2001 From: "joki@netscape.com" Date: Fri, 7 Aug 1998 05:19:07 +0000 Subject: [PATCH] Added support for click event on form buttons --- layout/html/base/src/nsHTMLTagContent.cpp | 2 +- layout/html/forms/src/nsInputFrame.cpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/layout/html/base/src/nsHTMLTagContent.cpp b/layout/html/base/src/nsHTMLTagContent.cpp index 87be4fd1cf0d..9dd86440a07c 100644 --- a/layout/html/base/src/nsHTMLTagContent.cpp +++ b/layout/html/base/src/nsHTMLTagContent.cpp @@ -1110,7 +1110,7 @@ nsresult nsHTMLTagContent::HandleDOMEvent(nsIPresContext& aPresContext, mEvent.message = NS_MOUSE_LEFT_CLICK; HandleDOMEvent(aPresContext, &mEvent, nsnull, DOM_EVENT_INIT, mStatus); - if (mStatus != nsEventStatus_eConsumeNoDefault) { + if (nsEventStatus_eConsumeNoDefault != mStatus) { nsAutoString base, href, target; GetAttribute(nsString(NS_HTML_BASE_HREF), base); GetAttribute(nsString("href"), href); diff --git a/layout/html/forms/src/nsInputFrame.cpp b/layout/html/forms/src/nsInputFrame.cpp index 786ce35c6ed7..2fafe98e3a04 100644 --- a/layout/html/forms/src/nsInputFrame.cpp +++ b/layout/html/forms/src/nsInputFrame.cpp @@ -401,8 +401,17 @@ NS_METHOD nsInputFrame::HandleEvent(nsIPresContext& aPresContext, float t2p = aPresContext.GetTwipsToPixels(); ((nsInput*)mContent)->SetClickPoint(NSTwipsToIntPixels(aEvent->point.x, t2p), NSTwipsToIntPixels(aEvent->point.y, t2p)); - MouseClicked(&aPresContext); - //return PR_FALSE; + + nsEventStatus mStatus; + nsMouseEvent mEvent; + mEvent.eventStructType = NS_MOUSE_EVENT; + mEvent.message = NS_MOUSE_LEFT_CLICK; + mContent->HandleDOMEvent(aPresContext, &mEvent, nsnull, DOM_EVENT_INIT, mStatus); + + if (nsEventStatus_eConsumeNoDefault != mStatus) { + MouseClicked(&aPresContext); + //return PR_FALSE; + } } mLastMouseState = eMouseEnter; break;