Bug 292326. Make events coming from the repeating timer in nsAutoButtonBoxFrame be trusted if the original mouse click was trusted. r+sr=jst,a=asa

git-svn-id: svn://10.0.0.236/trunk@173053 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu
2005-05-05 00:07:59 +00:00
parent 1ded8305bd
commit ed8092148e
3 changed files with 21 additions and 29 deletions

View File

@@ -75,15 +75,10 @@ public:
nsGUIEvent* aEvent,
nsEventStatus* aEventStatus);
NS_IMETHOD Init(nsPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow);
NS_DECL_NSITIMERCALLBACK
nsPresContext* mPresContext;
protected:
PRPackedBool mTrustedEvent;
};
nsresult
@@ -108,17 +103,6 @@ nsAutoRepeatBoxFrame::nsAutoRepeatBoxFrame(nsIPresShell* aPresShell)
{
}
NS_IMETHODIMP
nsAutoRepeatBoxFrame::Init(nsPresContext* aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsStyleContext* aContext,
nsIFrame* aPrevInFlow)
{
mPresContext = aPresContext;
return nsButtonBoxFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
}
NS_INTERFACE_MAP_BEGIN(nsAutoRepeatBoxFrame)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_END_INHERITING(nsButtonBoxFrame)
@@ -135,13 +119,16 @@ nsAutoRepeatBoxFrame::HandleEvent(nsPresContext* aPresContext,
{
case NS_MOUSE_ENTER:
case NS_MOUSE_ENTER_SYNTH:
nsRepeatService::GetInstance()->Start(this);
break;
nsRepeatService::GetInstance()->Start(this);
mTrustedEvent = NS_IS_TRUSTED_EVENT(aEvent);
break;
case NS_MOUSE_EXIT:
case NS_MOUSE_EXIT_SYNTH:
nsRepeatService::GetInstance()->Stop();
break;
nsRepeatService::GetInstance()->Stop();
// Not really necessary but do this to be safe
mTrustedEvent = PR_FALSE;
break;
}
return nsButtonBoxFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
@@ -150,7 +137,7 @@ nsAutoRepeatBoxFrame::HandleEvent(nsPresContext* aPresContext,
NS_IMETHODIMP
nsAutoRepeatBoxFrame::Notify(nsITimer *timer)
{
MouseClicked(mPresContext, nsnull);
DoMouseClick(nsnull, mTrustedEvent);
return NS_OK;
}