Fixing bug 289940. Make chrome event handlers only receive trusted events by default. r=jonas@sicking.cc, sr=peterv@propagandism.org, a=chofmann@mozilla.org

This commit is contained in:
jst@mozilla.jstenback.com
2005-04-28 23:48:28 +00:00
parent 5b21cad00f
commit f54c1fc9b1
119 changed files with 1268 additions and 778 deletions

View File

@@ -150,7 +150,7 @@ nsButtonBoxFrame::HandleEvent(nsPresContext* aPresContext,
}
void
nsButtonBoxFrame::MouseClicked (nsPresContext* aPresContext, nsGUIEvent* aEvent)
nsButtonBoxFrame::MouseClicked(nsPresContext* aPresContext, nsGUIEvent* aEvent)
{
// Don't execute if we're disabled.
nsAutoString disabled;
@@ -160,7 +160,8 @@ nsButtonBoxFrame::MouseClicked (nsPresContext* aPresContext, nsGUIEvent* aEvent)
// Execute the oncommand event handler.
nsEventStatus status = nsEventStatus_eIgnore;
nsMouseEvent event(NS_XUL_COMMAND);
nsMouseEvent event(aEvent ? NS_IS_TRUSTED_EVENT(aEvent) : PR_FALSE,
NS_XUL_COMMAND, nsnull, nsMouseEvent::eReal);
if(aEvent) {
event.isShift = ((nsInputEvent*)(aEvent))->isShift;
event.isControl = ((nsInputEvent*)(aEvent))->isControl;