Bug 1046101 part.12 Rename NS_DRAG_EVENT to eDragEventClass r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 04 Aug 2014 14:28:50 +0900
changeset 197652 df76962b36837df8be48ddd05e56d7ac2ec4c46c
parent 197651 cddf9f550571fe3eececf0b4115683437e464edf
child 197653 955ed4eff9c94f4401a98dbefc307697451ab286
push id27249
push userryanvm@gmail.com
push dateMon, 04 Aug 2014 20:14:35 +0000
treeherdermozilla-central@7f81be7db528 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1046101
milestone34.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 1046101 part.12 Rename NS_DRAG_EVENT to eDragEventClass r=smaug
dom/events/DragEvent.cpp
dom/events/Event.cpp
dom/events/EventDispatcher.cpp
dom/events/EventNameList.h
dom/events/EventStateManager.cpp
dom/events/MouseEvent.cpp
dom/events/UIEvent.cpp
dom/events/UIEvent.h
dom/xbl/nsXBLEventHandler.cpp
layout/base/nsLayoutUtils.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
widget/BasicEvents.h
widget/MouseEvents.h
widget/gtk/nsGtkKeyUtils.cpp
widget/windows/KeyboardLayout.cpp
--- a/dom/events/DragEvent.cpp
+++ b/dom/events/DragEvent.cpp
@@ -111,17 +111,17 @@ DragEvent::GetDataTransfer(nsIDOMDataTra
 
 DataTransfer*
 DragEvent::GetDataTransfer()
 {
   // the dataTransfer field of the event caches the DataTransfer associated
   // with the drag. It is initialized when an attempt is made to retrieve it
   // rather that when the event is created to avoid duplicating the data when
   // no listener ever uses it.
-  if (!mEvent || mEvent->mClass != NS_DRAG_EVENT) {
+  if (!mEvent || mEvent->mClass != eDragEventClass) {
     NS_WARNING("Tried to get dataTransfer from non-drag event!");
     return nullptr;
   }
 
   WidgetDragEvent* dragEvent = mEvent->AsDragEvent();
   // for synthetic events, just use the supplied data transfer object even if null
   if (!mEventIsInternal) {
     nsresult rv = nsContentUtils::SetDataTransferInEvent(dragEvent);
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -160,17 +160,17 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Ev
     switch (tmp->mEvent->mClass) {
       case eMouseEventClass:
       case NS_MOUSE_SCROLL_EVENT:
       case NS_WHEEL_EVENT:
       case NS_SIMPLE_GESTURE_EVENT:
       case NS_POINTER_EVENT:
         tmp->mEvent->AsMouseEventBase()->relatedTarget = nullptr;
         break;
-      case NS_DRAG_EVENT: {
+      case eDragEventClass: {
         WidgetDragEvent* dragEvent = tmp->mEvent->AsDragEvent();
         dragEvent->dataTransfer = nullptr;
         dragEvent->relatedTarget = nullptr;
         break;
       }
       case NS_CLIPBOARD_EVENT:
         tmp->mEvent->AsClipboardEvent()->clipboardData = nullptr;
         break;
@@ -199,17 +199,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
       case eMouseEventClass:
       case NS_MOUSE_SCROLL_EVENT:
       case NS_WHEEL_EVENT:
       case NS_SIMPLE_GESTURE_EVENT:
       case NS_POINTER_EVENT:
         NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->relatedTarget");
         cb.NoteXPCOMChild(tmp->mEvent->AsMouseEventBase()->relatedTarget);
         break;
-      case NS_DRAG_EVENT: {
+      case eDragEventClass: {
         WidgetDragEvent* dragEvent = tmp->mEvent->AsDragEvent();
         NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->dataTransfer");
         cb.NoteXPCOMChild(dragEvent->dataTransfer);
         NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->relatedTarget");
         cb.NoteXPCOMChild(dragEvent->relatedTarget);
         break;
       }
       case NS_CLIPBOARD_EVENT:
@@ -847,17 +847,17 @@ Event::GetScreenCoords(nsPresContext* aP
   }
 
   if (!aEvent || 
        (aEvent->mClass != eMouseEventClass &&
         aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
         aEvent->mClass != NS_WHEEL_EVENT &&
         aEvent->mClass != NS_POINTER_EVENT &&
         aEvent->mClass != NS_TOUCH_EVENT &&
-        aEvent->mClass != NS_DRAG_EVENT &&
+        aEvent->mClass != eDragEventClass &&
         aEvent->mClass != NS_SIMPLE_GESTURE_EVENT)) {
     return nsIntPoint(0, 0);
   }
 
   WidgetGUIEvent* guiEvent = aEvent->AsGUIEvent();
   if (!guiEvent->widget) {
     return LayoutDeviceIntPoint::ToUntyped(aPoint);
   }
@@ -902,17 +902,17 @@ Event::GetClientCoords(nsPresContext* aP
     return EventStateManager::sLastClientPoint;
   }
 
   if (!aEvent ||
       (aEvent->mClass != eMouseEventClass &&
        aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
        aEvent->mClass != NS_WHEEL_EVENT &&
        aEvent->mClass != NS_TOUCH_EVENT &&
-       aEvent->mClass != NS_DRAG_EVENT &&
+       aEvent->mClass != eDragEventClass &&
        aEvent->mClass != NS_POINTER_EVENT &&
        aEvent->mClass != NS_SIMPLE_GESTURE_EVENT) ||
       !aPresContext ||
       !aEvent->AsGUIEvent()->widget) {
     return aDefaultPoint;
   }
 
   nsIPresShell* shell = aPresContext->GetPresShell();
--- a/dom/events/EventDispatcher.cpp
+++ b/dom/events/EventDispatcher.cpp
@@ -712,17 +712,17 @@ EventDispatcher::CreateEvent(EventTarget
       return NS_NewDOMMouseScrollEvent(aDOMEvent, aOwner, aPresContext,
                                        aEvent->AsMouseScrollEvent());
     case NS_WHEEL_EVENT:
       return NS_NewDOMWheelEvent(aDOMEvent, aOwner, aPresContext,
                                  aEvent->AsWheelEvent());
     case eEditorInputEventClass:
       return NS_NewDOMInputEvent(aDOMEvent, aOwner, aPresContext,
                                  aEvent->AsEditorInputEvent());
-    case NS_DRAG_EVENT:
+    case eDragEventClass:
       return NS_NewDOMDragEvent(aDOMEvent, aOwner, aPresContext,
                                 aEvent->AsDragEvent());
     case eTextEventClass:
       return NS_NewDOMUIEvent(aDOMEvent, aOwner, aPresContext,
                               aEvent->AsTextEvent());
     case NS_CLIPBOARD_EVENT:
       return NS_NewDOMClipboardEvent(aDOMEvent, aOwner, aPresContext,
                                      aEvent->AsClipboardEvent());
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -175,41 +175,41 @@ EVENT(contextmenu,
 // EVENT(cuechange)
 EVENT(dblclick,
       NS_MOUSE_DOUBLECLICK,
       EventNameType_HTMLXUL,
       eMouseEventClass)
 EVENT(drag,
       NS_DRAGDROP_DRAG,
       EventNameType_HTMLXUL,
-      NS_DRAG_EVENT)
+      eDragEventClass)
 EVENT(dragend,
       NS_DRAGDROP_END,
       EventNameType_HTMLXUL,
-      NS_DRAG_EVENT)
+      eDragEventClass)
 EVENT(dragenter,
       NS_DRAGDROP_ENTER,
       EventNameType_HTMLXUL,
-      NS_DRAG_EVENT)
+      eDragEventClass)
 EVENT(dragleave,
       NS_DRAGDROP_LEAVE_SYNTH,
       EventNameType_HTMLXUL,
-      NS_DRAG_EVENT)
+      eDragEventClass)
 EVENT(dragover,
       NS_DRAGDROP_OVER_SYNTH,
       EventNameType_HTMLXUL,
-      NS_DRAG_EVENT)
+      eDragEventClass)
 EVENT(dragstart,
       NS_DRAGDROP_START,
       EventNameType_HTMLXUL,
-      NS_DRAG_EVENT)
+      eDragEventClass)
 EVENT(drop,
       NS_DRAGDROP_DROP,
       EventNameType_HTMLXUL,
-      NS_DRAG_EVENT)
+      eDragEventClass)
 EVENT(durationchange,
       NS_DURATIONCHANGE,
       EventNameType_HTML,
       NS_EVENT)
 EVENT(emptied,
       NS_EMPTIED,
       EventNameType_HTML,
       NS_EVENT)
@@ -697,25 +697,25 @@ NON_IDL_EVENT(broadcast,
               NS_EVENT)
 NON_IDL_EVENT(commandupdate,
               NS_XUL_COMMAND_UPDATE,
               EventNameType_XUL,
               NS_EVENT)
 NON_IDL_EVENT(dragexit,
               NS_DRAGDROP_EXIT_SYNTH,
               EventNameType_XUL,
-              NS_DRAG_EVENT)
+              eDragEventClass)
 NON_IDL_EVENT(dragdrop,
               NS_DRAGDROP_DRAGDROP,
               EventNameType_XUL,
-              NS_DRAG_EVENT)
+              eDragEventClass)
 NON_IDL_EVENT(draggesture,
               NS_DRAGDROP_GESTURE,
               EventNameType_XUL,
-              NS_DRAG_EVENT)
+              eDragEventClass)
 NON_IDL_EVENT(overflow,
               NS_SCROLLPORT_OVERFLOW,
               EventNameType_XUL,
               NS_EVENT)
 NON_IDL_EVENT(underflow,
               NS_SCROLLPORT_UNDERFLOW,
               EventNameType_XUL,
               NS_EVENT)
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -3008,17 +3008,17 @@ EventStateManager::PostHandleEvent(nsPre
         DecideGestureEvent(aEvent->AsGestureNotifyEvent(), mCurrentTarget);
       }
     }
     break;
 
   case NS_DRAGDROP_ENTER:
   case NS_DRAGDROP_OVER:
     {
-      NS_ASSERTION(aEvent->mClass == NS_DRAG_EVENT, "Expected a drag event");
+      NS_ASSERTION(aEvent->mClass == eDragEventClass, "Expected a drag event");
 
       nsCOMPtr<nsIDragSession> dragSession = nsContentUtils::GetDragSession();
       if (!dragSession)
         break;
 
       // Reset the flag.
       dragSession->SetOnlyChromeDrop(false);
       if (mPresContext) {
--- a/dom/events/MouseEvent.cpp
+++ b/dom/events/MouseEvent.cpp
@@ -68,17 +68,17 @@ MouseEvent::InitMouseEvent(const nsAStri
   nsresult rv =
     UIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, aDetail);
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch(mEvent->mClass) {
     case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
-    case NS_DRAG_EVENT:
+    case eDragEventClass:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT: {
       WidgetMouseEventBase* mouseEventBase = mEvent->AsMouseEventBase();
       mouseEventBase->relatedTarget = aRelatedTarget;
       mouseEventBase->button = aButton;
       mouseEventBase->InitBasicModifiers(aCtrlKey, aAltKey, aShiftKey, aMetaKey);
       mClientPoint.x = aClientX;
       mClientPoint.y = aClientY;
@@ -122,17 +122,17 @@ MouseEvent::InitMouseEvent(const nsAStri
                                (modifiers & MODIFIER_META) != 0,
                                aButton, aRelatedTarget);
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch(mEvent->mClass) {
     case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
-    case NS_DRAG_EVENT:
+    case eDragEventClass:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       mEvent->AsInputEvent()->modifiers = modifiers;
       return NS_OK;
     default:
       MOZ_CRASH("There is no space to store the modifiers");
   }
 }
@@ -153,17 +153,17 @@ MouseEvent::Constructor(const GlobalObje
                     aParam.mMetaKey, aParam.mButton, aParam.mRelatedTarget,
                     aRv);
   e->SetTrusted(trusted);
 
   switch (e->mEvent->mClass) {
     case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
-    case NS_DRAG_EVENT:
+    case eDragEventClass:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       e->mEvent->AsMouseEventBase()->buttons = aParam.mButtons;
       break;
     default:
       break;
   }
 
@@ -212,17 +212,17 @@ MouseEvent::GetButton(int16_t* aButton)
 
 int16_t
 MouseEvent::Button()
 {
   switch(mEvent->mClass) {
     case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
-    case NS_DRAG_EVENT:
+    case eDragEventClass:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       return mEvent->AsMouseEventBase()->button;
     default:
       NS_WARNING("Tried to get mouse button for non-mouse event!");
       return WidgetMouseEvent::eLeftButton;
   }
 }
@@ -237,17 +237,17 @@ MouseEvent::GetButtons(uint16_t* aButton
 
 uint16_t
 MouseEvent::Buttons()
 {
   switch(mEvent->mClass) {
     case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
-    case NS_DRAG_EVENT:
+    case eDragEventClass:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       return mEvent->AsMouseEventBase()->buttons;
     default:
       MOZ_CRASH("Tried to get mouse buttons for non-mouse event!");
   }
 }
 
@@ -262,17 +262,17 @@ MouseEvent::GetRelatedTarget(nsIDOMEvent
 already_AddRefed<EventTarget>
 MouseEvent::GetRelatedTarget()
 {
   nsCOMPtr<EventTarget> relatedTarget;
   switch(mEvent->mClass) {
     case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
-    case NS_DRAG_EVENT:
+    case eDragEventClass:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       relatedTarget =
         do_QueryInterface(mEvent->AsMouseEventBase()->relatedTarget);
       break;
     default:
       break;
   }
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -116,17 +116,17 @@ UIEvent::GetMovementPoint()
   if (mPrivateDataDuplicated) {
     return mMovementPoint;
   }
 
   if (!mEvent ||
       (mEvent->mClass != eMouseEventClass &&
        mEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
        mEvent->mClass != NS_WHEEL_EVENT &&
-       mEvent->mClass != NS_DRAG_EVENT &&
+       mEvent->mClass != eDragEventClass &&
        mEvent->mClass != NS_POINTER_EVENT &&
        mEvent->mClass != NS_SIMPLE_GESTURE_EVENT) ||
        !mEvent->AsGUIEvent()->widget) {
     return nsIntPoint(0, 0);
   }
 
   // Calculate the delta between the last screen point and the current one.
   nsIntPoint current = DevPixelsToCSSPixels(mEvent->refPoint, mPresContext);
@@ -296,17 +296,17 @@ nsIntPoint
 UIEvent::GetLayerPoint() const
 {
   if (!mEvent ||
       (mEvent->mClass != eMouseEventClass &&
        mEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
        mEvent->mClass != NS_WHEEL_EVENT &&
        mEvent->mClass != NS_POINTER_EVENT &&
        mEvent->mClass != NS_TOUCH_EVENT &&
-       mEvent->mClass != NS_DRAG_EVENT &&
+       mEvent->mClass != eDragEventClass &&
        mEvent->mClass != NS_SIMPLE_GESTURE_EVENT) ||
       !mPresContext ||
       mEventIsInternal) {
     return mLayerPoint;
   }
   // XXX I'm not really sure this is correct; it's my best shot, though
   nsIFrame* targetFrame = mPresContext->EventStateManager()->GetEventTarget();
   if (!targetFrame)
--- a/dom/events/UIEvent.h
+++ b/dom/events/UIEvent.h
@@ -41,17 +41,17 @@ public:
 
   static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
                                          WidgetEvent* aEvent)
   {
     if (!aEvent ||
         (aEvent->mClass != eMouseEventClass &&
          aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
          aEvent->mClass != NS_WHEEL_EVENT &&
-         aEvent->mClass != NS_DRAG_EVENT &&
+         aEvent->mClass != eDragEventClass &&
          aEvent->mClass != NS_POINTER_EVENT &&
          aEvent->mClass != NS_SIMPLE_GESTURE_EVENT)) {
       return nsIntPoint(0, 0);
     }
 
     WidgetGUIEvent* event = aEvent->AsGUIEvent();
     if (!event->widget) {
       return LayoutDeviceIntPoint::ToUntyped(aEvent->refPoint);
@@ -68,17 +68,17 @@ public:
   static CSSIntPoint CalculateClientPoint(nsPresContext* aPresContext,
                                           WidgetEvent* aEvent,
                                           CSSIntPoint* aDefaultClientPoint)
   {
     if (!aEvent ||
         (aEvent->mClass != eMouseEventClass &&
          aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
          aEvent->mClass != NS_WHEEL_EVENT &&
-         aEvent->mClass != NS_DRAG_EVENT &&
+         aEvent->mClass != eDragEventClass &&
          aEvent->mClass != NS_POINTER_EVENT &&
          aEvent->mClass != NS_SIMPLE_GESTURE_EVENT) ||
         !aPresContext ||
         !aEvent->AsGUIEvent()->widget) {
       return aDefaultClientPoint
              ? *aDefaultClientPoint
              : CSSIntPoint(0, 0);
     }
--- a/dom/xbl/nsXBLEventHandler.cpp
+++ b/dom/xbl/nsXBLEventHandler.cpp
@@ -144,17 +144,17 @@ nsXBLKeyEventHandler::HandleEvent(nsIDOM
 ///////////////////////////////////////////////////////////////////////////////////
 
 nsresult
 NS_NewXBLEventHandler(nsXBLPrototypeHandler* aHandler,
                       nsIAtom* aEventType,
                       nsXBLEventHandler** aResult)
 {
   switch (nsContentUtils::GetEventCategory(nsDependentAtomString(aEventType))) {
-    case NS_DRAG_EVENT:
+    case eDragEventClass:
     case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       *aResult = new nsXBLMouseEventHandler(aHandler);
       break;
     default:
       *aResult = new nsXBLEventHandler(aHandler);
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1867,17 +1867,17 @@ nsLayoutUtils::GetDOMEventCoordinatesRel
 
 nsPoint
 nsLayoutUtils::GetEventCoordinatesRelativeTo(const WidgetEvent* aEvent,
                                              nsIFrame* aFrame)
 {
   if (!aEvent || (aEvent->mClass != eMouseEventClass &&
                   aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
                   aEvent->mClass != NS_WHEEL_EVENT &&
-                  aEvent->mClass != NS_DRAG_EVENT &&
+                  aEvent->mClass != eDragEventClass &&
                   aEvent->mClass != NS_SIMPLE_GESTURE_EVENT &&
                   aEvent->mClass != NS_POINTER_EVENT &&
                   aEvent->mClass != NS_GESTURENOTIFY_EVENT &&
                   aEvent->mClass != NS_TOUCH_EVENT &&
                   aEvent->mClass != eQueryContentEventClass))
     return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
 
   return GetEventCoordinatesRelativeTo(aEvent,
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -2541,17 +2541,17 @@ nsTreeBodyFrame::GetCursor(const nsPoint
     }
   }
 
   return nsLeafBoxFrame::GetCursor(aPoint, aCursor);
 }
 
 static uint32_t GetDropEffect(WidgetGUIEvent* aEvent)
 {
-  NS_ASSERTION(aEvent->mClass == NS_DRAG_EVENT, "wrong event type");
+  NS_ASSERTION(aEvent->mClass == eDragEventClass, "wrong event type");
   WidgetDragEvent* dragEvent = aEvent->AsDragEvent();
   nsContentUtils::SetDataTransferInEvent(dragEvent);
 
   uint32_t action = 0;
   if (dragEvent->dataTransfer)
     dragEvent->dataTransfer->GetDropEffectInt(&action);
   return action;
 }
@@ -2719,17 +2719,17 @@ nsTreeBodyFrame::HandleEvent(nsPresConte
     // Remove the drop folder and all its parents from the array.
     int32_t parentIndex;
     nsresult rv = mView->GetParentIndex(mSlots->mDropRow, &parentIndex);
     while (NS_SUCCEEDED(rv) && parentIndex >= 0) {
       mSlots->mArray.RemoveElement(parentIndex);
       rv = mView->GetParentIndex(parentIndex, &parentIndex);
     }
 
-    NS_ASSERTION(aEvent->mClass == NS_DRAG_EVENT, "wrong event type");
+    NS_ASSERTION(aEvent->mClass == eDragEventClass, "wrong event type");
     WidgetDragEvent* dragEvent = aEvent->AsDragEvent();
     nsContentUtils::SetDataTransferInEvent(dragEvent);
 
     mView->Drop(mSlots->mDropRow, mSlots->mDropOrient, dragEvent->dataTransfer);
     mSlots->mDropRow = -1;
     mSlots->mDropOrient = -1;
     mSlots->mIsDragging = false;
     *aEventStatus = nsEventStatus_eConsumeNoDefault; // already handled the drop
--- a/widget/BasicEvents.h
+++ b/widget/BasicEvents.h
@@ -36,17 +36,17 @@ enum EventClassID MOZ_ENUM_TYPE(EventCla
   eCompositionEventClass,            // WidgetCompositionEvent
   eTextEventClass,                   // WidgetTextEvent
   eQueryContentEventClass,           // WidgetQueryContentEvent
   eSelectionEventClass,              // WidgetSelectionEvent
   eEditorInputEventClass,            // InternalEditorInputEvent
 
   // MouseEvents.h
   eMouseEventClass,                  // WidgetMouseEvent
-  NS_DRAG_EVENT,                     // WidgetDragEvent
+  eDragEventClass,                   // WidgetDragEvent
   NS_MOUSE_SCROLL_EVENT,             // WidgetMouseScrollEvent
   NS_WHEEL_EVENT,                    // WidgetWheelEvent
   NS_POINTER_EVENT,                  // PointerEvent
 
   // TouchEvents.h
   NS_GESTURENOTIFY_EVENT,            // WidgetGestureNotifyEvent
   NS_SIMPLE_GESTURE_EVENT,           // WidgetSimpleGestureEvent
   NS_TOUCH_EVENT,                    // WidgetTouchEvent
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -300,29 +300,30 @@ public:
  * mozilla::WidgetDragEvent
  ******************************************************************************/
 
 class WidgetDragEvent : public WidgetMouseEvent
 {
 public:
   virtual WidgetDragEvent* AsDragEvent() MOZ_OVERRIDE { return this; }
 
-  WidgetDragEvent(bool aIsTrusted, uint32_t aMessage, nsIWidget* aWidget) :
-    WidgetMouseEvent(aIsTrusted, aMessage, aWidget, NS_DRAG_EVENT, eReal),
-    userCancelled(false), mDefaultPreventedOnContent(false)
+  WidgetDragEvent(bool aIsTrusted, uint32_t aMessage, nsIWidget* aWidget)
+    : WidgetMouseEvent(aIsTrusted, aMessage, aWidget, eDragEventClass, eReal)
+    , userCancelled(false)
+    , mDefaultPreventedOnContent(false)
   {
     mFlags.mCancelable =
       (aMessage != NS_DRAGDROP_EXIT_SYNTH &&
        aMessage != NS_DRAGDROP_LEAVE_SYNTH &&
        aMessage != NS_DRAGDROP_END);
   }
 
   virtual WidgetEvent* Duplicate() const MOZ_OVERRIDE
   {
-    MOZ_ASSERT(mClass == NS_DRAG_EVENT,
+    MOZ_ASSERT(mClass == eDragEventClass,
                "Duplicate() must be overridden by sub class");
     // Not copying widget, it is a weak reference.
     WidgetDragEvent* result = new WidgetDragEvent(false, message, nullptr);
     result->AssignDragEventData(*this, true);
     result->mFlags = mFlags;
     return result;
   }
 
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -645,17 +645,17 @@ KeymapWrapper::InitInputEvent(WidgetInpu
          GetBoolName(aInputEvent.modifiers & MODIFIER_CAPSLOCK),
          GetBoolName(aInputEvent.modifiers & MODIFIER_NUMLOCK),
          GetBoolName(aInputEvent.modifiers & MODIFIER_SCROLLLOCK)));
 
     switch(aInputEvent.mClass) {
         case eMouseEventClass:
         case NS_MOUSE_SCROLL_EVENT:
         case NS_WHEEL_EVENT:
-        case NS_DRAG_EVENT:
+        case eDragEventClass:
         case NS_SIMPLE_GESTURE_EVENT:
             break;
         default:
             return;
     }
 
     WidgetMouseEventBase& mouseEvent = *aInputEvent.AsMouseEventBase();
     mouseEvent.buttons = 0;
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -279,31 +279,31 @@ void
 ModifierKeyState::InitInputEvent(WidgetInputEvent& aInputEvent) const
 {
   aInputEvent.modifiers = mModifiers;
 
   switch(aInputEvent.mClass) {
     case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
-    case NS_DRAG_EVENT:
+    case eDragEventClass:
     case NS_SIMPLE_GESTURE_EVENT:
       InitMouseEvent(aInputEvent);
       break;
     default:
       break;
   }
 }
 
 void
 ModifierKeyState::InitMouseEvent(WidgetInputEvent& aMouseEvent) const
 {
   NS_ASSERTION(aMouseEvent.mClass == eMouseEventClass ||
                aMouseEvent.mClass == NS_WHEEL_EVENT ||
-               aMouseEvent.mClass == NS_DRAG_EVENT ||
+               aMouseEvent.mClass == eDragEventClass ||
                aMouseEvent.mClass == NS_SIMPLE_GESTURE_EVENT,
                "called with non-mouse event");
 
   if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) {
     // Buttons for immersive mode are handled in MetroInput.
     return;
   }