Bug 895274 part.82 Rename NS_DRAGDROP_ENTER to eDragEnter r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 02 Sep 2015 15:08:02 +0900
changeset 260503 cad395df60d302e74ba82c7f46626180eb885d13
parent 260502 4f79fccb269836a8053a036c8a0734d618d92b41
child 260504 aaffbbb943e446e995c9f08c363bae24e0712a28
push id29311
push usercbook@mozilla.com
push dateWed, 02 Sep 2015 11:53:18 +0000
treeherdermozilla-central@1b687fcb5213 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs895274
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 895274 part.82 Rename NS_DRAGDROP_ENTER to eDragEnter r=smaug
dom/base/nsContentUtils.cpp
dom/events/EventNameList.h
dom/events/EventStateManager.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
editor/libeditor/nsEditorEventListener.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
widget/EventMessageList.h
widget/WidgetEventImpl.cpp
widget/cocoa/nsChildView.mm
widget/nsBaseWidget.cpp
widget/windows/nsNativeDragTarget.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -5502,18 +5502,17 @@ nsContentUtils::SetDataTransferInEvent(W
                              aDragEvent->userCancelled,
                              isCrossDomainSubFrameDrop,
                              getter_AddRefs(aDragEvent->dataTransfer));
   NS_ENSURE_TRUE(aDragEvent->dataTransfer, NS_ERROR_OUT_OF_MEMORY);
 
   // for the dragenter and dragover events, initialize the drop effect
   // from the drop action, which platform specific widget code sets before
   // the event is fired based on the keyboard state.
-  if (aDragEvent->mMessage == NS_DRAGDROP_ENTER ||
-      aDragEvent->mMessage == eDragOver) {
+  if (aDragEvent->mMessage == eDragEnter || aDragEvent->mMessage == eDragOver) {
     uint32_t action, effectAllowed;
     dragSession->GetDragAction(&action);
     aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed);
     aDragEvent->dataTransfer->SetDropEffectInt(FilterDropEffect(action, effectAllowed));
   }
   else if (aDragEvent->mMessage == eDrop ||
            aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP ||
            aDragEvent->mMessage == eDragEnd) {
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -182,17 +182,17 @@ EVENT(drag,
       eDrag,
       EventNameType_HTMLXUL,
       eDragEventClass)
 EVENT(dragend,
       eDragEnd,
       EventNameType_HTMLXUL,
       eDragEventClass)
 EVENT(dragenter,
-      NS_DRAGDROP_ENTER,
+      eDragEnter,
       EventNameType_HTMLXUL,
       eDragEventClass)
 EVENT(dragleave,
       eDragLeave,
       EventNameType_HTMLXUL,
       eDragEventClass)
 EVENT(dragover,
       eDragOver,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -3166,17 +3166,17 @@ EventStateManager::PostHandleEvent(nsPre
   case NS_GESTURENOTIFY_EVENT_START:
     {
       if (nsEventStatus_eConsumeNoDefault != *aStatus) {
         DecideGestureEvent(aEvent->AsGestureNotifyEvent(), mCurrentTarget);
       }
     }
     break;
 
-  case NS_DRAGDROP_ENTER:
+  case eDragEnter:
   case eDragOver:
     {
       NS_ASSERTION(aEvent->mClass == eDragEventClass, "Expected a drag event");
 
       nsCOMPtr<nsIDragSession> dragSession = nsContentUtils::GetDragSession();
       if (!dragSession)
         break;
 
@@ -4315,17 +4315,17 @@ EventStateManager::GenerateDragDropEnter
           sLastDragOverFrame->GetContentForEvent(aDragEvent,
                                                  getter_AddRefs(lastContent));
 
           FireDragEnterOrExit(sLastDragOverFrame->PresContext(),
                               aDragEvent, NS_DRAGDROP_EXIT,
                               targetContent, lastContent, sLastDragOverFrame);
         }
 
-        FireDragEnterOrExit(aPresContext, aDragEvent, NS_DRAGDROP_ENTER,
+        FireDragEnterOrExit(aPresContext, aDragEvent, eDragEnter,
                             lastContent, targetContent, mCurrentTarget);
 
         if (sLastDragOverFrame) {
           FireDragEnterOrExit(sLastDragOverFrame->PresContext(),
                               aDragEvent, eDragLeave,
                               targetContent, lastContent, sLastDragOverFrame);
         }
 
@@ -4390,25 +4390,24 @@ EventStateManager::FireDragEnterOrExit(n
     if (aTargetContent) {
       EventDispatcher::Dispatch(aTargetContent, aPresContext, &event,
                                 nullptr, &status);
     }
 
     // adjust the drag hover if the dragenter event was cancelled or this is a drag exit
     if (status == nsEventStatus_eConsumeNoDefault ||
         aMessage == NS_DRAGDROP_EXIT) {
-      SetContentState((aMessage == NS_DRAGDROP_ENTER) ?
-                        aTargetContent : nullptr,
+      SetContentState((aMessage == eDragEnter) ? aTargetContent : nullptr,
                       NS_EVENT_STATE_DRAGOVER);
     }
 
     // collect any changes to moz cursor settings stored in the event's
     // data transfer.
     if (aMessage == eDragLeave || aMessage == NS_DRAGDROP_EXIT ||
-        aMessage == NS_DRAGDROP_ENTER) {
+        aMessage == eDragEnter) {
       UpdateDragDataTransfer(&event);
     }
   }
 
   // Finally dispatch the event to the frame
   if (aTargetFrame)
     aTargetFrame->HandleEvent(aPresContext, &event, &status);
 }
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -1744,18 +1744,17 @@ nsPluginInstanceOwner::HandleEvent(nsIDO
   if (eventType.EqualsLiteral("keypress")) {
     return ProcessKeyPress(aEvent);
   }
 
   nsCOMPtr<nsIDOMDragEvent> dragEvent(do_QueryInterface(aEvent));
   if (dragEvent && mInstance) {
     WidgetEvent* ievent = aEvent->GetInternalNSEvent();
     if (ievent && ievent->mFlags.mIsTrusted &&
-        ievent->mMessage != NS_DRAGDROP_ENTER &&
-        ievent->mMessage != eDragOver) {
+        ievent->mMessage != eDragEnter && ievent->mMessage != eDragOver) {
       aEvent->PreventDefault();
     }
 
     // Let the plugin handle drag events.
     aEvent->StopPropagation();
   }
   return NS_OK;
 }
--- a/editor/libeditor/nsEditorEventListener.cpp
+++ b/editor/libeditor/nsEditorEventListener.cpp
@@ -366,17 +366,17 @@ nsEditorEventListener::HandleEvent(nsIDO
   // However, we need to handle strange "focus" and "blur" event.  See the
   // following code of this switch statement.
   // NOTE: Each event handler may require specific event interface.  Before
   //       calling it, this queries the specific interface.  If it would fail,
   //       each event handler would just ignore the event.  So, in this method,
   //       you don't need to check if the QI succeeded before each call.
   switch (internalEvent->mMessage) {
     // dragenter
-    case NS_DRAGDROP_ENTER: {
+    case eDragEnter: {
       nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
       return DragEnter(dragEvent);
     }
     // dragover
     case eDragOver: {
       nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
       return DragOver(dragEvent);
     }
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -2576,17 +2576,17 @@ nsTreeBodyFrame::HandleEvent(nsPresConte
       if (mMouseOverRow != -1)
         InvalidateRow(mMouseOverRow);
     }
   } else if (aEvent->mMessage == eMouseOut) {
     if (mMouseOverRow != -1) {
       InvalidateRow(mMouseOverRow);
       mMouseOverRow = -1;
     }
-  } else if (aEvent->mMessage == NS_DRAGDROP_ENTER) {
+  } else if (aEvent->mMessage == eDragEnter) {
     if (!mSlots)
       mSlots = new Slots();
 
     // Cache several things we'll need throughout the course of our work. These
     // will all get released on a drag exit.
 
     if (mSlots->mTimer) {
       mSlots->mTimer->Cancel();
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -97,17 +97,17 @@ NS_EVENT_MESSAGE(eFormSelect,           
 NS_EVENT_MESSAGE(eFormInvalid,          eFormEventFirst + 4)
 
 //Need separate focus/blur notifications for non-native widgets
 NS_EVENT_MESSAGE(eFocusEventFirst,      1300)
 NS_EVENT_MESSAGE(eFocus,                eFocusEventFirst)
 NS_EVENT_MESSAGE(eBlur,                 eFocusEventFirst + 1)
 
 NS_EVENT_MESSAGE(eDragDropEventFirst,   1400)
-NS_EVENT_MESSAGE(NS_DRAGDROP_ENTER,     eDragDropEventFirst)
+NS_EVENT_MESSAGE(eDragEnter,            eDragDropEventFirst)
 NS_EVENT_MESSAGE(eDragOver,             eDragDropEventFirst + 1)
 NS_EVENT_MESSAGE(NS_DRAGDROP_EXIT,      eDragDropEventFirst + 2)
 NS_EVENT_MESSAGE(NS_DRAGDROP_DRAGDROP,  eDragDropEventFirst + 3)
 NS_EVENT_MESSAGE(NS_DRAGDROP_GESTURE,   eDragDropEventFirst + 4)
 NS_EVENT_MESSAGE(eDrag,                 eDragDropEventFirst + 5)
 NS_EVENT_MESSAGE(eDragEnd,              eDragDropEventFirst + 6)
 NS_EVENT_MESSAGE(eDragStart,            eDragDropEventFirst + 7)
 NS_EVENT_MESSAGE(eDrop,                 eDragDropEventFirst + 8)
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -94,17 +94,17 @@ WidgetEvent::HasMouseEventMessage() cons
       return false;
   }
 }
 
 bool
 WidgetEvent::HasDragEventMessage() const
 {
   switch (mMessage) {
-    case NS_DRAGDROP_ENTER:
+    case eDragEnter:
     case eDragOver:
     case NS_DRAGDROP_EXIT:
     case NS_DRAGDROP_DRAGDROP:
     case NS_DRAGDROP_GESTURE:
     case eDrag:
     case eDragEnd:
     case eDragStart:
     case eDrop:
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -5730,18 +5730,19 @@ PanGestureTypeForEvent(NSEvent* aEvent)
 
   if (!mDragService) {
     CallGetService(kDragServiceContractID, &mDragService);
     NS_ASSERTION(mDragService, "Couldn't get a drag service - big problem!");
     if (!mDragService)
       return NSDragOperationNone;
   }
 
-  if (aMessage == NS_DRAGDROP_ENTER)
+  if (aMessage == eDragEnter) {
     mDragService->StartDragSession();
+  }
 
   nsCOMPtr<nsIDragSession> dragSession;
   mDragService->GetCurrentSession(getter_AddRefs(dragSession));
   if (dragSession) {
     if (aMessage == eDragOver) {
       // fire the drag event at the source. Just ignore whether it was
       // cancelled or not as there isn't actually a means to stop the drag
       mDragService->FireDragEventAtSource(eDrag);
@@ -5787,17 +5788,17 @@ PanGestureTypeForEvent(NSEvent* aEvent)
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
   mGeckoChild->DispatchInputEvent(&geckoEvent);
   if (!mGeckoChild)
     return NSDragOperationNone;
 
   if (dragSession) {
     switch (aMessage) {
-      case NS_DRAGDROP_ENTER:
+      case eDragEnter:
       case eDragOver: {
         uint32_t dragAction;
         dragSession->GetDragAction(&dragAction);
 
         // If TakeChildProcessDragAction returns something other than
         // DRAGDROP_ACTION_UNINITIALIZED, it means that the last event was sent
         // to the child process and this event is also being sent to the child
         // process. In this case, use the last event's action instead.
@@ -5842,17 +5843,17 @@ PanGestureTypeForEvent(NSEvent* aEvent)
   [globalDragPboard release];
 
   // Set the global drag pasteboard that will be used for this drag session.
   // This will be set back to nil when the drag session ends (mouse exits
   // the view or a drop happens within the view).
   globalDragPboard =
     [[NSPasteboardWrapper alloc] initWithPasteboard:[sender draggingPasteboard]];
 
-  return [self doDragAction:NS_DRAGDROP_ENTER sender:sender];
+  return [self doDragAction:eDragEnter sender:sender];
 
   NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSDragOperationNone);
 }
 
 - (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender
 {
   MOZ_LOG(sCocoaLog, LogLevel::Info, ("ChildView draggingUpdated: entered\n"));
 
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -2629,17 +2629,17 @@ nsBaseWidget::debug_GuiEventToString(Wid
 #define _ASSIGN_eventName(_value,_name)\
 case _value: eventName.AssignLiteral(_name) ; break
 
   switch(aGuiEvent->mMessage)
   {
     _ASSIGN_eventName(eBlur,"eBlur");
     _ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE");
     _ASSIGN_eventName(eDrop,"eDrop");
-    _ASSIGN_eventName(NS_DRAGDROP_ENTER,"NS_DND_ENTER");
+    _ASSIGN_eventName(eDragEnter,"eDragEnter");
     _ASSIGN_eventName(NS_DRAGDROP_EXIT,"NS_DND_EXIT");
     _ASSIGN_eventName(eDragOver,"eDragOver");
     _ASSIGN_eventName(NS_EDITOR_INPUT,"NS_EDITOR_INPUT");
     _ASSIGN_eventName(eFocus,"eFocus");
     _ASSIGN_eventName(eFormSelect,"eFormSelect");
     _ASSIGN_eventName(eFormChange,"eFormChange");
     _ASSIGN_eventName(eFormReset,"eFormReset");
     _ASSIGN_eventName(eFormSubmit,"eFormSubmit");
--- a/widget/windows/nsNativeDragTarget.cpp
+++ b/widget/windows/nsNativeDragTarget.cpp
@@ -290,17 +290,17 @@ nsNativeDragTarget::DragEnter(LPDATAOBJE
   // This cast is ok because in the constructor we created a
   // the actual implementation we wanted, so we know this is
   // a nsDragService. It should be a private interface, though.
   nsDragService * winDragService =
     static_cast<nsDragService *>(mDragService);
   winDragService->SetIDataObject(pIDataSource);
 
   // Now process the native drag state and then dispatch the event
-  ProcessDrag(NS_DRAGDROP_ENTER, grfKeyState, ptl, pdwEffect);
+  ProcessDrag(eDragEnter, grfKeyState, ptl, pdwEffect);
 
   return S_OK;
 }
 
 void 
 nsNativeDragTarget::AddLinkSupportIfCanBeGenerated(LPDATAOBJECT aIDataSource) 
 {
   // If we don't have a link effect, but we can generate one, fix the