Synthesized mouse moves shouldn't fire DOM mousemove events. b=20022 r=roc sr=bryner
git-svn-id: svn://10.0.0.236/trunk@152437 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
4ad889bcc7
commit
d155f2a7e1
@ -6047,6 +6047,13 @@ PresShell::HandleEventWithTarget(nsEvent* aEvent, nsIFrame* aFrame, nsIContent*
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
inline PRBool
|
||||
IsSynthesizedMouseMove(nsEvent* aEvent)
|
||||
{
|
||||
return aEvent->eventStructType == NS_MOUSE_EVENT &&
|
||||
NS_STATIC_CAST(nsMouseEvent*, aEvent)->reason != nsMouseEvent::eReal;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView,
|
||||
PRUint32 aFlags, nsEventStatus* aStatus)
|
||||
@ -6085,7 +6092,10 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView,
|
||||
aStatus, aView);
|
||||
|
||||
// 2. Give event to the DOM for third party and JS use.
|
||||
if ((GetCurrentEventFrame()) && NS_SUCCEEDED(rv)) {
|
||||
if ((GetCurrentEventFrame()) && NS_SUCCEEDED(rv) &&
|
||||
// We want synthesized mouse moves to cause mouseover and mouseout
|
||||
// DOM events (PreHandleEvent above), but not mousemove DOM events.
|
||||
!IsSynthesizedMouseMove(aEvent)) {
|
||||
if (mCurrentEventContent) {
|
||||
rv = mCurrentEventContent->HandleDOMEvent(mPresContext, aEvent, nsnull,
|
||||
aFlags, aStatus);
|
||||
|
||||
@ -6047,6 +6047,13 @@ PresShell::HandleEventWithTarget(nsEvent* aEvent, nsIFrame* aFrame, nsIContent*
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
inline PRBool
|
||||
IsSynthesizedMouseMove(nsEvent* aEvent)
|
||||
{
|
||||
return aEvent->eventStructType == NS_MOUSE_EVENT &&
|
||||
NS_STATIC_CAST(nsMouseEvent*, aEvent)->reason != nsMouseEvent::eReal;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView,
|
||||
PRUint32 aFlags, nsEventStatus* aStatus)
|
||||
@ -6085,7 +6092,10 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsIView *aView,
|
||||
aStatus, aView);
|
||||
|
||||
// 2. Give event to the DOM for third party and JS use.
|
||||
if ((GetCurrentEventFrame()) && NS_SUCCEEDED(rv)) {
|
||||
if ((GetCurrentEventFrame()) && NS_SUCCEEDED(rv) &&
|
||||
// We want synthesized mouse moves to cause mouseover and mouseout
|
||||
// DOM events (PreHandleEvent above), but not mousemove DOM events.
|
||||
!IsSynthesizedMouseMove(aEvent)) {
|
||||
if (mCurrentEventContent) {
|
||||
rv = mCurrentEventContent->HandleDOMEvent(mPresContext, aEvent, nsnull,
|
||||
aFlags, aStatus);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user