Bug 496567 - Remove nsXULCommandEvent and nsIDOMXULListener, r=neil, sr=sicking
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
#include "nsIEventStateManager.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
//
|
||||
// NS_NewXULButtonFrame
|
||||
@@ -149,19 +150,24 @@ nsButtonBoxFrame::DoMouseClick(nsGUIEvent* aEvent, PRBool aTrustEvent)
|
||||
return;
|
||||
|
||||
// Execute the oncommand event handler.
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
nsXULCommandEvent event(aEvent ? NS_IS_TRUSTED_EVENT(aEvent) : aTrustEvent,
|
||||
NS_XUL_COMMAND, nsnull);
|
||||
PRBool isShift = PR_FALSE;
|
||||
PRBool isControl = PR_FALSE;
|
||||
PRBool isAlt = PR_FALSE;
|
||||
PRBool isMeta = PR_FALSE;
|
||||
if(aEvent) {
|
||||
event.isShift = ((nsInputEvent*)(aEvent))->isShift;
|
||||
event.isControl = ((nsInputEvent*)(aEvent))->isControl;
|
||||
event.isAlt = ((nsInputEvent*)(aEvent))->isAlt;
|
||||
event.isMeta = ((nsInputEvent*)(aEvent))->isMeta;
|
||||
isShift = ((nsInputEvent*)(aEvent))->isShift;
|
||||
isControl = ((nsInputEvent*)(aEvent))->isControl;
|
||||
isAlt = ((nsInputEvent*)(aEvent))->isAlt;
|
||||
isMeta = ((nsInputEvent*)(aEvent))->isMeta;
|
||||
}
|
||||
|
||||
// Have the content handle the event, propagating it according to normal DOM rules.
|
||||
nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
|
||||
if (shell) {
|
||||
shell->HandleDOMEventWithTarget(mContent, &event, &status);
|
||||
nsContentUtils::DispatchXULCommand(mContent,
|
||||
aEvent ?
|
||||
NS_IS_TRUSTED_EVENT(aEvent) : aTrustEvent,
|
||||
nsnull, shell,
|
||||
isControl, isAlt, isShift, isMeta);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user