diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index af2ca8288cf4..1643c06e2f5d 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -2769,9 +2769,9 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor) // Optimisation: return early if this event doesn't interest us. // IMPORTANT: this switch and the switch below it must be kept in sync! switch (aVisitor.mEvent->message) { - case NS_MOUSE_ENTER_SYNTH: + case NS_MOUSE_OVER: case NS_FOCUS_CONTENT: - case NS_MOUSE_EXIT_SYNTH: + case NS_MOUSE_OUT: case NS_BLUR_CONTENT: break; default: @@ -2790,7 +2790,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor) // updated even if the event is consumed before we have a chance to set it. switch (aVisitor.mEvent->message) { // Set the status bar similarly for mouseover and focus - case NS_MOUSE_ENTER_SYNTH: + case NS_MOUSE_OVER: aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault; // FALL THROUGH case NS_FOCUS_CONTENT: { @@ -2805,7 +2805,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor) } break; } - case NS_MOUSE_EXIT_SYNTH: + case NS_MOUSE_OUT: aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault; // FALL THROUGH case NS_BLUR_CONTENT: diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index d1f8787cdeb3..b9f2479a7d31 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -676,8 +676,8 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor) // Don't propagate mouseover and mouseout events when mouse is moving // inside chrome access only content. bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree(); - if ((aVisitor.mEvent->message == NS_MOUSE_ENTER_SYNTH || - aVisitor.mEvent->message == NS_MOUSE_EXIT_SYNTH || + if ((aVisitor.mEvent->message == NS_MOUSE_OVER || + aVisitor.mEvent->message == NS_MOUSE_OUT || aVisitor.mEvent->message == NS_POINTER_OVER || aVisitor.mEvent->message == NS_POINTER_OUT) && // Check if we should stop event propagation when event has just been @@ -738,7 +738,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor) printf("Stopping %s propagation:" "\n\toriginalTarget=%s \n\tcurrentTarget=%s %s" "\n\trelatedTarget=%s %s \n%s", - (aVisitor.mEvent->message == NS_MOUSE_ENTER_SYNTH) + (aVisitor.mEvent->message == NS_MOUSE_OVER) ? "mouseover" : "mouseout", NS_ConvertUTF16toUTF8(ot).get(), NS_ConvertUTF16toUTF8(ct).get(), diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 6a6f64fb77b9..ba2e8d9b98e7 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -7653,9 +7653,9 @@ nsContentUtils::SendMouseEvent(nsCOMPtr aPresShell, else if (aType.EqualsLiteral("mousemove")) msg = NS_MOUSE_MOVE; else if (aType.EqualsLiteral("mouseover")) - msg = NS_MOUSE_ENTER; + msg = NS_MOUSE_ENTER_WIDGET; else if (aType.EqualsLiteral("mouseout")) - msg = NS_MOUSE_EXIT; + msg = NS_MOUSE_EXIT_WIDGET; else if (aType.EqualsLiteral("contextmenu")) { msg = NS_CONTEXTMENU; contextMenuKey = (aButton == 0); diff --git a/dom/events/DataTransfer.cpp b/dom/events/DataTransfer.cpp index 8de52e64f3c1..c8c5b3fd2347 100644 --- a/dom/events/DataTransfer.cpp +++ b/dom/events/DataTransfer.cpp @@ -94,7 +94,7 @@ DataTransfer::DataTransfer(nsISupports* aParent, uint32_t aEventType, } else if (mIsExternal) { if (aEventType == NS_PASTE) { 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(); } } diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index de99cc61865e..02ed7a8afd80 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -191,11 +191,11 @@ EVENT(dragenter, EventNameType_HTMLXUL, eDragEventClass) EVENT(dragleave, - NS_DRAGDROP_LEAVE_SYNTH, + NS_DRAGDROP_LEAVE, EventNameType_HTMLXUL, eDragEventClass) EVENT(dragover, - NS_DRAGDROP_OVER_SYNTH, + NS_DRAGDROP_OVER, EventNameType_HTMLXUL, eDragEventClass) EVENT(dragstart, @@ -283,11 +283,11 @@ EVENT(mousemove, EventNameType_All, eMouseEventClass) EVENT(mouseout, - NS_MOUSE_EXIT_SYNTH, + NS_MOUSE_OUT, EventNameType_All, eMouseEventClass) EVENT(mouseover, - NS_MOUSE_ENTER_SYNTH, + NS_MOUSE_OVER, EventNameType_All, eMouseEventClass) EVENT(mouseup, @@ -720,7 +720,7 @@ NON_IDL_EVENT(commandupdate, EventNameType_XUL, eBasicEventClass) NON_IDL_EVENT(dragexit, - NS_DRAGDROP_EXIT_SYNTH, + NS_DRAGDROP_EXIT, EventNameType_XUL, eDragEventClass) NON_IDL_EVENT(dragdrop, diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 73e26424e7bb..869c45eeaaac 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -491,13 +491,13 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, mCurrentTarget = aTargetFrame; 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. WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent(); if (aEvent->mFlags.mIsTrusted && ((mouseEvent && mouseEvent->IsReal() && - mouseEvent->message != NS_MOUSE_ENTER && - mouseEvent->message != NS_MOUSE_EXIT) || + mouseEvent->message != NS_MOUSE_ENTER_WIDGET && + mouseEvent->message != NS_MOUSE_EXIT_WIDGET) || aEvent->mClass == eWheelEventClass || aEvent->mClass == eKeyboardEventClass)) { if (gMouseOrKeyboardEventCounter == 0) { @@ -580,8 +580,8 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, } break; } - case NS_MOUSE_EXIT: - // If this is a remote frame, we receive NS_MOUSE_EXIT from the parent + case NS_MOUSE_EXIT_WIDGET: + // 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 // while the mouse is outside our frame, and since PuppetWidget caches the // 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_MOVE: case NS_CONTEXTMENU: - case NS_MOUSE_ENTER: - case NS_MOUSE_EXIT: - case NS_MOUSE_ENTER_SYNTH: + case NS_MOUSE_ENTER_WIDGET: + case NS_MOUSE_EXIT_WIDGET: + case NS_MOUSE_OVER: return true; default: return false; @@ -3325,7 +3325,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, } break; - case NS_MOUSE_ENTER: + case NS_MOUSE_ENTER_WIDGET: if (mCurrentTarget) { nsCOMPtr targetContent; mCurrentTarget->GetContentForEvent(aEvent, getter_AddRefs(targetContent)); @@ -3747,8 +3747,8 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent, if (sIsPointerLocked && (aMessage == NS_MOUSELEAVE || aMessage == NS_MOUSEENTER || - aMessage == NS_MOUSE_ENTER_SYNTH || - aMessage == NS_MOUSE_EXIT_SYNTH)) { + aMessage == NS_MOUSE_OVER || + aMessage == NS_MOUSE_OUT)) { mCurrentTargetContent = nullptr; nsCOMPtr pointerLockedElement = do_QueryReferent(EventStateManager::sPointerLockedElement); @@ -3793,10 +3793,10 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent, // If we are entering/leaving remote content, dispatch a mouse enter/exit // event to the remote frame. 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. nsAutoPtr remoteEvent; - CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_EXIT, + CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_EXIT_WIDGET, aRelatedContent, remoteEvent); remoteEvent->exit = WidgetMouseEvent::eTopLevel; @@ -3806,9 +3806,9 @@ EventStateManager::DispatchMouseOrPointerEvent(WidgetMouseEvent* aMouseEvent, // proper target via GetEventTarget which will return mCurrentTarget. mCurrentTarget = targetFrame; HandleCrossProcessEvent(remoteEvent, &status); - } else if (aMessage == NS_MOUSE_ENTER_SYNTH) { + } else if (aMessage == NS_MOUSE_OVER) { nsAutoPtr remoteEvent; - CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_ENTER, + CreateMouseOrPointerWidgetEvent(aMouseEvent, NS_MOUSE_ENTER_WIDGET, aRelatedContent, remoteEvent); HandleCrossProcessEvent(remoteEvent, &status); } @@ -3933,7 +3933,7 @@ EventStateManager::NotifyMouseOut(WidgetMouseEvent* aMouseEvent, NS_MOUSELEAVE); // 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->mLastOverFrame = nullptr; @@ -4006,7 +4006,7 @@ EventStateManager::NotifyMouseOver(WidgetMouseEvent* aMouseEvent, // Fire mouseover wrapper->mLastOverFrame = DispatchMouseOrPointerEvent(aMouseEvent, - isPointer ? NS_POINTER_OVER : NS_MOUSE_ENTER_SYNTH, + isPointer ? NS_POINTER_OVER : NS_MOUSE_OVER, aContent, lastOverElement); wrapper->mLastOverElement = aContent; } else { @@ -4164,7 +4164,7 @@ EventStateManager::GenerateMouseEnterExit(WidgetMouseEvent* aMouseEvent) break; case NS_POINTER_LEAVE: 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 // into any new element. @@ -4293,7 +4293,7 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext, getter_AddRefs(lastContent)); FireDragEnterOrExit(sLastDragOverFrame->PresContext(), - aDragEvent, NS_DRAGDROP_EXIT_SYNTH, + aDragEvent, NS_DRAGDROP_EXIT, targetContent, lastContent, sLastDragOverFrame); } @@ -4302,7 +4302,7 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext, if (sLastDragOverFrame) { FireDragEnterOrExit(sLastDragOverFrame->PresContext(), - aDragEvent, NS_DRAGDROP_LEAVE_SYNTH, + aDragEvent, NS_DRAGDROP_LEAVE, targetContent, lastContent, sLastDragOverFrame); } @@ -4321,10 +4321,10 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext, nsRefPtr lastDragOverFramePresContext = sLastDragOverFrame->PresContext(); FireDragEnterOrExit(lastDragOverFramePresContext, - aDragEvent, NS_DRAGDROP_EXIT_SYNTH, + aDragEvent, NS_DRAGDROP_EXIT, nullptr, lastContent, sLastDragOverFrame); FireDragEnterOrExit(lastDragOverFramePresContext, - aDragEvent, NS_DRAGDROP_LEAVE_SYNTH, + aDragEvent, NS_DRAGDROP_LEAVE, nullptr, lastContent, sLastDragOverFrame); sLastDragOverFrame = nullptr; @@ -4373,7 +4373,7 @@ EventStateManager::FireDragEnterOrExit(nsPresContext* aPresContext, // collect any changes to moz cursor settings stored in the event's // 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) UpdateDragDataTransfer(&event); } diff --git a/dom/html/HTMLButtonElement.cpp b/dom/html/HTMLButtonElement.cpp index 3147eb20926f..1596dd2c4cd6 100644 --- a/dom/html/HTMLButtonElement.cpp +++ b/dom/html/HTMLButtonElement.cpp @@ -347,7 +347,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor) } break; - case NS_MOUSE_ENTER_SYNTH: + case NS_MOUSE_OVER: { aVisitor.mPresContext->EventStateManager()-> SetContentState(this, NS_EVENT_STATE_HOVER); @@ -356,7 +356,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor) break; // XXX this doesn't seem to do anything yet - case NS_MOUSE_EXIT_SYNTH: + case NS_MOUSE_OUT: { aVisitor.mPresContext->EventStateManager()-> SetContentState(nullptr, NS_EVENT_STATE_HOVER); diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index 3e9199067507..d21f5820fa84 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -3370,10 +3370,10 @@ HTMLInputElement::NeedToInitializeEditorForEvent( switch (aVisitor.mEvent->message) { case NS_MOUSE_MOVE: - case NS_MOUSE_ENTER: - case NS_MOUSE_EXIT: - case NS_MOUSE_ENTER_SYNTH: - case NS_MOUSE_EXIT_SYNTH: + case NS_MOUSE_ENTER_WIDGET: + case NS_MOUSE_EXIT_WIDGET: + case NS_MOUSE_OVER: + case NS_MOUSE_OUT: case NS_SCROLLPORT_UNDERFLOW: case NS_SCROLLPORT_OVERFLOW: return false; diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index cbcde33f65d7..f7c72ef3ea9c 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1220,16 +1220,16 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event) if (widget) { // When we mouseenter the tab, the tab's cursor should become the current // cursor. When we mouseexit, we stop. - if (event.message == NS_MOUSE_ENTER || - event.message == NS_MOUSE_ENTER_SYNTH) { + if (event.message == NS_MOUSE_ENTER_WIDGET || + event.message == NS_MOUSE_OVER) { mTabSetsCursor = true; if (mCursor != nsCursor(-1)) { 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; - } else if (event.message == NS_MOUSE_EXIT || - event.message == NS_MOUSE_EXIT_SYNTH) { + } else if (event.message == NS_MOUSE_EXIT_WIDGET || + event.message == NS_MOUSE_OUT) { mTabSetsCursor = false; } } diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 272cfc072219..932ba4186473 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -1759,9 +1759,9 @@ CocoaEventTypeForEvent(const WidgetGUIEvent& anEvent, nsIFrame* aObjectFrame) } switch (anEvent.message) { - case NS_MOUSE_ENTER_SYNTH: + case NS_MOUSE_OVER: return NPCocoaEventMouseEntered; - case NS_MOUSE_EXIT_SYNTH: + case NS_MOUSE_OUT: return NPCocoaEventMouseExited; case NS_MOUSE_MOVE: { @@ -1803,8 +1803,8 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame) anEvent->message == NS_MOUSE_BUTTON_DOWN || anEvent->message == NS_MOUSE_BUTTON_UP || anEvent->message == NS_MOUSE_SCROLL || - anEvent->message == NS_MOUSE_ENTER_SYNTH || - anEvent->message == NS_MOUSE_EXIT_SYNTH) + anEvent->message == NS_MOUSE_OVER || + anEvent->message == NS_MOUSE_OUT) { nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(anEvent, aObjectFrame) - aObjectFrame->GetContentRectRelativeToSelf().TopLeft(); @@ -2059,8 +2059,8 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent) NS_ASSERTION(anEvent.message == NS_MOUSE_BUTTON_DOWN || anEvent.message == NS_MOUSE_BUTTON_UP || anEvent.message == NS_MOUSE_DOUBLECLICK || - anEvent.message == NS_MOUSE_ENTER_SYNTH || - anEvent.message == NS_MOUSE_EXIT_SYNTH || + anEvent.message == NS_MOUSE_OVER || + anEvent.message == NS_MOUSE_OUT || anEvent.message == NS_MOUSE_MOVE, "Incorrect event type for coordinate translation"); nsPoint pt = @@ -2145,11 +2145,11 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent) switch (anEvent.message) { - case NS_MOUSE_ENTER_SYNTH: - case NS_MOUSE_EXIT_SYNTH: + case NS_MOUSE_OVER: + case NS_MOUSE_OUT: { XCrossingEvent& event = pluginEvent.xcrossing; - event.type = anEvent.message == NS_MOUSE_ENTER_SYNTH ? + event.type = anEvent.message == NS_MOUSE_OVER ? EnterNotify : LeaveNotify; event.root = root; event.time = anEvent.time; diff --git a/editor/libeditor/nsEditorEventListener.cpp b/editor/libeditor/nsEditorEventListener.cpp index 5a23d234268f..6a116e3d3907 100644 --- a/editor/libeditor/nsEditorEventListener.cpp +++ b/editor/libeditor/nsEditorEventListener.cpp @@ -374,12 +374,12 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent) return DragEnter(dragEvent); } // dragover - case NS_DRAGDROP_OVER_SYNTH: { + case NS_DRAGDROP_OVER: { nsCOMPtr dragEvent = do_QueryInterface(aEvent); return DragOver(dragEvent); } // dragexit - case NS_DRAGDROP_EXIT_SYNTH: { + case NS_DRAGDROP_EXIT: { nsCOMPtr dragEvent = do_QueryInterface(aEvent); return DragExit(dragEvent); } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index ee9b119c0714..7dbdbb19e8df 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -6518,7 +6518,7 @@ void PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent) { switch (aEvent->message) { - case NS_MOUSE_ENTER: + case NS_MOUSE_ENTER_WIDGET: // In this case we have to know information about available mouse pointers if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) { gActivePointersIds->Put(mouseEvent->pointerId, @@ -6543,7 +6543,7 @@ PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent) } } break; - case NS_MOUSE_EXIT: + case NS_MOUSE_EXIT_WIDGET: // In this case we have to remove information about disappeared mouse pointers if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) { gActivePointersIds->Remove(mouseEvent->pointerId); @@ -6739,7 +6739,7 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent) if ((aEvent->message == NS_MOUSE_MOVE && 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_UP) { nsIFrame* rootFrame = GetRootFrame(); @@ -6752,15 +6752,15 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent) nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame); } #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", this, aEvent->widget); printf("[ps=%p]setting mouse location to (%d,%d)\n", this, mMouseLocation.x, mMouseLocation.y); #endif - if (aEvent->message == NS_MOUSE_ENTER) + if (aEvent->message == NS_MOUSE_ENTER_WIDGET) 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 // 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 @@ -7458,7 +7458,7 @@ PresShell::HandleEvent(nsIFrame* aFrame, } WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent(); - bool isWindowLevelMouseExit = (aEvent->message == NS_MOUSE_EXIT) && + bool isWindowLevelMouseExit = (aEvent->message == NS_MOUSE_EXIT_WIDGET) && (mouseEvent && mouseEvent->exit == WidgetMouseEvent::eTopLevel); // Get the frame at the event point. However, don't do this if we're diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index 5d9390d7cfbf..fbfdf2472b76 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -862,8 +862,8 @@ nsListControlFrame::HandleEvent(nsPresContext* aPresContext, "","","","","","","","", "NS_MOUSE_RIGHT_BUTTON_UP", "NS_MOUSE_RIGHT_BUTTON_DOWN", - "NS_MOUSE_ENTER_SYNTH", - "NS_MOUSE_EXIT_SYNTH", + "NS_MOUSE_OVER", + "NS_MOUSE_OUT", "NS_MOUSE_LEFT_DOUBLECLICK", "NS_MOUSE_MIDDLE_DOUBLECLICK", "NS_MOUSE_RIGHT_DOUBLECLICK", diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp index 0d7a37b414b8..bf7c5bddf4f5 100644 --- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -1783,7 +1783,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext, #ifdef XP_MACOSX // 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) && mInstanceOwner->GetEventModel() == NPEventModelCocoa) { *anEventStatus = mInstanceOwner->ProcessEvent(*anEvent); diff --git a/layout/xul/nsMenuFrame.cpp b/layout/xul/nsMenuFrame.cpp index 9b2d5a7343c4..47bff9af15d2 100644 --- a/layout/xul/nsMenuFrame.cpp +++ b/layout/xul/nsMenuFrame.cpp @@ -462,7 +462,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext, *aEventStatus = nsEventStatus_eConsumeNoDefault; Execute(aEvent); } - else if (aEvent->message == NS_MOUSE_EXIT_SYNTH) { + else if (aEvent->message == NS_MOUSE_OUT) { // Kill our timer if one is active. if (mOpenTimer) { mOpenTimer->Cancel(); diff --git a/layout/xul/nsScrollBoxFrame.cpp b/layout/xul/nsScrollBoxFrame.cpp index 47e7f1b93daa..8a9779a064b7 100644 --- a/layout/xul/nsScrollBoxFrame.cpp +++ b/layout/xul/nsScrollBoxFrame.cpp @@ -88,16 +88,16 @@ nsAutoRepeatBoxFrame::HandleEvent(nsPresContext* aPresContext, // repeat mode may be "hover" for repeating while the mouse is hovering // over the element, otherwise repetition is done while the element is // active (pressed). - case NS_MOUSE_ENTER: - case NS_MOUSE_ENTER_SYNTH: + case NS_MOUSE_ENTER_WIDGET: + case NS_MOUSE_OVER: if (IsActivatedOnHover()) { StartRepeat(); mTrustedEvent = aEvent->mFlags.mIsTrusted; } break; - case NS_MOUSE_EXIT: - case NS_MOUSE_EXIT_SYNTH: + case NS_MOUSE_EXIT_WIDGET: + case NS_MOUSE_OUT: // always stop on mouse exit StopRepeat(); // Not really necessary but do this to be safe diff --git a/layout/xul/nsScrollbarButtonFrame.cpp b/layout/xul/nsScrollbarButtonFrame.cpp index 193a477f233f..e135eccd01bb 100644 --- a/layout/xul/nsScrollbarButtonFrame.cpp +++ b/layout/xul/nsScrollbarButtonFrame.cpp @@ -63,7 +63,7 @@ nsScrollbarButtonFrame::HandleEvent(nsPresContext* aPresContext, case NS_MOUSE_BUTTON_UP: HandleRelease(aPresContext, aEvent, aEventStatus); break; - case NS_MOUSE_EXIT_SYNTH: + case NS_MOUSE_OUT: mCursorOnThis = false; break; case NS_MOUSE_MOVE: { diff --git a/layout/xul/nsSliderFrame.cpp b/layout/xul/nsSliderFrame.cpp index 63c11d8b5d2e..a5f51c07012c 100644 --- a/layout/xul/nsSliderFrame.cpp +++ b/layout/xul/nsSliderFrame.cpp @@ -607,10 +607,10 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext, #endif // 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); - if (aEvent->message == NS_MOUSE_EXIT_SYNTH && mChange) + if (aEvent->message == NS_MOUSE_OUT && mChange) HandleRelease(aPresContext, aEvent, aEventStatus); return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus); diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index b75932cf0ce6..80f5891c8bb2 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -2564,7 +2564,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext, WidgetGUIEvent* aEvent, 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); int32_t xTwips = pt.x - mInnerBox.x; int32_t yTwips = pt.y - mInnerBox.y; @@ -2578,7 +2578,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext, InvalidateRow(mMouseOverRow); } } - else if (aEvent->message == NS_MOUSE_EXIT_SYNTH) { + else if (aEvent->message == NS_MOUSE_OUT) { if (mMouseOverRow != -1) { InvalidateRow(mMouseOverRow); mMouseOverRow = -1; diff --git a/view/nsViewManager.cpp b/view/nsViewManager.cpp index c5d5eacabc97..9e35bebb0b06 100644 --- a/view/nsViewManager.cpp +++ b/view/nsViewManager.cpp @@ -733,8 +733,8 @@ nsViewManager::DispatchEvent(WidgetGUIEvent *aEvent, // Ignore mouse exit and enter (we'll get moves if the user // is really moving the mouse) since we get them when we // create and destroy widgets. - mouseEvent->message != NS_MOUSE_EXIT && - mouseEvent->message != NS_MOUSE_ENTER) || + mouseEvent->message != NS_MOUSE_EXIT_WIDGET && + mouseEvent->message != NS_MOUSE_ENTER_WIDGET) || aEvent->HasKeyEventMessage() || aEvent->HasIMEEventMessage() || aEvent->message == NS_PLUGIN_INPUT_EVENT) { diff --git a/widget/BasicEvents.h b/widget/BasicEvents.h index 6c3e4c83a0f4..5406e561d0ff 100644 --- a/widget/BasicEvents.h +++ b/widget/BasicEvents.h @@ -71,13 +71,13 @@ #define NS_MOUSE_MOVE (NS_MOUSE_MESSAGE_START) #define NS_MOUSE_BUTTON_UP (NS_MOUSE_MESSAGE_START + 1) #define NS_MOUSE_BUTTON_DOWN (NS_MOUSE_MESSAGE_START + 2) -#define NS_MOUSE_ENTER (NS_MOUSE_MESSAGE_START + 22) -#define NS_MOUSE_EXIT (NS_MOUSE_MESSAGE_START + 23) +#define NS_MOUSE_ENTER_WIDGET (NS_MOUSE_MESSAGE_START + 22) +#define NS_MOUSE_EXIT_WIDGET (NS_MOUSE_MESSAGE_START + 23) #define NS_MOUSE_DOUBLECLICK (NS_MOUSE_MESSAGE_START + 24) #define NS_MOUSE_CLICK (NS_MOUSE_MESSAGE_START + 27) #define NS_MOUSE_ACTIVATE (NS_MOUSE_MESSAGE_START + 30) -#define NS_MOUSE_ENTER_SYNTH (NS_MOUSE_MESSAGE_START + 31) -#define NS_MOUSE_EXIT_SYNTH (NS_MOUSE_MESSAGE_START + 32) +#define NS_MOUSE_OVER (NS_MOUSE_MESSAGE_START + 31) +#define NS_MOUSE_OUT (NS_MOUSE_MESSAGE_START + 32) #define NS_MOUSE_MOZHITTEST (NS_MOUSE_MESSAGE_START + 33) #define NS_MOUSEENTER (NS_MOUSE_MESSAGE_START + 34) #define NS_MOUSELEAVE (NS_MOUSE_MESSAGE_START + 35) @@ -132,9 +132,7 @@ #define NS_DRAGDROP_END (NS_DRAGDROP_EVENT_START + 6) #define NS_DRAGDROP_START (NS_DRAGDROP_EVENT_START + 7) #define NS_DRAGDROP_DROP (NS_DRAGDROP_EVENT_START + 8) -#define NS_DRAGDROP_OVER_SYNTH (NS_DRAGDROP_EVENT_START + 1) -#define NS_DRAGDROP_EXIT_SYNTH (NS_DRAGDROP_EVENT_START + 2) -#define NS_DRAGDROP_LEAVE_SYNTH (NS_DRAGDROP_EVENT_START + 9) +#define NS_DRAGDROP_LEAVE (NS_DRAGDROP_EVENT_START + 9) // Events for popups #define NS_XUL_EVENT_START 1500 diff --git a/widget/InputData.cpp b/widget/InputData.cpp index 002ac15ef163..da18229d20d3 100644 --- a/widget/InputData.cpp +++ b/widget/InputData.cpp @@ -195,7 +195,7 @@ MultiTouchInput::MultiTouchInput(const WidgetMouseEvent& aMouseEvent) // 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 // area capable of handling user interactions. - case NS_MOUSE_EXIT: + case NS_MOUSE_EXIT_WIDGET: mType = MULTITOUCH_CANCEL; break; default: diff --git a/widget/MouseEvents.h b/widget/MouseEvents.h index ad1f5b3e2a42..23f1eb8e170b 100644 --- a/widget/MouseEvents.h +++ b/widget/MouseEvents.h @@ -322,8 +322,8 @@ public: , mDefaultPreventedOnContent(false) { mFlags.mCancelable = - (aMessage != NS_DRAGDROP_EXIT_SYNTH && - aMessage != NS_DRAGDROP_LEAVE_SYNTH && + (aMessage != NS_DRAGDROP_EXIT && + aMessage != NS_DRAGDROP_LEAVE && aMessage != NS_DRAGDROP_END); } diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp index 014c9387c702..300f5525a5e8 100644 --- a/widget/WidgetEventImpl.cpp +++ b/widget/WidgetEventImpl.cpp @@ -82,11 +82,11 @@ WidgetEvent::HasMouseEventMessage() const case NS_MOUSE_BUTTON_UP: case NS_MOUSE_CLICK: case NS_MOUSE_DOUBLECLICK: - case NS_MOUSE_ENTER: - case NS_MOUSE_EXIT: + case NS_MOUSE_ENTER_WIDGET: + case NS_MOUSE_EXIT_WIDGET: case NS_MOUSE_ACTIVATE: - case NS_MOUSE_ENTER_SYNTH: - case NS_MOUSE_EXIT_SYNTH: + case NS_MOUSE_OVER: + case NS_MOUSE_OUT: case NS_MOUSE_MOZHITTEST: case NS_MOUSE_MOVE: return true; @@ -108,7 +108,7 @@ WidgetEvent::HasDragEventMessage() const case NS_DRAGDROP_END: case NS_DRAGDROP_START: case NS_DRAGDROP_DROP: - case NS_DRAGDROP_LEAVE_SYNTH: + case NS_DRAGDROP_LEAVE: return true; default: return false; diff --git a/widget/android/AndroidJavaWrappers.cpp b/widget/android/AndroidJavaWrappers.cpp index 5662fac8d06e..d80ff1d4071f 100644 --- a/widget/android/AndroidJavaWrappers.cpp +++ b/widget/android/AndroidJavaWrappers.cpp @@ -834,10 +834,10 @@ AndroidGeckoEvent::MakeMouseEvent(nsIWidget* widget) msg = NS_MOUSE_MOVE; break; case AndroidMotionEvent::ACTION_HOVER_ENTER: - msg = NS_MOUSE_ENTER; + msg = NS_MOUSE_ENTER_WIDGET; break; case AndroidMotionEvent::ACTION_HOVER_EXIT: - msg = NS_MOUSE_EXIT; + msg = NS_MOUSE_EXIT_WIDGET; break; default: break; diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 244bf77f030b..82e17e23b377 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -382,8 +382,8 @@ nsWindow::Show(bool aState) // XXX should we bring this to the front when it's shown, // if it's a toplevel widget? - // XXX we should synthesize a NS_MOUSE_EXIT (for old top - // window)/NS_MOUSE_ENTER (for new top window) since we need + // XXX we should synthesize a NS_MOUSE_EXIT_WIDGET (for old top + // window)/NS_MOUSE_ENTER_WIDGET (for new top window) since we need // to pretend that the top window always has focus. Not sure // if Show() is the right place to do this, though. diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index e24ab72eee14..98da068af409 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -4549,7 +4549,7 @@ NSEvent* gLastDragMouseDownEvent = nil; NSPoint windowEventLocation = nsCocoaUtils::EventLocationForWindow(aEvent, [self window]); 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); event.refPoint = LayoutDeviceIntPoint::FromUntyped( mGeckoChild->CocoaPointsToDevPixels(localEventLocation)); diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 18a0fd6dd1c2..d40f76bc05d9 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -2542,7 +2542,7 @@ nsWindow::OnEnterNotifyEvent(GdkEventCrossing *aEvent) if (is_parent_ungrab_enter(aEvent)) 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.y = nscoord(aEvent->y); @@ -2583,7 +2583,7 @@ nsWindow::OnLeaveNotifyEvent(GdkEventCrossing *aEvent) if (aEvent->subwindow != nullptr) 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.y = nscoord(aEvent->y); diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index a4dc0e2c198f..c7b077355ade 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -1938,8 +1938,8 @@ case _value: eventName.AssignLiteral(_name) ; break _ASSIGN_eventName(NS_KEY_DOWN,"NS_KEY_DOWN"); _ASSIGN_eventName(NS_KEY_PRESS,"NS_KEY_PRESS"); _ASSIGN_eventName(NS_KEY_UP,"NS_KEY_UP"); - _ASSIGN_eventName(NS_MOUSE_ENTER,"NS_MOUSE_ENTER"); - _ASSIGN_eventName(NS_MOUSE_EXIT,"NS_MOUSE_EXIT"); + _ASSIGN_eventName(NS_MOUSE_ENTER_WIDGET,"NS_MOUSE_ENTER_WIDGET"); + _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_UP,"NS_MOUSE_BUTTON_UP"); _ASSIGN_eventName(NS_MOUSE_CLICK,"NS_MOUSE_CLICK"); @@ -2099,8 +2099,8 @@ nsBaseWidget::debug_DumpEvent(FILE * aFileOut, return; } - if (aGuiEvent->message == NS_MOUSE_ENTER || - aGuiEvent->message == NS_MOUSE_EXIT) + if (aGuiEvent->message == NS_MOUSE_ENTER_WIDGET || + aGuiEvent->message == NS_MOUSE_EXIT_WIDGET) { if (!debug_GetCachedBoolPref("nglayout.debug.crossing_event_dumping")) return; diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index f90342e28d45..2a22ce165ae3 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -3780,8 +3780,8 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam, && nsWindowType::eWindowType_toplevel == mWindowType // Currently this scheme is used only when pointer events is enabled. && gfxPrefs::PointerEventsEnabled() - // NS_MOUSE_EXIT is received, when InkCollector has been already initialized. - && NS_MOUSE_EXIT != aEventType) { + // NS_MOUSE_EXIT_WIDGET is received, when InkCollector has been already initialized. + && NS_MOUSE_EXIT_WIDGET != aEventType) { InkCollector::sInkCollector->SetTarget(mWnd); } @@ -3790,11 +3790,11 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam, CaptureMouse(true); 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). case NS_MOUSE_BUTTON_UP: case NS_MOUSE_MOVE: - case NS_MOUSE_EXIT: + case NS_MOUSE_EXIT_WIDGET: if (!(wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) && sIsInMouseCapture) CaptureMouse(false); break; @@ -3887,7 +3887,7 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam, else if (aEventType == NS_MOUSE_MOVE && !insideMovementThreshold) { sLastClickCount = 0; } - else if (aEventType == NS_MOUSE_EXIT) { + else if (aEventType == NS_MOUSE_EXIT_WIDGET) { event.exit = IsTopLevelMouseExit(mWnd) ? WidgetMouseEvent::eTopLevel : WidgetMouseEvent::eChild; } @@ -3950,7 +3950,7 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam, case NS_MOUSE_MOVE: pluginEvent.event = WM_MOUSEMOVE; break; - case NS_MOUSE_EXIT: + case NS_MOUSE_EXIT_WIDGET: pluginEvent.event = WM_MOUSELEAVE; break; default: @@ -3980,20 +3980,20 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam, if (sCurrentWindow == nullptr || sCurrentWindow != this) { if ((nullptr != sCurrentWindow) && (!sCurrentWindow->mInDtor)) { 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, aInputSource); } sCurrentWindow = this; if (!mInDtor) { 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, aInputSource); } } } - } else if (aEventType == NS_MOUSE_EXIT) { + } else if (aEventType == NS_MOUSE_EXIT_WIDGET) { if (sCurrentWindow == this) { sCurrentWindow = nullptr; } @@ -4864,7 +4864,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam, case WM_NCMOUSEMOVE: // 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) SendMessage(mWnd, WM_MOUSELEAVE, 0, 0); break; @@ -4901,7 +4901,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam, // Synthesize an event position because we don't get one from // WM_MOUSELEAVE. LPARAM pos = lParamToClient(::GetMessagePos()); - DispatchMouseEvent(NS_MOUSE_EXIT, mouseState, pos, false, + DispatchMouseEvent(NS_MOUSE_EXIT_WIDGET, mouseState, pos, false, WidgetMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); } break; @@ -4909,7 +4909,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam, case MOZ_WM_PEN_LEAVES_HOVER_OF_DIGITIZER: { LPARAM pos = lParamToClient(::GetMessagePos()); - DispatchMouseEvent(NS_MOUSE_EXIT, wParam, pos, false, + DispatchMouseEvent(NS_MOUSE_EXIT_WIDGET, wParam, pos, false, WidgetMouseEvent::eLeftButton, nsIDOMMouseEvent::MOZ_SOURCE_PEN); }