зеркало из https://github.com/mozilla/pjs.git
check if events have been handled already before dispatching them; r=saari; bug #45390
This commit is contained in:
Родитель
663ab84636
Коммит
08e968606d
|
@ -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<nsIPrivateDOMEvent> 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<nsIController> controller;
|
||||
|
|
|
@ -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<nsIPrivateDOMEvent> 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<nsIController> controller;
|
||||
|
|
Загрузка…
Ссылка в новой задаче