diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 2dd83bdff126..a802d536a9b5 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -5492,7 +5492,7 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent) } bool isCrossDomainSubFrameDrop = false; - if (aDragEvent->mMessage == NS_DRAGDROP_DROP || + if (aDragEvent->mMessage == eDrop || aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP) { isCrossDomainSubFrameDrop = CheckForSubFrameDrop(dragSession, aDragEvent); } @@ -5514,7 +5514,7 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent) aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed); aDragEvent->dataTransfer->SetDropEffectInt(FilterDropEffect(action, effectAllowed)); } - else if (aDragEvent->mMessage == NS_DRAGDROP_DROP || + else if (aDragEvent->mMessage == eDrop || aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP || aDragEvent->mMessage == NS_DRAGDROP_END) { // For the drop and dragend events, set the drop effect based on the diff --git a/dom/events/DataTransfer.cpp b/dom/events/DataTransfer.cpp index 14076b3a8ec9..bb15bec02439 100644 --- a/dom/events/DataTransfer.cpp +++ b/dom/events/DataTransfer.cpp @@ -269,7 +269,7 @@ DataTransfer::GetMozUserCancelled(bool* aUserCancelled) FileList* DataTransfer::GetFiles(ErrorResult& aRv) { - if (mEventMessage != NS_DRAGDROP_DROP && + if (mEventMessage != eDrop && mEventMessage != NS_DRAGDROP_DRAGDROP && mEventMessage != NS_PASTE) { return nullptr; @@ -603,7 +603,7 @@ DataTransfer::MozGetDataAt(const nsAString& aFormat, uint32_t aIndex, // only allow access to the data with the same principal. nsIPrincipal* principal = nullptr; if (mIsCrossDomainSubFrameDrop || - (mEventMessage != NS_DRAGDROP_DROP && + (mEventMessage != eDrop && mEventMessage != NS_DRAGDROP_DRAGDROP && mEventMessage != NS_PASTE && !nsContentUtils::IsCallerChrome())) { diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 460a03ea12bd..26810f772aa4 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -203,7 +203,7 @@ EVENT(dragstart, EventNameType_HTMLXUL, eDragEventClass) EVENT(drop, - NS_DRAGDROP_DROP, + eDrop, EventNameType_HTMLXUL, eDragEventClass) EVENT(durationchange, diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index a9b3ebb27545..930cc3addb3d 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -654,8 +654,8 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, } break; case NS_DRAGDROP_OVER: - // NS_DRAGDROP_DROP is fired before NS_DRAGDROP_DRAGDROP so send - // the enter/exit events before NS_DRAGDROP_DROP. + // eDrop is fired before NS_DRAGDROP_DRAGDROP so send + // the enter/exit events before eDrop. GenerateDragDropEnterExit(aPresContext, aEvent->AsDragEvent()); break; @@ -1195,7 +1195,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent) switch (aEvent.mMessage) { case NS_DRAGDROP_OVER: case NS_DRAGDROP_EXIT: - case NS_DRAGDROP_DROP: + case eDrop: return true; default: break; @@ -3286,7 +3286,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, } break; - case NS_DRAGDROP_DROP: + case eDrop: { // now fire the dragdrop event, for compatibility with XUL if (mCurrentTarget && nsEventStatus_eConsumeNoDefault != *aStatus) { diff --git a/dom/events/WheelHandlingHelper.cpp b/dom/events/WheelHandlingHelper.cpp index 09010b6bbb28..092e90453f59 100644 --- a/dom/events/WheelHandlingHelper.cpp +++ b/dom/events/WheelHandlingHelper.cpp @@ -215,7 +215,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent) case eMouseDoubleClick: case eMouseClick: case eContextMenu: - case NS_DRAGDROP_DROP: + case eDrop: EndTransaction(); return; default: diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 557f18c221a2..c0c28953450c 100755 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -5112,9 +5112,9 @@ ContentParent::MaybeInvokeDragSession(TabParent* aParent) session->GetDataTransfer(getter_AddRefs(domTransfer)); nsCOMPtr transfer = do_QueryInterface(domTransfer); if (!transfer) { - // Pass NS_DRAGDROP_DROP to get DataTransfer with external + // Pass eDrop to get DataTransfer with external // drag formats cached. - transfer = new DataTransfer(nullptr, NS_DRAGDROP_DROP, true, -1); + transfer = new DataTransfer(nullptr, eDrop, true, -1); session->SetDataTransfer(transfer); } // Note, even though this fills the DataTransfer object with diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 01c995017e3f..6aa964461cba 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -2183,7 +2183,7 @@ TabChild::RecvRealDragEvent(const WidgetDragEvent& aEvent, } } - if (aEvent.mMessage == NS_DRAGDROP_DROP) { + if (aEvent.mMessage == eDrop) { bool canDrop = true; if (!dragSession || NS_FAILED(dragSession->GetCanDrop(&canDrop)) || !canDrop) { diff --git a/editor/libeditor/nsEditorEventListener.cpp b/editor/libeditor/nsEditorEventListener.cpp index 598e5d999164..2a2794a178a8 100644 --- a/editor/libeditor/nsEditorEventListener.cpp +++ b/editor/libeditor/nsEditorEventListener.cpp @@ -386,7 +386,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent) return DragExit(dragEvent); } // drop - case NS_DRAGDROP_DROP: { + case eDrop: { nsCOMPtr dragEvent = do_QueryInterface(aEvent); return Drop(dragEvent); } diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 7c54322fc1be..8cdc5c1357ee 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -894,7 +894,7 @@ APZCTreeManager::UpdateWheelTransaction(WidgetInputEvent& aEvent) case eMouseDoubleClick: case eMouseClick: case eContextMenu: - case NS_DRAGDROP_DROP: + case eDrop: txn->EndTransaction(); return; default: diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 529dc0e041e7..0bdd4651092f 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -7864,7 +7864,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus) isHandlingUserInput = true; break; - case NS_DRAGDROP_DROP: { + case eDrop: { nsCOMPtr session = nsContentUtils::GetDragSession(); if (session) { bool onlyChromeDrop = false; diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index 10780395b684..ee1c8cd84647 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -2707,7 +2707,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext, // Indicate that the drop is allowed by preventing the default behaviour. if (mSlots->mDropAllowed) *aEventStatus = nsEventStatus_eConsumeNoDefault; - } else if (aEvent->mMessage == NS_DRAGDROP_DROP) { + } else if (aEvent->mMessage == eDrop) { // this event was meant for another frame, so ignore it if (!mSlots) return NS_OK; diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h index ae154b92a5fc..75afb9124e5e 100644 --- a/widget/EventMessageList.h +++ b/widget/EventMessageList.h @@ -110,7 +110,7 @@ NS_EVENT_MESSAGE(NS_DRAGDROP_GESTURE, eDragDropEventFirst + 4) NS_EVENT_MESSAGE(NS_DRAGDROP_DRAG, eDragDropEventFirst + 5) NS_EVENT_MESSAGE(NS_DRAGDROP_END, eDragDropEventFirst + 6) NS_EVENT_MESSAGE(NS_DRAGDROP_START, eDragDropEventFirst + 7) -NS_EVENT_MESSAGE(NS_DRAGDROP_DROP, eDragDropEventFirst + 8) +NS_EVENT_MESSAGE(eDrop, eDragDropEventFirst + 8) NS_EVENT_MESSAGE(eDragLeave, eDragDropEventFirst + 9) NS_EVENT_MESSAGE(eDragDropEventLast, eDragLeave) diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp index 56aba754c8b2..947f34218ea0 100644 --- a/widget/WidgetEventImpl.cpp +++ b/widget/WidgetEventImpl.cpp @@ -107,7 +107,7 @@ WidgetEvent::HasDragEventMessage() const case NS_DRAGDROP_DRAG: case NS_DRAGDROP_END: case NS_DRAGDROP_START: - case NS_DRAGDROP_DROP: + case eDrop: case eDragLeave: return true; default: diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 600bac13e454..3fcf3714cdbb 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -5746,8 +5746,7 @@ PanGestureTypeForEvent(NSEvent* aEvent) // cancelled or not as there isn't actually a means to stop the drag mDragService->FireDragEventAtSource(NS_DRAGDROP_DRAG); dragSession->SetCanDrop(false); - } - else if (aMessage == NS_DRAGDROP_DROP) { + } else if (aMessage == eDrop) { // We make the assumption that the dragOver handlers have correctly set // the |canDrop| property of the Drag Session. bool canDrop = false; @@ -5812,7 +5811,7 @@ PanGestureTypeForEvent(NSEvent* aEvent) return [self dragOperationFromDragAction:dragAction]; } case NS_DRAGDROP_EXIT: - case NS_DRAGDROP_DROP: { + case eDrop: { nsCOMPtr sourceNode; dragSession->GetSourceNode(getter_AddRefs(sourceNode)); if (!sourceNode) { @@ -5873,7 +5872,7 @@ PanGestureTypeForEvent(NSEvent* aEvent) - (BOOL)performDragOperation:(id )sender { nsAutoRetainCocoaObject kungFuDeathGrip(self); - BOOL handled = [self doDragAction:NS_DRAGDROP_DROP sender:sender] != NSDragOperationNone; + BOOL handled = [self doDragAction:eDrop sender:sender] != NSDragOperationNone; NS_IF_RELEASE(mDragService); return handled; } diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp index 9d1a10a612ae..6cbafec16b92 100644 --- a/widget/gtk/nsDragService.cpp +++ b/widget/gtk/nsDragService.cpp @@ -2052,7 +2052,7 @@ nsDragService::DispatchDropEvent() if (mTargetWindow->IsDestroyed()) return FALSE; - EventMessage msg = mCanDrop ? NS_DRAGDROP_DROP : NS_DRAGDROP_EXIT; + EventMessage msg = mCanDrop ? eDrop : NS_DRAGDROP_EXIT; mTargetWindow->DispatchDragEvent(msg, mTargetWindowPoint, mTargetTime); diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index 1263002ee7b2..bba37a78fb02 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -2633,7 +2633,7 @@ case _value: eventName.AssignLiteral(_name) ; break { _ASSIGN_eventName(eBlur,"eBlur"); _ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE"); - _ASSIGN_eventName(NS_DRAGDROP_DROP,"NS_DND_DROP"); + _ASSIGN_eventName(eDrop,"eDrop"); _ASSIGN_eventName(NS_DRAGDROP_ENTER,"NS_DND_ENTER"); _ASSIGN_eventName(NS_DRAGDROP_EXIT,"NS_DND_EXIT"); _ASSIGN_eventName(NS_DRAGDROP_OVER,"NS_DND_OVER"); diff --git a/widget/windows/nsNativeDragTarget.cpp b/widget/windows/nsNativeDragTarget.cpp index ffab0c402b5b..3592e56815fa 100644 --- a/widget/windows/nsNativeDragTarget.cpp +++ b/widget/windows/nsNativeDragTarget.cpp @@ -229,7 +229,7 @@ nsNativeDragTarget::ProcessDrag(EventMessage aEventMessage, *pdwEffect = DROPEFFECT_NONE; } - if (aEventMessage != NS_DRAGDROP_DROP) { + if (aEventMessage != eDrop) { // Get the cached drag effect from the drag service, the data member should // have been set by whoever handled the WidgetGUIEvent or nsIDOMEvent on // drags. @@ -439,7 +439,7 @@ nsNativeDragTarget::Drop(LPDATAOBJECT pData, nsCOMPtr serv = mDragService; // Now process the native drag state and then dispatch the event - ProcessDrag(NS_DRAGDROP_DROP, grfKeyState, aPT, pdwEffect); + ProcessDrag(eDrop, grfKeyState, aPT, pdwEffect); nsCOMPtr currentDragSession; serv->GetCurrentSession(getter_AddRefs(currentDragSession));