зеркало из https://github.com/mozilla/pjs.git
Synthesized mouse moves shouldn't fire DOM mousemove events. b=20022 r=roc sr=bryner
This commit is contained in:
Родитель
81fe0f4de2
Коммит
9677d991aa
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче