From f99f6f5b65fd85dcf82eccd4b3f05a63578bf861 Mon Sep 17 00:00:00 2001 From: "locka%iol.ie" Date: Wed, 1 May 2002 20:15:44 +0000 Subject: [PATCH] Stop image control frame stomping on the event status. This stops context menu events being propogated to their parents and sent twice for input elements with images. bugscape=14131 r=saari@netscape.com sr=jst@netscape.com git-svn-id: svn://10.0.0.236/trunk@120455 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsImageControlFrame.cpp | 5 +++++ mozilla/layout/html/forms/src/nsImageControlFrame.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/mozilla/layout/forms/nsImageControlFrame.cpp b/mozilla/layout/forms/nsImageControlFrame.cpp index ab1778533cd..8a39c08f530 100644 --- a/mozilla/layout/forms/nsImageControlFrame.cpp +++ b/mozilla/layout/forms/nsImageControlFrame.cpp @@ -329,6 +329,11 @@ nsImageControlFrame::HandleEvent(nsIPresContext* aPresContext, { NS_ENSURE_ARG_POINTER(aEventStatus); + // Don't do anything if the event has already been handled by someone + if (nsEventStatus_eConsumeNoDefault == *aEventStatus) { + return NS_OK; + } + // do we have user-input style? const nsStyleUserInterface* uiStyle; GetStyleData(eStyleStruct_UserInterface, (const nsStyleStruct *&)uiStyle); diff --git a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp index ab1778533cd..8a39c08f530 100644 --- a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp @@ -329,6 +329,11 @@ nsImageControlFrame::HandleEvent(nsIPresContext* aPresContext, { NS_ENSURE_ARG_POINTER(aEventStatus); + // Don't do anything if the event has already been handled by someone + if (nsEventStatus_eConsumeNoDefault == *aEventStatus) { + return NS_OK; + } + // do we have user-input style? const nsStyleUserInterface* uiStyle; GetStyleData(eStyleStruct_UserInterface, (const nsStyleStruct *&)uiStyle);