diff --git a/content/xbl/src/nsXBLEventHandler.cpp b/content/xbl/src/nsXBLEventHandler.cpp index 94ddb0ad223..fccc6a1d4fd 100644 --- a/content/xbl/src/nsXBLEventHandler.cpp +++ b/content/xbl/src/nsXBLEventHandler.cpp @@ -44,6 +44,7 @@ #include "nsIEventListenerManager.h" #include "nsIDOMEventReceiver.h" #include "nsXBLBinding.h" +#include "nsIPrivateDOMEvent.h" PRUint32 nsXBLEventHandler::gRefCnt = 0; nsIAtom* nsXBLEventHandler::kKeyCodeAtom = nsnull; @@ -555,6 +556,15 @@ nsXBLEventHandler::ExecuteHandler(const nsString& aEventName, nsIDOMEvent* aEven // Stop any other default action from executing. aEvent->PreventDefault(); + nsCOMPtr privateEvent = do_QueryInterface(aEvent); + if(privateEvent) + { + PRBool dispatchStopped; + privateEvent->IsDispatchStopped(&dispatchStopped); + if(dispatchStopped) + return NS_OK; + } + // Instead of executing JS, let's get the controller for the bound // element and call doCommand on it. nsCOMPtr controller; diff --git a/layout/xbl/src/nsXBLEventHandler.cpp b/layout/xbl/src/nsXBLEventHandler.cpp index 94ddb0ad223..fccc6a1d4fd 100644 --- a/layout/xbl/src/nsXBLEventHandler.cpp +++ b/layout/xbl/src/nsXBLEventHandler.cpp @@ -44,6 +44,7 @@ #include "nsIEventListenerManager.h" #include "nsIDOMEventReceiver.h" #include "nsXBLBinding.h" +#include "nsIPrivateDOMEvent.h" PRUint32 nsXBLEventHandler::gRefCnt = 0; nsIAtom* nsXBLEventHandler::kKeyCodeAtom = nsnull; @@ -555,6 +556,15 @@ nsXBLEventHandler::ExecuteHandler(const nsString& aEventName, nsIDOMEvent* aEven // Stop any other default action from executing. aEvent->PreventDefault(); + nsCOMPtr privateEvent = do_QueryInterface(aEvent); + if(privateEvent) + { + PRBool dispatchStopped; + privateEvent->IsDispatchStopped(&dispatchStopped); + if(dispatchStopped) + return NS_OK; + } + // Instead of executing JS, let's get the controller for the bound // element and call doCommand on it. nsCOMPtr controller;