Bug 1158425 - Rename _SYNTH event names. r=smaug

--HG--
extra : rebase_source : 533cc7e18cf7f92d95a146d61f7aa2da7c0b8e48
This commit is contained in:
Anthony Tseng 2015-05-01 22:06:00 -04:00
parent a7eca983ce
commit 6fe5a1137f
30 changed files with 118 additions and 120 deletions

View File

@ -2769,9 +2769,9 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
// Optimisation: return early if this event doesn't interest us. // Optimisation: return early if this event doesn't interest us.
// IMPORTANT: this switch and the switch below it must be kept in sync! // IMPORTANT: this switch and the switch below it must be kept in sync!
switch (aVisitor.mEvent->message) { switch (aVisitor.mEvent->message) {
case NS_MOUSE_ENTER_SYNTH: case NS_MOUSE_OVER:
case NS_FOCUS_CONTENT: case NS_FOCUS_CONTENT:
case NS_MOUSE_EXIT_SYNTH: case NS_MOUSE_OUT:
case NS_BLUR_CONTENT: case NS_BLUR_CONTENT:
break; break;
default: default:
@ -2790,7 +2790,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
// updated even if the event is consumed before we have a chance to set it. // updated even if the event is consumed before we have a chance to set it.
switch (aVisitor.mEvent->message) { switch (aVisitor.mEvent->message) {
// Set the status bar similarly for mouseover and focus // Set the status bar similarly for mouseover and focus
case NS_MOUSE_ENTER_SYNTH: case NS_MOUSE_OVER:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault; aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
// FALL THROUGH // FALL THROUGH
case NS_FOCUS_CONTENT: { case NS_FOCUS_CONTENT: {
@ -2805,7 +2805,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
} }
break; break;
} }
case NS_MOUSE_EXIT_SYNTH: case NS_MOUSE_OUT:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault; aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
// FALL THROUGH // FALL THROUGH
case NS_BLUR_CONTENT: case NS_BLUR_CONTENT:

View File

@ -676,8 +676,8 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
// Don't propagate mouseover and mouseout events when mouse is moving // Don't propagate mouseover and mouseout events when mouse is moving
// inside chrome access only content. // inside chrome access only content.
bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree(); bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree();
if ((aVisitor.mEvent->message == NS_MOUSE_ENTER_SYNTH || if ((aVisitor.mEvent->message == NS_MOUSE_OVER ||
aVisitor.mEvent->message == NS_MOUSE_EXIT_SYNTH || aVisitor.mEvent->message == NS_MOUSE_OUT ||
aVisitor.mEvent->message == NS_POINTER_OVER || aVisitor.mEvent->message == NS_POINTER_OVER ||
aVisitor.mEvent->message == NS_POINTER_OUT) && aVisitor.mEvent->message == NS_POINTER_OUT) &&
// Check if we should stop event propagation when event has just been // Check if we should stop event propagation when event has just been
@ -738,7 +738,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
printf("Stopping %s propagation:" printf("Stopping %s propagation:"
"\n\toriginalTarget=%s \n\tcurrentTarget=%s %s" "\n\toriginalTarget=%s \n\tcurrentTarget=%s %s"
"\n\trelatedTarget=%s %s \n%s", "\n\trelatedTarget=%s %s \n%s",
(aVisitor.mEvent->message == NS_MOUSE_ENTER_SYNTH) (aVisitor.mEvent->message == NS_MOUSE_OVER)
? "mouseover" : "mouseout", ? "mouseover" : "mouseout",
NS_ConvertUTF16toUTF8(ot).get(), NS_ConvertUTF16toUTF8(ot).get(),
NS_ConvertUTF16toUTF8(ct).get(), NS_ConvertUTF16toUTF8(ct).get(),

View File

@ -7653,9 +7653,9 @@ nsContentUtils::SendMouseEvent(nsCOMPtr<nsIPresShell> aPresShell,
else if (aType.EqualsLiteral("mousemove")) else if (aType.EqualsLiteral("mousemove"))
msg = NS_MOUSE_MOVE; msg = NS_MOUSE_MOVE;
else if (aType.EqualsLiteral("mouseover")) else if (aType.EqualsLiteral("mouseover"))
msg = NS_MOUSE_ENTER; msg = NS_MOUSE_ENTER_WIDGET;
else if (aType.EqualsLiteral("mouseout")) else if (aType.EqualsLiteral("mouseout"))
msg = NS_MOUSE_EXIT; msg = NS_MOUSE_EXIT_WIDGET;
else if (aType.EqualsLiteral("contextmenu")) { else if (aType.EqualsLiteral("contextmenu")) {
msg = NS_CONTEXTMENU; msg = NS_CONTEXTMENU;
contextMenuKey = (aButton == 0); contextMenuKey = (aButton == 0);

View File

@ -94,7 +94,7 @@ DataTransfer::DataTransfer(nsISupports* aParent, uint32_t aEventType,
} else if (mIsExternal) { } else if (mIsExternal) {
if (aEventType == NS_PASTE) { if (aEventType == NS_PASTE) {
CacheExternalClipboardFormats(); CacheExternalClipboardFormats();
} else if (aEventType >= NS_DRAGDROP_EVENT_START && aEventType <= NS_DRAGDROP_LEAVE_SYNTH) { } else if (aEventType >= NS_DRAGDROP_EVENT_START && aEventType <= NS_DRAGDROP_LEAVE) {
CacheExternalDragFormats(); CacheExternalDragFormats();
} }
} }

View File

@ -191,11 +191,11 @@ EVENT(dragenter,
EventNameType_HTMLXUL, EventNameType_HTMLXUL,
eDragEventClass) eDragEventClass)
EVENT(dragleave, EVENT(dragleave,
NS_DRAGDROP_LEAVE_SYNTH, NS_DRAGDROP_LEAVE,
EventNameType_HTMLXUL, EventNameType_HTMLXUL,
eDragEventClass) eDragEventClass)
EVENT(dragover, EVENT(dragover,
NS_DRAGDROP_OVER_SYNTH, NS_DRAGDROP_OVER,
EventNameType_HTMLXUL, EventNameType_HTMLXUL,
eDragEventClass) eDragEventClass)
EVENT(dragstart, EVENT(dragstart,
@ -283,11 +283,11 @@ EVENT(mousemove,
EventNameType_All, EventNameType_All,
eMouseEventClass) eMouseEventClass)
EVENT(mouseout, EVENT(mouseout,
NS_MOUSE_EXIT_SYNTH, NS_MOUSE_OUT,
EventNameType_All, EventNameType_All,
eMouseEventClass) eMouseEventClass)
EVENT(mouseover, EVENT(mouseover,
NS_MOUSE_ENTER_SYNTH, NS_MOUSE_OVER,
EventNameType_All, EventNameType_All,
eMouseEventClass) eMouseEventClass)
EVENT(mouseup, EVENT(mouseup,
@ -720,7 +720,7 @@ NON_IDL_EVENT(commandupdate,
EventNameType_XUL, EventNameType_XUL,
eBasicEventClass) eBasicEventClass)
NON_IDL_EVENT(dragexit, NON_IDL_EVENT(dragexit,
NS_DRAGDROP_EXIT_SYNTH, NS_DRAGDROP_EXIT,
EventNameType_XUL, EventNameType_XUL,
eDragEventClass) eDragEventClass)
NON_IDL_EVENT(dragdrop, NON_IDL_EVENT(dragdrop,

View File

@ -491,13 +491,13 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
mCurrentTarget = aTargetFrame; mCurrentTarget = aTargetFrame;
mCurrentTargetContent = nullptr; mCurrentTargetContent = nullptr;
// Do not take account NS_MOUSE_ENTER/EXIT so that loading a page // Do not take account NS_MOUSE_ENTER_WIDGET/EXIT_WIDGET so that loading a page
// when user is not active doesn't change the state to active. // when user is not active doesn't change the state to active.
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent(); WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (aEvent->mFlags.mIsTrusted && if (aEvent->mFlags.mIsTrusted &&
((mouseEvent && mouseEvent->IsReal() && ((mouseEvent && mouseEvent->IsReal() &&
mouseEvent->message != NS_MOUSE_ENTER && mouseEvent->message != NS_MOUSE_ENTER_WIDGET &&
mouseEvent->message != NS_MOUSE_EXIT) || mouseEvent->message != NS_MOUSE_EXIT_WIDGET) ||
aEvent->mClass == eWheelEventClass || aEvent->mClass == eWheelEventClass ||
aEvent->mClass == eKeyboardEventClass)) { aEvent->mClass == eKeyboardEventClass)) {
if (gMouseOrKeyboardEventCounter == 0) { if (gMouseOrKeyboardEventCounter == 0) {
@ -580,8 +580,8 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
} }
break; break;
} }
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
// If this is a remote frame, we receive NS_MOUSE_EXIT from the parent // If this is a remote frame, we receive NS_MOUSE_EXIT_WIDGET from the parent
// the mouse exits our content. Since the parent may update the cursor // the mouse exits our content. Since the parent may update the cursor
// while the mouse is outside our frame, and since PuppetWidget caches the // while the mouse is outside our frame, and since PuppetWidget caches the
// current cursor internally, re-entering our content (say from over a // current cursor internally, re-entering our content (say from over a
@ -1181,9 +1181,9 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
case NS_MOUSE_BUTTON_UP: case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_MOVE: case NS_MOUSE_MOVE:
case NS_CONTEXTMENU: case NS_CONTEXTMENU:
case NS_MOUSE_ENTER: case NS_MOUSE_ENTER_WIDGET:
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
case NS_MOUSE_ENTER_SYNTH: case NS_MOUSE_OVER:
return true; return true;
default: default:
return false; return false;
@ -3325,7 +3325,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
} }
break; break;
case NS_MOUSE_ENTER: case NS_MOUSE_ENTER_WIDGET:
if (mCurrentTarget) { if (mCurrentTarget) {
nsCOMPtr<nsIContent> targetContent; nsCOMPtr<nsIContent> targetContent;
mCurrentTarget->GetContentForEvent(aEvent, getter_AddRefs(targetContent)); mCurrentTarget->GetContentForEvent(aEvent, getter_AddRefs(targetContent));
@ -3747,8 +3747,8 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent,
if (sIsPointerLocked && if (sIsPointerLocked &&
(aMessage == NS_MOUSELEAVE || (aMessage == NS_MOUSELEAVE ||
aMessage == NS_MOUSEENTER || aMessage == NS_MOUSEENTER ||
aMessage == NS_MOUSE_ENTER_SYNTH || aMessage == NS_MOUSE_OVER ||
aMessage == NS_MOUSE_EXIT_SYNTH)) { aMessage == NS_MOUSE_OUT)) {
mCurrentTargetContent = nullptr; mCurrentTargetContent = nullptr;
nsCOMPtr<Element> pointerLockedElement = nsCOMPtr<Element> pointerLockedElement =
do_QueryReferent(EventStateManager::sPointerLockedElement); do_QueryReferent(EventStateManager::sPointerLockedElement);
@ -3793,10 +3793,10 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent,
// If we are entering/leaving remote content, dispatch a mouse enter/exit // If we are entering/leaving remote content, dispatch a mouse enter/exit
// event to the remote frame. // event to the remote frame.
if (IsRemoteTarget(aTargetContent)) { if (IsRemoteTarget(aTargetContent)) {
if (aMessage == NS_MOUSE_EXIT_SYNTH) { if (aMessage == NS_MOUSE_OUT) {
// For remote content, send a "top-level" widget mouse exit event. // For remote content, send a "top-level" widget mouse exit event.
nsAutoPtr<WidgetMouseEvent> remoteEvent; nsAutoPtr<WidgetMouseEvent> remoteEvent;
CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_EXIT, CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_EXIT_WIDGET,
aRelatedContent, remoteEvent); aRelatedContent, remoteEvent);
remoteEvent->exit = WidgetMouseEvent::eTopLevel; remoteEvent->exit = WidgetMouseEvent::eTopLevel;
@ -3806,9 +3806,9 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent,
// proper target via GetEventTarget which will return mCurrentTarget. // proper target via GetEventTarget which will return mCurrentTarget.
mCurrentTarget = targetFrame; mCurrentTarget = targetFrame;
HandleCrossProcessEvent(remoteEvent, &status); HandleCrossProcessEvent(remoteEvent, &status);
} else if (aMessage == NS_MOUSE_ENTER_SYNTH) { } else if (aMessage == NS_MOUSE_OVER) {
nsAutoPtr<WidgetMouseEvent> remoteEvent; nsAutoPtr<WidgetMouseEvent> remoteEvent;
CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_ENTER, CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_ENTER_WIDGET,
aRelatedContent, remoteEvent); aRelatedContent, remoteEvent);
HandleCrossProcessEvent(remoteEvent, &status); HandleCrossProcessEvent(remoteEvent, &status);
} }
@ -3933,7 +3933,7 @@ EventStateManager::NotifyMouseOut(WidgetMouseEvent* aMouseEvent,
NS_MOUSELEAVE); NS_MOUSELEAVE);
// Fire mouseout // Fire mouseout
DispatchMouseOrPointerEvent(aMouseEvent, isPointer ? NS_POINTER_OUT : NS_MOUSE_EXIT_SYNTH, DispatchMouseOrPointerEvent(aMouseEvent, isPointer ? NS_POINTER_OUT : NS_MOUSE_OUT,
wrapper->mLastOverElement, aMovingInto); wrapper->mLastOverElement, aMovingInto);
wrapper->mLastOverFrame = nullptr; wrapper->mLastOverFrame = nullptr;
@ -4006,7 +4006,7 @@ EventStateManager::NotifyMouseOver(WidgetMouseEvent* aMouseEvent,
// Fire mouseover // Fire mouseover
wrapper->mLastOverFrame = wrapper->mLastOverFrame =
DispatchMouseOrPointerEvent(aMouseEvent, DispatchMouseOrPointerEvent(aMouseEvent,
isPointer ? NS_POINTER_OVER : NS_MOUSE_ENTER_SYNTH, isPointer ? NS_POINTER_OVER : NS_MOUSE_OVER,
aContent, lastOverElement); aContent, lastOverElement);
wrapper->mLastOverElement = aContent; wrapper->mLastOverElement = aContent;
} else { } else {
@ -4164,7 +4164,7 @@ EventStateManager::GenerateMouseEnterExit(WidgetMouseEvent* aMouseEvent)
break; break;
case NS_POINTER_LEAVE: case NS_POINTER_LEAVE:
case NS_POINTER_CANCEL: case NS_POINTER_CANCEL:
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
{ {
// This is actually the window mouse exit or pointer leave event. We're not moving // This is actually the window mouse exit or pointer leave event. We're not moving
// into any new element. // into any new element.
@ -4293,7 +4293,7 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
getter_AddRefs(lastContent)); getter_AddRefs(lastContent));
FireDragEnterOrExit(sLastDragOverFrame->PresContext(), FireDragEnterOrExit(sLastDragOverFrame->PresContext(),
aDragEvent, NS_DRAGDROP_EXIT_SYNTH, aDragEvent, NS_DRAGDROP_EXIT,
targetContent, lastContent, sLastDragOverFrame); targetContent, lastContent, sLastDragOverFrame);
} }
@ -4302,7 +4302,7 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
if (sLastDragOverFrame) { if (sLastDragOverFrame) {
FireDragEnterOrExit(sLastDragOverFrame->PresContext(), FireDragEnterOrExit(sLastDragOverFrame->PresContext(),
aDragEvent, NS_DRAGDROP_LEAVE_SYNTH, aDragEvent, NS_DRAGDROP_LEAVE,
targetContent, lastContent, sLastDragOverFrame); targetContent, lastContent, sLastDragOverFrame);
} }
@ -4321,10 +4321,10 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
nsRefPtr<nsPresContext> lastDragOverFramePresContext = sLastDragOverFrame->PresContext(); nsRefPtr<nsPresContext> lastDragOverFramePresContext = sLastDragOverFrame->PresContext();
FireDragEnterOrExit(lastDragOverFramePresContext, FireDragEnterOrExit(lastDragOverFramePresContext,
aDragEvent, NS_DRAGDROP_EXIT_SYNTH, aDragEvent, NS_DRAGDROP_EXIT,
nullptr, lastContent, sLastDragOverFrame); nullptr, lastContent, sLastDragOverFrame);
FireDragEnterOrExit(lastDragOverFramePresContext, FireDragEnterOrExit(lastDragOverFramePresContext,
aDragEvent, NS_DRAGDROP_LEAVE_SYNTH, aDragEvent, NS_DRAGDROP_LEAVE,
nullptr, lastContent, sLastDragOverFrame); nullptr, lastContent, sLastDragOverFrame);
sLastDragOverFrame = nullptr; sLastDragOverFrame = nullptr;
@ -4373,7 +4373,7 @@ EventStateManager::FireDragEnterOrExit(nsPresContext* aPresContext,
// collect any changes to moz cursor settings stored in the event's // collect any changes to moz cursor settings stored in the event's
// data transfer. // data transfer.
if (aMsg == NS_DRAGDROP_LEAVE_SYNTH || aMsg == NS_DRAGDROP_EXIT_SYNTH || if (aMsg == NS_DRAGDROP_LEAVE || aMsg == NS_DRAGDROP_EXIT ||
aMsg == NS_DRAGDROP_ENTER) aMsg == NS_DRAGDROP_ENTER)
UpdateDragDataTransfer(&event); UpdateDragDataTransfer(&event);
} }

View File

@ -347,7 +347,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
} }
break; break;
case NS_MOUSE_ENTER_SYNTH: case NS_MOUSE_OVER:
{ {
aVisitor.mPresContext->EventStateManager()-> aVisitor.mPresContext->EventStateManager()->
SetContentState(this, NS_EVENT_STATE_HOVER); SetContentState(this, NS_EVENT_STATE_HOVER);
@ -356,7 +356,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
break; break;
// XXX this doesn't seem to do anything yet // XXX this doesn't seem to do anything yet
case NS_MOUSE_EXIT_SYNTH: case NS_MOUSE_OUT:
{ {
aVisitor.mPresContext->EventStateManager()-> aVisitor.mPresContext->EventStateManager()->
SetContentState(nullptr, NS_EVENT_STATE_HOVER); SetContentState(nullptr, NS_EVENT_STATE_HOVER);

View File

@ -3370,10 +3370,10 @@ HTMLInputElement::NeedToInitializeEditorForEvent(
switch (aVisitor.mEvent->message) { switch (aVisitor.mEvent->message) {
case NS_MOUSE_MOVE: case NS_MOUSE_MOVE:
case NS_MOUSE_ENTER: case NS_MOUSE_ENTER_WIDGET:
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
case NS_MOUSE_ENTER_SYNTH: case NS_MOUSE_OVER:
case NS_MOUSE_EXIT_SYNTH: case NS_MOUSE_OUT:
case NS_SCROLLPORT_UNDERFLOW: case NS_SCROLLPORT_UNDERFLOW:
case NS_SCROLLPORT_OVERFLOW: case NS_SCROLLPORT_OVERFLOW:
return false; return false;

View File

@ -1220,16 +1220,16 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
if (widget) { if (widget) {
// When we mouseenter the tab, the tab's cursor should become the current // When we mouseenter the tab, the tab's cursor should become the current
// cursor. When we mouseexit, we stop. // cursor. When we mouseexit, we stop.
if (event.message == NS_MOUSE_ENTER || if (event.message == NS_MOUSE_ENTER_WIDGET ||
event.message == NS_MOUSE_ENTER_SYNTH) { event.message == NS_MOUSE_OVER) {
mTabSetsCursor = true; mTabSetsCursor = true;
if (mCursor != nsCursor(-1)) { if (mCursor != nsCursor(-1)) {
widget->SetCursor(mCursor); widget->SetCursor(mCursor);
} }
// We don't actually want to forward NS_MOUSE_ENTER messages. // We don't actually want to forward NS_MOUSE_ENTER_WIDGET messages.
return true; return true;
} else if (event.message == NS_MOUSE_EXIT || } else if (event.message == NS_MOUSE_EXIT_WIDGET ||
event.message == NS_MOUSE_EXIT_SYNTH) { event.message == NS_MOUSE_OUT) {
mTabSetsCursor = false; mTabSetsCursor = false;
} }
} }

View File

@ -1759,9 +1759,9 @@ CocoaEventTypeForEvent(const WidgetGUIEvent& anEvent, nsIFrame* aObjectFrame)
} }
switch (anEvent.message) { switch (anEvent.message) {
case NS_MOUSE_ENTER_SYNTH: case NS_MOUSE_OVER:
return NPCocoaEventMouseEntered; return NPCocoaEventMouseEntered;
case NS_MOUSE_EXIT_SYNTH: case NS_MOUSE_OUT:
return NPCocoaEventMouseExited; return NPCocoaEventMouseExited;
case NS_MOUSE_MOVE: case NS_MOUSE_MOVE:
{ {
@ -1803,8 +1803,8 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
anEvent->message == NS_MOUSE_BUTTON_DOWN || anEvent->message == NS_MOUSE_BUTTON_DOWN ||
anEvent->message == NS_MOUSE_BUTTON_UP || anEvent->message == NS_MOUSE_BUTTON_UP ||
anEvent->message == NS_MOUSE_SCROLL || anEvent->message == NS_MOUSE_SCROLL ||
anEvent->message == NS_MOUSE_ENTER_SYNTH || anEvent->message == NS_MOUSE_OVER ||
anEvent->message == NS_MOUSE_EXIT_SYNTH) anEvent->message == NS_MOUSE_OUT)
{ {
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(anEvent, aObjectFrame) - nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(anEvent, aObjectFrame) -
aObjectFrame->GetContentRectRelativeToSelf().TopLeft(); aObjectFrame->GetContentRectRelativeToSelf().TopLeft();
@ -2059,8 +2059,8 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
NS_ASSERTION(anEvent.message == NS_MOUSE_BUTTON_DOWN || NS_ASSERTION(anEvent.message == NS_MOUSE_BUTTON_DOWN ||
anEvent.message == NS_MOUSE_BUTTON_UP || anEvent.message == NS_MOUSE_BUTTON_UP ||
anEvent.message == NS_MOUSE_DOUBLECLICK || anEvent.message == NS_MOUSE_DOUBLECLICK ||
anEvent.message == NS_MOUSE_ENTER_SYNTH || anEvent.message == NS_MOUSE_OVER ||
anEvent.message == NS_MOUSE_EXIT_SYNTH || anEvent.message == NS_MOUSE_OUT ||
anEvent.message == NS_MOUSE_MOVE, anEvent.message == NS_MOUSE_MOVE,
"Incorrect event type for coordinate translation"); "Incorrect event type for coordinate translation");
nsPoint pt = nsPoint pt =
@ -2145,11 +2145,11 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
switch (anEvent.message) switch (anEvent.message)
{ {
case NS_MOUSE_ENTER_SYNTH: case NS_MOUSE_OVER:
case NS_MOUSE_EXIT_SYNTH: case NS_MOUSE_OUT:
{ {
XCrossingEvent& event = pluginEvent.xcrossing; XCrossingEvent& event = pluginEvent.xcrossing;
event.type = anEvent.message == NS_MOUSE_ENTER_SYNTH ? event.type = anEvent.message == NS_MOUSE_OVER ?
EnterNotify : LeaveNotify; EnterNotify : LeaveNotify;
event.root = root; event.root = root;
event.time = anEvent.time; event.time = anEvent.time;

View File

@ -374,12 +374,12 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
return DragEnter(dragEvent); return DragEnter(dragEvent);
} }
// dragover // dragover
case NS_DRAGDROP_OVER_SYNTH: { case NS_DRAGDROP_OVER: {
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent); nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
return DragOver(dragEvent); return DragOver(dragEvent);
} }
// dragexit // dragexit
case NS_DRAGDROP_EXIT_SYNTH: { case NS_DRAGDROP_EXIT: {
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent); nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
return DragExit(dragEvent); return DragExit(dragEvent);
} }

View File

@ -6518,7 +6518,7 @@ void
PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent) PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent)
{ {
switch (aEvent->message) { switch (aEvent->message) {
case NS_MOUSE_ENTER: case NS_MOUSE_ENTER_WIDGET:
// In this case we have to know information about available mouse pointers // In this case we have to know information about available mouse pointers
if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) { if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
gActivePointersIds->Put(mouseEvent->pointerId, gActivePointersIds->Put(mouseEvent->pointerId,
@ -6543,7 +6543,7 @@ PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent)
} }
} }
break; break;
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
// In this case we have to remove information about disappeared mouse pointers // In this case we have to remove information about disappeared mouse pointers
if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) { if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
gActivePointersIds->Remove(mouseEvent->pointerId); gActivePointersIds->Remove(mouseEvent->pointerId);
@ -6739,7 +6739,7 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
if ((aEvent->message == NS_MOUSE_MOVE && if ((aEvent->message == NS_MOUSE_MOVE &&
aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal) || aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal) ||
aEvent->message == NS_MOUSE_ENTER || aEvent->message == NS_MOUSE_ENTER_WIDGET ||
aEvent->message == NS_MOUSE_BUTTON_DOWN || aEvent->message == NS_MOUSE_BUTTON_DOWN ||
aEvent->message == NS_MOUSE_BUTTON_UP) { aEvent->message == NS_MOUSE_BUTTON_UP) {
nsIFrame* rootFrame = GetRootFrame(); nsIFrame* rootFrame = GetRootFrame();
@ -6752,15 +6752,15 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame); nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
} }
#ifdef DEBUG_MOUSE_LOCATION #ifdef DEBUG_MOUSE_LOCATION
if (aEvent->message == NS_MOUSE_ENTER) if (aEvent->message == NS_MOUSE_ENTER_WIDGET)
printf("[ps=%p]got mouse enter for %p\n", printf("[ps=%p]got mouse enter for %p\n",
this, aEvent->widget); this, aEvent->widget);
printf("[ps=%p]setting mouse location to (%d,%d)\n", printf("[ps=%p]setting mouse location to (%d,%d)\n",
this, mMouseLocation.x, mMouseLocation.y); this, mMouseLocation.x, mMouseLocation.y);
#endif #endif
if (aEvent->message == NS_MOUSE_ENTER) if (aEvent->message == NS_MOUSE_ENTER_WIDGET)
SynthesizeMouseMove(false); SynthesizeMouseMove(false);
} else if (aEvent->message == NS_MOUSE_EXIT) { } else if (aEvent->message == NS_MOUSE_EXIT_WIDGET) {
// Although we only care about the mouse moving into an area for which this // Although we only care about the mouse moving into an area for which this
// pres shell doesn't receive mouse move events, we don't check which widget // pres shell doesn't receive mouse move events, we don't check which widget
// the mouse exit was for since this seems to vary by platform. Hopefully // the mouse exit was for since this seems to vary by platform. Hopefully
@ -7458,7 +7458,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
} }
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent(); WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
bool isWindowLevelMouseExit = (aEvent->message == NS_MOUSE_EXIT) && bool isWindowLevelMouseExit = (aEvent->message == NS_MOUSE_EXIT_WIDGET) &&
(mouseEvent && mouseEvent->exit == WidgetMouseEvent::eTopLevel); (mouseEvent && mouseEvent->exit == WidgetMouseEvent::eTopLevel);
// Get the frame at the event point. However, don't do this if we're // Get the frame at the event point. However, don't do this if we're

View File

@ -862,8 +862,8 @@ nsListControlFrame::HandleEvent(nsPresContext* aPresContext,
"<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>", "<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>",
"NS_MOUSE_RIGHT_BUTTON_UP", "NS_MOUSE_RIGHT_BUTTON_UP",
"NS_MOUSE_RIGHT_BUTTON_DOWN", "NS_MOUSE_RIGHT_BUTTON_DOWN",
"NS_MOUSE_ENTER_SYNTH", "NS_MOUSE_OVER",
"NS_MOUSE_EXIT_SYNTH", "NS_MOUSE_OUT",
"NS_MOUSE_LEFT_DOUBLECLICK", "NS_MOUSE_LEFT_DOUBLECLICK",
"NS_MOUSE_MIDDLE_DOUBLECLICK", "NS_MOUSE_MIDDLE_DOUBLECLICK",
"NS_MOUSE_RIGHT_DOUBLECLICK", "NS_MOUSE_RIGHT_DOUBLECLICK",

View File

@ -1783,7 +1783,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
#ifdef XP_MACOSX #ifdef XP_MACOSX
// we want to process some native mouse events in the cocoa event model // we want to process some native mouse events in the cocoa event model
if ((anEvent->message == NS_MOUSE_ENTER || if ((anEvent->message == NS_MOUSE_ENTER_WIDGET ||
anEvent->message == NS_WHEEL_WHEEL) && anEvent->message == NS_WHEEL_WHEEL) &&
mInstanceOwner->GetEventModel() == NPEventModelCocoa) { mInstanceOwner->GetEventModel() == NPEventModelCocoa) {
*anEventStatus = mInstanceOwner->ProcessEvent(*anEvent); *anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);

View File

@ -462,7 +462,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
*aEventStatus = nsEventStatus_eConsumeNoDefault; *aEventStatus = nsEventStatus_eConsumeNoDefault;
Execute(aEvent); Execute(aEvent);
} }
else if (aEvent->message == NS_MOUSE_EXIT_SYNTH) { else if (aEvent->message == NS_MOUSE_OUT) {
// Kill our timer if one is active. // Kill our timer if one is active.
if (mOpenTimer) { if (mOpenTimer) {
mOpenTimer->Cancel(); mOpenTimer->Cancel();

View File

@ -88,16 +88,16 @@ nsAutoRepeatBoxFrame::HandleEvent(nsPresContext* aPresContext,
// repeat mode may be "hover" for repeating while the mouse is hovering // repeat mode may be "hover" for repeating while the mouse is hovering
// over the element, otherwise repetition is done while the element is // over the element, otherwise repetition is done while the element is
// active (pressed). // active (pressed).
case NS_MOUSE_ENTER: case NS_MOUSE_ENTER_WIDGET:
case NS_MOUSE_ENTER_SYNTH: case NS_MOUSE_OVER:
if (IsActivatedOnHover()) { if (IsActivatedOnHover()) {
StartRepeat(); StartRepeat();
mTrustedEvent = aEvent->mFlags.mIsTrusted; mTrustedEvent = aEvent->mFlags.mIsTrusted;
} }
break; break;
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
case NS_MOUSE_EXIT_SYNTH: case NS_MOUSE_OUT:
// always stop on mouse exit // always stop on mouse exit
StopRepeat(); StopRepeat();
// Not really necessary but do this to be safe // Not really necessary but do this to be safe

View File

@ -63,7 +63,7 @@ nsScrollbarButtonFrame::HandleEvent(nsPresContext* aPresContext,
case NS_MOUSE_BUTTON_UP: case NS_MOUSE_BUTTON_UP:
HandleRelease(aPresContext, aEvent, aEventStatus); HandleRelease(aPresContext, aEvent, aEventStatus);
break; break;
case NS_MOUSE_EXIT_SYNTH: case NS_MOUSE_OUT:
mCursorOnThis = false; mCursorOnThis = false;
break; break;
case NS_MOUSE_MOVE: { case NS_MOUSE_MOVE: {

View File

@ -607,10 +607,10 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
#endif #endif
// XXX hack until handle release is actually called in nsframe. // XXX hack until handle release is actually called in nsframe.
// if (aEvent->message == NS_MOUSE_EXIT_SYNTH || aEvent->message == NS_MOUSE_RIGHT_BUTTON_UP || aEvent->message == NS_MOUSE_LEFT_BUTTON_UP) // if (aEvent->message == NS_MOUSE_OUT || aEvent->message == NS_MOUSE_RIGHT_BUTTON_UP || aEvent->message == NS_MOUSE_LEFT_BUTTON_UP)
// HandleRelease(aPresContext, aEvent, aEventStatus); // HandleRelease(aPresContext, aEvent, aEventStatus);
if (aEvent->message == NS_MOUSE_EXIT_SYNTH && mChange) if (aEvent->message == NS_MOUSE_OUT && mChange)
HandleRelease(aPresContext, aEvent, aEventStatus); HandleRelease(aPresContext, aEvent, aEventStatus);
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);

View File

@ -2564,7 +2564,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
WidgetGUIEvent* aEvent, WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) nsEventStatus* aEventStatus)
{ {
if (aEvent->message == NS_MOUSE_ENTER_SYNTH || aEvent->message == NS_MOUSE_MOVE) { if (aEvent->message == NS_MOUSE_OVER || aEvent->message == NS_MOUSE_MOVE) {
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this); nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
int32_t xTwips = pt.x - mInnerBox.x; int32_t xTwips = pt.x - mInnerBox.x;
int32_t yTwips = pt.y - mInnerBox.y; int32_t yTwips = pt.y - mInnerBox.y;
@ -2578,7 +2578,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
InvalidateRow(mMouseOverRow); InvalidateRow(mMouseOverRow);
} }
} }
else if (aEvent->message == NS_MOUSE_EXIT_SYNTH) { else if (aEvent->message == NS_MOUSE_OUT) {
if (mMouseOverRow != -1) { if (mMouseOverRow != -1) {
InvalidateRow(mMouseOverRow); InvalidateRow(mMouseOverRow);
mMouseOverRow = -1; mMouseOverRow = -1;

View File

@ -733,8 +733,8 @@ nsViewManager::DispatchEvent(WidgetGUIEvent *aEvent,
// Ignore mouse exit and enter (we'll get moves if the user // Ignore mouse exit and enter (we'll get moves if the user
// is really moving the mouse) since we get them when we // is really moving the mouse) since we get them when we
// create and destroy widgets. // create and destroy widgets.
mouseEvent->message != NS_MOUSE_EXIT && mouseEvent->message != NS_MOUSE_EXIT_WIDGET &&
mouseEvent->message != NS_MOUSE_ENTER) || mouseEvent->message != NS_MOUSE_ENTER_WIDGET) ||
aEvent->HasKeyEventMessage() || aEvent->HasKeyEventMessage() ||
aEvent->HasIMEEventMessage() || aEvent->HasIMEEventMessage() ||
aEvent->message == NS_PLUGIN_INPUT_EVENT) { aEvent->message == NS_PLUGIN_INPUT_EVENT) {

View File

@ -71,13 +71,13 @@
#define NS_MOUSE_MOVE (NS_MOUSE_MESSAGE_START) #define NS_MOUSE_MOVE (NS_MOUSE_MESSAGE_START)
#define NS_MOUSE_BUTTON_UP (NS_MOUSE_MESSAGE_START + 1) #define NS_MOUSE_BUTTON_UP (NS_MOUSE_MESSAGE_START + 1)
#define NS_MOUSE_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 2) #define NS_MOUSE_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 2)
#define NS_MOUSE_ENTER (NS_MOUSE_MESSAGE_START + 22) #define NS_MOUSE_ENTER_WIDGET (NS_MOUSE_MESSAGE_START + 22)
#define NS_MOUSE_EXIT (NS_MOUSE_MESSAGE_START + 23) #define NS_MOUSE_EXIT_WIDGET (NS_MOUSE_MESSAGE_START + 23)
#define NS_MOUSE_DOUBLECLICK (NS_MOUSE_MESSAGE_START + 24) #define NS_MOUSE_DOUBLECLICK (NS_MOUSE_MESSAGE_START + 24)
#define NS_MOUSE_CLICK (NS_MOUSE_MESSAGE_START + 27) #define NS_MOUSE_CLICK (NS_MOUSE_MESSAGE_START + 27)
#define NS_MOUSE_ACTIVATE (NS_MOUSE_MESSAGE_START + 30) #define NS_MOUSE_ACTIVATE (NS_MOUSE_MESSAGE_START + 30)
#define NS_MOUSE_ENTER_SYNTH (NS_MOUSE_MESSAGE_START + 31) #define NS_MOUSE_OVER (NS_MOUSE_MESSAGE_START + 31)
#define NS_MOUSE_EXIT_SYNTH (NS_MOUSE_MESSAGE_START + 32) #define NS_MOUSE_OUT (NS_MOUSE_MESSAGE_START + 32)
#define NS_MOUSE_MOZHITTEST (NS_MOUSE_MESSAGE_START + 33) #define NS_MOUSE_MOZHITTEST (NS_MOUSE_MESSAGE_START + 33)
#define NS_MOUSEENTER (NS_MOUSE_MESSAGE_START + 34) #define NS_MOUSEENTER (NS_MOUSE_MESSAGE_START + 34)
#define NS_MOUSELEAVE (NS_MOUSE_MESSAGE_START + 35) #define NS_MOUSELEAVE (NS_MOUSE_MESSAGE_START + 35)
@ -132,9 +132,7 @@
#define NS_DRAGDROP_END (NS_DRAGDROP_EVENT_START + 6) #define NS_DRAGDROP_END (NS_DRAGDROP_EVENT_START + 6)
#define NS_DRAGDROP_START (NS_DRAGDROP_EVENT_START + 7) #define NS_DRAGDROP_START (NS_DRAGDROP_EVENT_START + 7)
#define NS_DRAGDROP_DROP (NS_DRAGDROP_EVENT_START + 8) #define NS_DRAGDROP_DROP (NS_DRAGDROP_EVENT_START + 8)
#define NS_DRAGDROP_OVER_SYNTH (NS_DRAGDROP_EVENT_START + 1) #define NS_DRAGDROP_LEAVE (NS_DRAGDROP_EVENT_START + 9)
#define NS_DRAGDROP_EXIT_SYNTH (NS_DRAGDROP_EVENT_START + 2)
#define NS_DRAGDROP_LEAVE_SYNTH (NS_DRAGDROP_EVENT_START + 9)
// Events for popups // Events for popups
#define NS_XUL_EVENT_START 1500 #define NS_XUL_EVENT_START 1500

View File

@ -195,7 +195,7 @@ MultiTouchInput::MultiTouchInput(const WidgetMouseEvent& aMouseEvent)
// manner, such as a synchronous event or action cancelling the touch, or a // manner, such as a synchronous event or action cancelling the touch, or a
// touch point leaving the document window and going into a non-document // touch point leaving the document window and going into a non-document
// area capable of handling user interactions. // area capable of handling user interactions.
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
mType = MULTITOUCH_CANCEL; mType = MULTITOUCH_CANCEL;
break; break;
default: default:

View File

@ -322,8 +322,8 @@ public:
, mDefaultPreventedOnContent(false) , mDefaultPreventedOnContent(false)
{ {
mFlags.mCancelable = mFlags.mCancelable =
(aMessage != NS_DRAGDROP_EXIT_SYNTH && (aMessage != NS_DRAGDROP_EXIT &&
aMessage != NS_DRAGDROP_LEAVE_SYNTH && aMessage != NS_DRAGDROP_LEAVE &&
aMessage != NS_DRAGDROP_END); aMessage != NS_DRAGDROP_END);
} }

View File

@ -82,11 +82,11 @@ WidgetEvent::HasMouseEventMessage() const
case NS_MOUSE_BUTTON_UP: case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_CLICK: case NS_MOUSE_CLICK:
case NS_MOUSE_DOUBLECLICK: case NS_MOUSE_DOUBLECLICK:
case NS_MOUSE_ENTER: case NS_MOUSE_ENTER_WIDGET:
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
case NS_MOUSE_ACTIVATE: case NS_MOUSE_ACTIVATE:
case NS_MOUSE_ENTER_SYNTH: case NS_MOUSE_OVER:
case NS_MOUSE_EXIT_SYNTH: case NS_MOUSE_OUT:
case NS_MOUSE_MOZHITTEST: case NS_MOUSE_MOZHITTEST:
case NS_MOUSE_MOVE: case NS_MOUSE_MOVE:
return true; return true;
@ -108,7 +108,7 @@ WidgetEvent::HasDragEventMessage() const
case NS_DRAGDROP_END: case NS_DRAGDROP_END:
case NS_DRAGDROP_START: case NS_DRAGDROP_START:
case NS_DRAGDROP_DROP: case NS_DRAGDROP_DROP:
case NS_DRAGDROP_LEAVE_SYNTH: case NS_DRAGDROP_LEAVE:
return true; return true;
default: default:
return false; return false;

View File

@ -834,10 +834,10 @@ AndroidGeckoEvent::MakeMouseEvent(nsIWidget* widget)
msg = NS_MOUSE_MOVE; msg = NS_MOUSE_MOVE;
break; break;
case AndroidMotionEvent::ACTION_HOVER_ENTER: case AndroidMotionEvent::ACTION_HOVER_ENTER:
msg = NS_MOUSE_ENTER; msg = NS_MOUSE_ENTER_WIDGET;
break; break;
case AndroidMotionEvent::ACTION_HOVER_EXIT: case AndroidMotionEvent::ACTION_HOVER_EXIT:
msg = NS_MOUSE_EXIT; msg = NS_MOUSE_EXIT_WIDGET;
break; break;
default: default:
break; break;

View File

@ -382,8 +382,8 @@ nsWindow::Show(bool aState)
// XXX should we bring this to the front when it's shown, // XXX should we bring this to the front when it's shown,
// if it's a toplevel widget? // if it's a toplevel widget?
// XXX we should synthesize a NS_MOUSE_EXIT (for old top // XXX we should synthesize a NS_MOUSE_EXIT_WIDGET (for old top
// window)/NS_MOUSE_ENTER (for new top window) since we need // window)/NS_MOUSE_ENTER_WIDGET (for new top window) since we need
// to pretend that the top window always has focus. Not sure // to pretend that the top window always has focus. Not sure
// if Show() is the right place to do this, though. // if Show() is the right place to do this, though.

View File

@ -4549,7 +4549,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
NSPoint windowEventLocation = nsCocoaUtils::EventLocationForWindow(aEvent, [self window]); NSPoint windowEventLocation = nsCocoaUtils::EventLocationForWindow(aEvent, [self window]);
NSPoint localEventLocation = [self convertPoint:windowEventLocation fromView:nil]; NSPoint localEventLocation = [self convertPoint:windowEventLocation fromView:nil];
uint32_t msg = aEnter ? NS_MOUSE_ENTER : NS_MOUSE_EXIT; uint32_t msg = aEnter ? NS_MOUSE_ENTER_WIDGET : NS_MOUSE_EXIT_WIDGET;
WidgetMouseEvent event(true, msg, mGeckoChild, WidgetMouseEvent::eReal); WidgetMouseEvent event(true, msg, mGeckoChild, WidgetMouseEvent::eReal);
event.refPoint = LayoutDeviceIntPoint::FromUntyped( event.refPoint = LayoutDeviceIntPoint::FromUntyped(
mGeckoChild->CocoaPointsToDevPixels(localEventLocation)); mGeckoChild->CocoaPointsToDevPixels(localEventLocation));

View File

@ -2542,7 +2542,7 @@ nsWindow::OnEnterNotifyEvent(GdkEventCrossing *aEvent)
if (is_parent_ungrab_enter(aEvent)) if (is_parent_ungrab_enter(aEvent))
return; return;
WidgetMouseEvent event(true, NS_MOUSE_ENTER, this, WidgetMouseEvent::eReal); WidgetMouseEvent event(true, NS_MOUSE_ENTER_WIDGET, this, WidgetMouseEvent::eReal);
event.refPoint.x = nscoord(aEvent->x); event.refPoint.x = nscoord(aEvent->x);
event.refPoint.y = nscoord(aEvent->y); event.refPoint.y = nscoord(aEvent->y);
@ -2583,7 +2583,7 @@ nsWindow::OnLeaveNotifyEvent(GdkEventCrossing *aEvent)
if (aEvent->subwindow != nullptr) if (aEvent->subwindow != nullptr)
return; return;
WidgetMouseEvent event(true, NS_MOUSE_EXIT, this, WidgetMouseEvent::eReal); WidgetMouseEvent event(true, NS_MOUSE_EXIT_WIDGET, this, WidgetMouseEvent::eReal);
event.refPoint.x = nscoord(aEvent->x); event.refPoint.x = nscoord(aEvent->x);
event.refPoint.y = nscoord(aEvent->y); event.refPoint.y = nscoord(aEvent->y);

View File

@ -1938,8 +1938,8 @@ case _value: eventName.AssignLiteral(_name) ; break
_ASSIGN_eventName(NS_KEY_DOWN,"NS_KEY_DOWN"); _ASSIGN_eventName(NS_KEY_DOWN,"NS_KEY_DOWN");
_ASSIGN_eventName(NS_KEY_PRESS,"NS_KEY_PRESS"); _ASSIGN_eventName(NS_KEY_PRESS,"NS_KEY_PRESS");
_ASSIGN_eventName(NS_KEY_UP,"NS_KEY_UP"); _ASSIGN_eventName(NS_KEY_UP,"NS_KEY_UP");
_ASSIGN_eventName(NS_MOUSE_ENTER,"NS_MOUSE_ENTER"); _ASSIGN_eventName(NS_MOUSE_ENTER_WIDGET,"NS_MOUSE_ENTER_WIDGET");
_ASSIGN_eventName(NS_MOUSE_EXIT,"NS_MOUSE_EXIT"); _ASSIGN_eventName(NS_MOUSE_EXIT_WIDGET,"NS_MOUSE_EXIT_WIDGET");
_ASSIGN_eventName(NS_MOUSE_BUTTON_DOWN,"NS_MOUSE_BUTTON_DOWN"); _ASSIGN_eventName(NS_MOUSE_BUTTON_DOWN,"NS_MOUSE_BUTTON_DOWN");
_ASSIGN_eventName(NS_MOUSE_BUTTON_UP,"NS_MOUSE_BUTTON_UP"); _ASSIGN_eventName(NS_MOUSE_BUTTON_UP,"NS_MOUSE_BUTTON_UP");
_ASSIGN_eventName(NS_MOUSE_CLICK,"NS_MOUSE_CLICK"); _ASSIGN_eventName(NS_MOUSE_CLICK,"NS_MOUSE_CLICK");
@ -2099,8 +2099,8 @@ nsBaseWidget::debug_DumpEvent(FILE * aFileOut,
return; return;
} }
if (aGuiEvent->message == NS_MOUSE_ENTER || if (aGuiEvent->message == NS_MOUSE_ENTER_WIDGET ||
aGuiEvent->message == NS_MOUSE_EXIT) aGuiEvent->message == NS_MOUSE_EXIT_WIDGET)
{ {
if (!debug_GetCachedBoolPref("nglayout.debug.crossing_event_dumping")) if (!debug_GetCachedBoolPref("nglayout.debug.crossing_event_dumping"))
return; return;

View File

@ -3780,8 +3780,8 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam,
&& nsWindowType::eWindowType_toplevel == mWindowType && nsWindowType::eWindowType_toplevel == mWindowType
// Currently this scheme is used only when pointer events is enabled. // Currently this scheme is used only when pointer events is enabled.
&& gfxPrefs::PointerEventsEnabled() && gfxPrefs::PointerEventsEnabled()
// NS_MOUSE_EXIT is received, when InkCollector has been already initialized. // NS_MOUSE_EXIT_WIDGET is received, when InkCollector has been already initialized.
&& NS_MOUSE_EXIT != aEventType) { && NS_MOUSE_EXIT_WIDGET != aEventType) {
InkCollector::sInkCollector->SetTarget(mWnd); InkCollector::sInkCollector->SetTarget(mWnd);
} }
@ -3790,11 +3790,11 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam,
CaptureMouse(true); CaptureMouse(true);
break; break;
// NS_MOUSE_MOVE and NS_MOUSE_EXIT are here because we need to make sure capture flag // NS_MOUSE_MOVE and NS_MOUSE_EXIT_WIDGET are here because we need to make sure capture flag
// isn't left on after a drag where we wouldn't see a button up message (see bug 324131). // isn't left on after a drag where we wouldn't see a button up message (see bug 324131).
case NS_MOUSE_BUTTON_UP: case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_MOVE: case NS_MOUSE_MOVE:
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
if (!(wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) && sIsInMouseCapture) if (!(wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) && sIsInMouseCapture)
CaptureMouse(false); CaptureMouse(false);
break; break;
@ -3887,7 +3887,7 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam,
else if (aEventType == NS_MOUSE_MOVE && !insideMovementThreshold) { else if (aEventType == NS_MOUSE_MOVE && !insideMovementThreshold) {
sLastClickCount = 0; sLastClickCount = 0;
} }
else if (aEventType == NS_MOUSE_EXIT) { else if (aEventType == NS_MOUSE_EXIT_WIDGET) {
event.exit = IsTopLevelMouseExit(mWnd) ? event.exit = IsTopLevelMouseExit(mWnd) ?
WidgetMouseEvent::eTopLevel : WidgetMouseEvent::eChild; WidgetMouseEvent::eTopLevel : WidgetMouseEvent::eChild;
} }
@ -3950,7 +3950,7 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam,
case NS_MOUSE_MOVE: case NS_MOUSE_MOVE:
pluginEvent.event = WM_MOUSEMOVE; pluginEvent.event = WM_MOUSEMOVE;
break; break;
case NS_MOUSE_EXIT: case NS_MOUSE_EXIT_WIDGET:
pluginEvent.event = WM_MOUSELEAVE; pluginEvent.event = WM_MOUSELEAVE;
break; break;
default: default:
@ -3980,20 +3980,20 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam,
if (sCurrentWindow == nullptr || sCurrentWindow != this) { if (sCurrentWindow == nullptr || sCurrentWindow != this) {
if ((nullptr != sCurrentWindow) && (!sCurrentWindow->mInDtor)) { if ((nullptr != sCurrentWindow) && (!sCurrentWindow->mInDtor)) {
LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam)); LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam));
sCurrentWindow->DispatchMouseEvent(NS_MOUSE_EXIT, wParam, pos, false, sCurrentWindow->DispatchMouseEvent(NS_MOUSE_EXIT_WIDGET, wParam, pos, false,
WidgetMouseEvent::eLeftButton, WidgetMouseEvent::eLeftButton,
aInputSource); aInputSource);
} }
sCurrentWindow = this; sCurrentWindow = this;
if (!mInDtor) { if (!mInDtor) {
LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam)); LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam));
sCurrentWindow->DispatchMouseEvent(NS_MOUSE_ENTER, wParam, pos, false, sCurrentWindow->DispatchMouseEvent(NS_MOUSE_ENTER_WIDGET, wParam, pos, false,
WidgetMouseEvent::eLeftButton, WidgetMouseEvent::eLeftButton,
aInputSource); aInputSource);
} }
} }
} }
} else if (aEventType == NS_MOUSE_EXIT) { } else if (aEventType == NS_MOUSE_EXIT_WIDGET) {
if (sCurrentWindow == this) { if (sCurrentWindow == this) {
sCurrentWindow = nullptr; sCurrentWindow = nullptr;
} }
@ -4864,7 +4864,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
case WM_NCMOUSEMOVE: case WM_NCMOUSEMOVE:
// If we receive a mouse move event on non-client chrome, make sure and // If we receive a mouse move event on non-client chrome, make sure and
// send an NS_MOUSE_EXIT event as well. // send an NS_MOUSE_EXIT_WIDGET event as well.
if (mMousePresent && !sIsInMouseCapture) if (mMousePresent && !sIsInMouseCapture)
SendMessage(mWnd, WM_MOUSELEAVE, 0, 0); SendMessage(mWnd, WM_MOUSELEAVE, 0, 0);
break; break;
@ -4901,7 +4901,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
// Synthesize an event position because we don't get one from // Synthesize an event position because we don't get one from
// WM_MOUSELEAVE. // WM_MOUSELEAVE.
LPARAM pos = lParamToClient(::GetMessagePos()); LPARAM pos = lParamToClient(::GetMessagePos());
DispatchMouseEvent(NS_MOUSE_EXIT, mouseState, pos, false, DispatchMouseEvent(NS_MOUSE_EXIT_WIDGET, mouseState, pos, false,
WidgetMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); WidgetMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE());
} }
break; break;
@ -4909,7 +4909,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
case MOZ_WM_PEN_LEAVES_HOVER_OF_DIGITIZER: case MOZ_WM_PEN_LEAVES_HOVER_OF_DIGITIZER:
{ {
LPARAM pos = lParamToClient(::GetMessagePos()); LPARAM pos = lParamToClient(::GetMessagePos());
DispatchMouseEvent(NS_MOUSE_EXIT, wParam, pos, false, DispatchMouseEvent(NS_MOUSE_EXIT_WIDGET, wParam, pos, false,
WidgetMouseEvent::eLeftButton, WidgetMouseEvent::eLeftButton,
nsIDOMMouseEvent::MOZ_SOURCE_PEN); nsIDOMMouseEvent::MOZ_SOURCE_PEN);
} }