Bug 895274 part.5 Rename NS_EVENT_NULL to eVoidEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 29 Aug 2015 08:58:26 +0900
changeset 292517 3de33e39e9ce795331196508ea5d36f2547a4bcb
parent 292516 681ee47b9ea8add7cf47d87cae0d85364f5df1fb
child 292518 8efaeb0052b0a101a70ce32f71f72c825591833e
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [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.5 Rename NS_EVENT_NULL to eVoidEvent r=smaug
dom/base/nsDOMWindowUtils.cpp
dom/events/AnimationEvent.cpp
dom/events/BeforeAfterKeyboardEvent.cpp
dom/events/ClipboardEvent.cpp
dom/events/CompositionEvent.cpp
dom/events/DragEvent.cpp
dom/events/Event.cpp
dom/events/EventDispatcher.cpp
dom/events/EventDispatcher.h
dom/events/EventListenerManager.cpp
dom/events/EventListenerService.cpp
dom/events/EventStateManager.cpp
dom/events/InputEvent.cpp
dom/events/KeyboardEvent.cpp
dom/events/MouseEvent.cpp
dom/events/MouseScrollEvent.cpp
dom/events/MutationEvent.cpp
dom/events/NotifyPaintEvent.h
dom/events/PointerEvent.cpp
dom/events/SimpleGestureEvent.cpp
dom/events/TouchEvent.cpp
dom/events/TransitionEvent.cpp
dom/events/UIEvent.cpp
dom/events/WheelEvent.cpp
dom/events/XULCommandEvent.cpp
dom/smil/TimeEvent.cpp
layout/base/nsLayoutUtils.cpp
layout/base/nsPresShell.cpp
layout/generic/nsSelection.cpp
widget/EventMessageList.h
widget/IMEData.h
widget/InputData.cpp
widget/android/AndroidJavaWrappers.cpp
widget/android/nsWindow.cpp
widget/windows/KeyboardLayout.cpp
widget/windows/nsWindow.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -3572,17 +3572,17 @@ nsDOMWindowUtils::IsNodeDisabledForEvent
 {
   *aRetVal = false;
   MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
   nsCOMPtr<nsINode> n = do_QueryInterface(aNode);
   nsINode* node = n;
   while (node) {
     if (node->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) {
       nsCOMPtr<nsIFormControl> fc = do_QueryInterface(node);
-      if (fc && fc->IsDisabledForEvents(NS_EVENT_NULL)) {
+      if (fc && fc->IsDisabledForEvents(eVoidEvent)) {
         *aRetVal = true;
         break;
       }
     }
     node = node->GetParentNode();
   }
 
   return NS_OK;
--- a/dom/events/AnimationEvent.cpp
+++ b/dom/events/AnimationEvent.cpp
@@ -10,17 +10,17 @@
 
 namespace mozilla {
 namespace dom {
 
 AnimationEvent::AnimationEvent(EventTarget* aOwner,
                                nsPresContext* aPresContext,
                                InternalAnimationEvent* aEvent)
   : Event(aOwner, aPresContext,
-          aEvent ? aEvent : new InternalAnimationEvent(false, NS_EVENT_NULL))
+          aEvent ? aEvent : new InternalAnimationEvent(false, eVoidEvent))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
--- a/dom/events/BeforeAfterKeyboardEvent.cpp
+++ b/dom/events/BeforeAfterKeyboardEvent.cpp
@@ -13,17 +13,17 @@ namespace dom {
 
 BeforeAfterKeyboardEvent::BeforeAfterKeyboardEvent(
                                        EventTarget* aOwner,
                                        nsPresContext* aPresContext,
                                        InternalBeforeAfterKeyboardEvent* aEvent)
   : KeyboardEvent(aOwner, aPresContext,
                   aEvent ? aEvent :
                            new InternalBeforeAfterKeyboardEvent(false,
-                                                                NS_EVENT_NULL,
+                                                                eVoidEvent,
                                                                 nullptr))
 {
   MOZ_ASSERT(mEvent->mClass == eBeforeAfterKeyboardEventClass,
              "event type mismatch eBeforeAfterKeyboardEventClass");
 
   if (!aEvent) {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
--- a/dom/events/ClipboardEvent.cpp
+++ b/dom/events/ClipboardEvent.cpp
@@ -11,17 +11,17 @@
 
 namespace mozilla {
 namespace dom {
 
 ClipboardEvent::ClipboardEvent(EventTarget* aOwner,
                                nsPresContext* aPresContext,
                                InternalClipboardEvent* aEvent)
   : Event(aOwner, aPresContext,
-          aEvent ? aEvent : new InternalClipboardEvent(false, NS_EVENT_NULL))
+          aEvent ? aEvent : new InternalClipboardEvent(false, eVoidEvent))
 {
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
 }
--- a/dom/events/CompositionEvent.cpp
+++ b/dom/events/CompositionEvent.cpp
@@ -11,17 +11,17 @@
 namespace mozilla {
 namespace dom {
 
 CompositionEvent::CompositionEvent(EventTarget* aOwner,
                                    nsPresContext* aPresContext,
                                    WidgetCompositionEvent* aEvent)
   : UIEvent(aOwner, aPresContext,
             aEvent ? aEvent :
-                     new WidgetCompositionEvent(false, NS_EVENT_NULL, nullptr))
+                     new WidgetCompositionEvent(false, eVoidEvent, nullptr))
 {
   NS_ASSERTION(mEvent->mClass == eCompositionEventClass,
                "event type mismatch");
 
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
--- a/dom/events/DragEvent.cpp
+++ b/dom/events/DragEvent.cpp
@@ -12,17 +12,17 @@
 namespace mozilla {
 namespace dom {
 
 DragEvent::DragEvent(EventTarget* aOwner,
                      nsPresContext* aPresContext,
                      WidgetDragEvent* aEvent)
   : MouseEvent(aOwner, aPresContext,
                aEvent ? aEvent :
-                        new WidgetDragEvent(false, NS_EVENT_NULL, nullptr))
+                        new WidgetDragEvent(false, eVoidEvent, nullptr))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
     mEvent->refPoint.x = mEvent->refPoint.y = 0;
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -101,17 +101,17 @@ Event::ConstructorInit(EventTarget* aOwn
             mEventIsInternal = false;
           }
           else {
             mEventIsInternal = true;
           }
           ...
         }
      */
-    mEvent = new WidgetEvent(false, NS_EVENT_NULL);
+    mEvent = new WidgetEvent(false, eVoidEvent);
     mEvent->time = PR_Now();
   }
 
   InitPresContextData(aPresContext);
 }
 
 void
 Event::InitPresContextData(nsPresContext* aPresContext)
--- a/dom/events/EventDispatcher.cpp
+++ b/dom/events/EventDispatcher.cpp
@@ -488,17 +488,17 @@ EventDispatcher::Dispatch(nsISupports* a
       // Set the target to be the original dispatch target,
       aEvent->target = target;
       // but use chrome event handler or TabChildGlobal for event target chain.
       target = piTarget;
     }
   }
 
 #ifdef DEBUG
-  if (aEvent->mMessage != NS_EVENT_NULL &&
+  if (aEvent->mMessage != eVoidEvent &&
       !nsContentUtils::IsSafeToRunScript()) {
     nsresult rv = NS_ERROR_FAILURE;
     if (target->GetContextForEventHandlers(&rv) ||
         NS_FAILED(rv)) {
       nsCOMPtr<nsINode> node = do_QueryInterface(target);
       if (node && nsContentUtils::IsChromeDoc(node->OwnerDoc())) {
         NS_WARNING("Fix the caller!");
       } else {
--- a/dom/events/EventDispatcher.h
+++ b/dom/events/EventDispatcher.h
@@ -242,17 +242,17 @@ public:
    * aTarget is always used as the starting point for constructing the event
    * target chain, no matter what the value of aEvent->target is.
    * In other words, aEvent->target is only a property of the event and it has
    * nothing to do with the construction of the event target chain.
    * Neither aTarget nor aEvent is allowed to be nullptr.
    *
    * If aTargets is non-null, event target chain will be created, but
    * event won't be handled. In this case aEvent->mMessage should be
-   * NS_EVENT_NULL.
+   * eVoidEvent.
    * @note Use this method when dispatching a WidgetEvent.
    */
   static nsresult Dispatch(nsISupports* aTarget,
                            nsPresContext* aPresContext,
                            WidgetEvent* aEvent,
                            nsIDOMEvent* aDOMEvent = nullptr,
                            nsEventStatus* aEventStatus = nullptr,
                            EventDispatchingCallback* aCallback = nullptr,
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -90,17 +90,17 @@ MutationBitForEventType(EventMessage aEv
       break;
   }
   return 0;
 }
 
 uint32_t EventListenerManager::sMainThreadCreatedCount = 0;
 
 EventListenerManagerBase::EventListenerManagerBase()
-  : mNoListenerForEvent(NS_EVENT_NULL)
+  : mNoListenerForEvent(eVoidEvent)
   , mMayHavePaintEventListener(false)
   , mMayHaveMutationListeners(false)
   , mMayHaveCapturingListeners(false)
   , mMayHaveSystemGroupListeners(false)
   , mMayHaveTouchEventListener(false)
   , mMayHaveMouseEnterLeaveEventListener(false)
   , mMayHavePointerEnterLeaveEventListener(false)
   , mMayHaveKeyEventListener(false)
@@ -252,17 +252,17 @@ EventListenerManager::AddEventListenerIn
         listener->mFlags == aFlags &&
         EVENT_TYPE_EQUALS(listener, aEventMessage, aTypeAtom, aTypeString,
                           aAllEvents) &&
         listener->mListener == aListenerHolder) {
       return;
     }
   }
 
-  mNoListenerForEvent = NS_EVENT_NULL;
+  mNoListenerForEvent = eVoidEvent;
   mNoListenerForEventAtom = nullptr;
 
   listener = aAllEvents ? mListeners.InsertElementAt(0) :
                           mListeners.AppendElement();
   listener->mListener = aListenerHolder;
   listener->mEventMessage = aEventMessage;
   listener->mTypeString = aTypeString;
   listener->mTypeAtom = aTypeAtom;
@@ -519,17 +519,17 @@ EventListenerManager::RemoveEventListene
     if (EVENT_TYPE_EQUALS(listener, aEventMessage, aUserType, aTypeString,
                           aAllEvents)) {
       ++typeCount;
       if (listener->mListener == aListenerHolder &&
           listener->mFlags.EqualsIgnoringTrustness(aFlags)) {
         nsRefPtr<EventListenerManager> kungFuDeathGrip(this);
         mListeners.RemoveElementAt(i);
         --count;
-        mNoListenerForEvent = NS_EVENT_NULL;
+        mNoListenerForEvent = eVoidEvent;
         mNoListenerForEventAtom = nullptr;
         if (mTarget && aUserType) {
           mTarget->EventListenerRemoved(aUserType);
         }
         if (mIsMainThreadELM && mTarget) {
           EventListenerService::NotifyAboutMainThreadListenerChange(mTarget,
                                                                     aUserType);
         }
@@ -786,17 +786,17 @@ EventListenerManager::RemoveEventHandler
     return;
   }
 
   EventMessage eventMessage = nsContentUtils::GetEventMessage(aName);
   Listener* listener = FindEventHandler(eventMessage, aName, aTypeString);
 
   if (listener) {
     mListeners.RemoveElementAt(uint32_t(listener - &mListeners.ElementAt(0)));
-    mNoListenerForEvent = NS_EVENT_NULL;
+    mNoListenerForEvent = eVoidEvent;
     mNoListenerForEventAtom = nullptr;
     if (mTarget && aName) {
       mTarget->EventListenerRemoved(aName);
     }
     if (mIsMainThreadELM && mTarget) {
       EventListenerService::NotifyAboutMainThreadListenerChange(mTarget, aName);
     }
   }
--- a/dom/events/EventListenerService.cpp
+++ b/dom/events/EventListenerService.cpp
@@ -221,17 +221,17 @@ EventListenerService::GetListenerInfoFor
 NS_IMETHODIMP
 EventListenerService::GetEventTargetChainFor(nsIDOMEventTarget* aEventTarget,
                                              uint32_t* aCount,
                                              nsIDOMEventTarget*** aOutArray)
 {
   *aCount = 0;
   *aOutArray = nullptr;
   NS_ENSURE_ARG(aEventTarget);
-  WidgetEvent event(true, NS_EVENT_NULL);
+  WidgetEvent event(true, eVoidEvent);
   nsTArray<EventTarget*> targets;
   nsresult rv = EventDispatcher::Dispatch(aEventTarget, nullptr, &event,
                                           nullptr, nullptr, nullptr, &targets);
   NS_ENSURE_SUCCESS(rv, rv);
   int32_t count = targets.Length();
   if (count == 0) {
     return NS_OK;
   }
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -620,17 +620,17 @@ EventStateManager::PreHandleEvent(nsPres
       // then fall through...
     } else {
       if (sPointerEventEnabled) {
         // We should synthetize corresponding pointer events
         GeneratePointerEnterExit(NS_POINTER_LEAVE, mouseEvent);
       }
       GenerateMouseEnterExit(mouseEvent);
       //This is a window level mouse exit event and should stop here
-      aEvent->mMessage = NS_EVENT_NULL;
+      aEvent->mMessage = eVoidEvent;
       break;
     }
   case NS_MOUSE_MOVE:
   case NS_POINTER_DOWN:
   case NS_POINTER_MOVE: {
     // on the Mac, GenerateDragGesture() may not return until the drag
     // has completed and so |aTargetFrame| may have been deleted (moving
     // a bookmark, for example).  If this is the case, however, we know
--- a/dom/events/InputEvent.cpp
+++ b/dom/events/InputEvent.cpp
@@ -11,18 +11,17 @@
 namespace mozilla {
 namespace dom {
 
 InputEvent::InputEvent(EventTarget* aOwner,
                        nsPresContext* aPresContext,
                        InternalEditorInputEvent* aEvent)
   : UIEvent(aOwner, aPresContext,
             aEvent ? aEvent :
-                     new InternalEditorInputEvent(false, NS_EVENT_NULL,
-                                                  nullptr))
+                     new InternalEditorInputEvent(false, eVoidEvent, nullptr))
 {
   NS_ASSERTION(mEvent->mClass == eEditorInputEventClass,
                "event type mismatch");
 
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
--- a/dom/events/KeyboardEvent.cpp
+++ b/dom/events/KeyboardEvent.cpp
@@ -11,17 +11,17 @@
 namespace mozilla {
 namespace dom {
 
 KeyboardEvent::KeyboardEvent(EventTarget* aOwner,
                              nsPresContext* aPresContext,
                              WidgetKeyboardEvent* aEvent)
   : UIEvent(aOwner, aPresContext,
             aEvent ? aEvent :
-                     new WidgetKeyboardEvent(false, NS_EVENT_NULL, nullptr))
+                     new WidgetKeyboardEvent(false, eVoidEvent, nullptr))
   , mInitializedByCtor(false)
   , mInitializedWhichValue(0)
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
--- a/dom/events/MouseEvent.cpp
+++ b/dom/events/MouseEvent.cpp
@@ -13,17 +13,17 @@
 namespace mozilla {
 namespace dom {
 
 MouseEvent::MouseEvent(EventTarget* aOwner,
                        nsPresContext* aPresContext,
                        WidgetMouseEventBase* aEvent)
   : UIEvent(aOwner, aPresContext,
             aEvent ? aEvent :
-                     new WidgetMouseEvent(false, NS_EVENT_NULL, nullptr,
+                     new WidgetMouseEvent(false, eVoidEvent, nullptr,
                                           WidgetMouseEvent::eReal))
 {
   // There's no way to make this class' ctor allocate an WidgetMouseScrollEvent.
   // It's not that important, though, since a scroll event is not a real
   // DOM event.
 
   WidgetMouseEvent* mouseEvent = mEvent->AsMouseEvent();
   if (aEvent) {
--- a/dom/events/MouseScrollEvent.cpp
+++ b/dom/events/MouseScrollEvent.cpp
@@ -11,18 +11,17 @@
 namespace mozilla {
 namespace dom {
 
 MouseScrollEvent::MouseScrollEvent(EventTarget* aOwner,
                                    nsPresContext* aPresContext,
                                    WidgetMouseScrollEvent* aEvent)
   : MouseEvent(aOwner, aPresContext,
                aEvent ? aEvent :
-                        new WidgetMouseScrollEvent(false, NS_EVENT_NULL,
-                                                   nullptr))
+                        new WidgetMouseScrollEvent(false, eVoidEvent, nullptr))
 {
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
     mEvent->refPoint.x = mEvent->refPoint.y = 0;
     static_cast<WidgetMouseEventBase*>(mEvent)->inputSource =
--- a/dom/events/MutationEvent.cpp
+++ b/dom/events/MutationEvent.cpp
@@ -12,17 +12,17 @@ class nsPresContext;
 
 namespace mozilla {
 namespace dom {
 
 MutationEvent::MutationEvent(EventTarget* aOwner,
                              nsPresContext* aPresContext,
                              InternalMutationEvent* aEvent)
   : Event(aOwner, aPresContext,
-          aEvent ? aEvent : new InternalMutationEvent(false, NS_EVENT_NULL))
+          aEvent ? aEvent : new InternalMutationEvent(false, eVoidEvent))
 {
   mEventIsInternal = (aEvent == nullptr);
 }
 
 NS_INTERFACE_MAP_BEGIN(MutationEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMutationEvent)
 NS_INTERFACE_MAP_END_INHERITING(Event)
 
--- a/dom/events/NotifyPaintEvent.h
+++ b/dom/events/NotifyPaintEvent.h
@@ -68,13 +68,13 @@ private:
 } // namespace mozilla
 
 // This empties aInvalidateRequests.
 already_AddRefed<mozilla::dom::NotifyPaintEvent>
 NS_NewDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
                           nsPresContext* aPresContext,
                           mozilla::WidgetEvent* aEvent,
                           mozilla::EventMessage aEventMessage =
-                            mozilla::NS_EVENT_NULL,
+                            mozilla::eVoidEvent,
                           nsInvalidateRequestList* aInvalidateRequests =
                             nullptr);
 
 #endif // mozilla_dom_NotifyPaintEvent_h_
--- a/dom/events/PointerEvent.cpp
+++ b/dom/events/PointerEvent.cpp
@@ -13,17 +13,17 @@
 namespace mozilla {
 namespace dom {
 
 PointerEvent::PointerEvent(EventTarget* aOwner,
                            nsPresContext* aPresContext,
                            WidgetPointerEvent* aEvent)
   : MouseEvent(aOwner, aPresContext,
                aEvent ? aEvent :
-                        new WidgetPointerEvent(false, NS_EVENT_NULL, nullptr))
+                        new WidgetPointerEvent(false, eVoidEvent, nullptr))
 {
   NS_ASSERTION(mEvent->mClass == ePointerEventClass,
                "event type mismatch ePointerEventClass");
 
   WidgetMouseEvent* mouseEvent = mEvent->AsMouseEvent();
   if (aEvent) {
     mEventIsInternal = false;
   } else {
--- a/dom/events/SimpleGestureEvent.cpp
+++ b/dom/events/SimpleGestureEvent.cpp
@@ -11,17 +11,17 @@
 namespace mozilla {
 namespace dom {
 
 SimpleGestureEvent::SimpleGestureEvent(EventTarget* aOwner,
                                        nsPresContext* aPresContext,
                                        WidgetSimpleGestureEvent* aEvent)
   : MouseEvent(aOwner, aPresContext,
                aEvent ? aEvent :
-                        new WidgetSimpleGestureEvent(false, NS_EVENT_NULL,
+                        new WidgetSimpleGestureEvent(false, eVoidEvent,
                                                      nullptr))
 {
   NS_ASSERTION(mEvent->mClass == eSimpleGestureEventClass,
                "event type mismatch");
 
   if (aEvent) {
     mEventIsInternal = false;
   } else {
--- a/dom/events/TouchEvent.cpp
+++ b/dom/events/TouchEvent.cpp
@@ -59,17 +59,17 @@ TouchList::IdentifiedTouch(int32_t aIden
  * TouchEvent
  *****************************************************************************/
 
 TouchEvent::TouchEvent(EventTarget* aOwner,
                        nsPresContext* aPresContext,
                        WidgetTouchEvent* aEvent)
   : UIEvent(aOwner, aPresContext,
             aEvent ? aEvent :
-                     new WidgetTouchEvent(false, NS_EVENT_NULL, nullptr))
+                     new WidgetTouchEvent(false, eVoidEvent, nullptr))
 {
   if (aEvent) {
     mEventIsInternal = false;
 
     for (uint32_t i = 0; i < aEvent->touches.Length(); ++i) {
       Touch* touch = aEvent->touches[i];
       touch->InitializePoints(mPresContext, aEvent);
     }
--- a/dom/events/TransitionEvent.cpp
+++ b/dom/events/TransitionEvent.cpp
@@ -10,17 +10,17 @@
 
 namespace mozilla {
 namespace dom {
 
 TransitionEvent::TransitionEvent(EventTarget* aOwner,
                                  nsPresContext* aPresContext,
                                  InternalTransitionEvent* aEvent)
   : Event(aOwner, aPresContext,
-          aEvent ? aEvent : new InternalTransitionEvent(false, NS_EVENT_NULL))
+          aEvent ? aEvent : new InternalTransitionEvent(false, eVoidEvent))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -24,17 +24,17 @@
 
 namespace mozilla {
 namespace dom {
 
 UIEvent::UIEvent(EventTarget* aOwner,
                  nsPresContext* aPresContext,
                  WidgetGUIEvent* aEvent)
   : Event(aOwner, aPresContext,
-          aEvent ? aEvent : new InternalUIEvent(false, NS_EVENT_NULL, nullptr))
+          aEvent ? aEvent : new InternalUIEvent(false, eVoidEvent, nullptr))
   , mClientPoint(0, 0)
   , mLayerPoint(0, 0)
   , mPagePoint(0, 0)
   , mMovementPoint(0, 0)
   , mIsPointerLocked(EventStateManager::sIsPointerLocked)
   , mLastClientPoint(EventStateManager::sLastClientPoint)
 {
   if (aEvent) {
--- a/dom/events/WheelEvent.cpp
+++ b/dom/events/WheelEvent.cpp
@@ -11,18 +11,17 @@
 namespace mozilla {
 namespace dom {
 
 WheelEvent::WheelEvent(EventTarget* aOwner,
                        nsPresContext* aPresContext,
                        WidgetWheelEvent* aWheelEvent)
   : MouseEvent(aOwner, aPresContext,
                aWheelEvent ? aWheelEvent :
-                             new WidgetWheelEvent(false, NS_EVENT_NULL,
-                                                  nullptr))
+                             new WidgetWheelEvent(false, eVoidEvent, nullptr))
   , mAppUnitsPerDevPixel(0)
 {
   if (aWheelEvent) {
     mEventIsInternal = false;
     // If the delta mode is pixel, the WidgetWheelEvent's delta values are in
     // device pixels.  However, JS contents need the delta values in CSS pixels.
     // We should store the value of mAppUnitsPerDevPixel here because
     // it might be changed by changing zoom or something.
--- a/dom/events/XULCommandEvent.cpp
+++ b/dom/events/XULCommandEvent.cpp
@@ -10,17 +10,17 @@
 namespace mozilla {
 namespace dom {
 
 XULCommandEvent::XULCommandEvent(EventTarget* aOwner,
                                  nsPresContext* aPresContext,
                                  WidgetInputEvent* aEvent)
   : UIEvent(aOwner, aPresContext,
             aEvent ? aEvent :
-                     new WidgetInputEvent(false, NS_EVENT_NULL, nullptr))
+                     new WidgetInputEvent(false, eVoidEvent, nullptr))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
--- a/dom/smil/TimeEvent.cpp
+++ b/dom/smil/TimeEvent.cpp
@@ -12,17 +12,17 @@
 
 namespace mozilla {
 namespace dom {
 
 TimeEvent::TimeEvent(EventTarget* aOwner,
                      nsPresContext* aPresContext,
                      InternalSMILTimeEvent* aEvent)
   : Event(aOwner, aPresContext,
-          aEvent ? aEvent : new InternalSMILTimeEvent(false, NS_EVENT_NULL))
+          aEvent ? aEvent : new InternalSMILTimeEvent(false, eVoidEvent))
   , mDetail(mEvent->AsSMILTimeEvent()->detail)
 {
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
   }
 
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -8168,17 +8168,17 @@ nsLayoutUtils::HasApzAwareListeners(Even
          aElm->HasListenersFor(nsHtml5Atoms::onmousewheel) ||
          aElm->HasListenersFor(nsGkAtoms::onMozMousePixelScroll);
 }
 
 /* static */ bool
 nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(nsIPresShell* aShell)
 {
   if (nsIDocument* doc = aShell->GetDocument()) {
-    WidgetEvent event(true, NS_EVENT_NULL);
+    WidgetEvent event(true, eVoidEvent);
     nsTArray<EventTarget*> targets;
     nsresult rv = EventDispatcher::Dispatch(doc, nullptr, &event, nullptr,
         nullptr, nullptr, &targets);
     NS_ENSURE_SUCCESS(rv, false);
     for (size_t i = 0; i < targets.Length(); i++) {
       if (HasApzAwareListeners(targets[i]->GetExistingListenerManager())) {
         return true;
       }
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -6656,17 +6656,17 @@ FlushThrottledStyles(nsIDocument *aDocum
 static nsresult
 DispatchPointerFromMouseOrTouch(PresShell* aShell,
                                 nsIFrame* aFrame,
                                 WidgetGUIEvent* aEvent,
                                 bool aDontRetargetEvents,
                                 nsEventStatus* aStatus,
                                 nsIContent** aTargetContent)
 {
-  EventMessage pointerMessage = NS_EVENT_NULL;
+  EventMessage pointerMessage = eVoidEvent;
   if (aEvent->mClass == eMouseEventClass) {
     WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
     // if it is not mouse then it is likely will come as touch event
     if (!mouseEvent->convertToPointer) {
       return NS_OK;
     }
     int16_t button = mouseEvent->button;
     switch (mouseEvent->mMessage) {
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -1715,17 +1715,17 @@ nsFrameSelection::TakeFocus(nsIContent* 
     {
       int32_t offset;
       nsINode *cellparent = GetCellParent(aNewFocus);
       if (mCellParent && cellparent && cellparent != mCellParent) //switch to cell selection mode
       {
 #ifdef DEBUG_TABLE_SELECTION
 printf(" * TakeFocus - moving into new cell\n");
 #endif
-        WidgetMouseEvent event(false, NS_EVENT_NULL, nullptr,
+        WidgetMouseEvent event(false, eVoidEvent, nullptr,
                                WidgetMouseEvent::eReal);
 
         // Start selecting in the cell we were in before
         nsINode* parent = ParentOffset(mCellParent, &offset);
         if (parent)
           HandleTableSelection(parent, offset,
                                nsISelectionPrivate::TABLESELECTION_CELL, &event);
 
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -4,17 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /**
  * This header file lists up all event messages and their values.
  * Before including this header file, you should define
  * NS_EVENT_MESSAGE(aMessage, aValue)
  */
 
-NS_EVENT_MESSAGE(NS_EVENT_NULL,         0)
+NS_EVENT_MESSAGE(eVoidEvent,            0)
 
 // This is a dummy event message for all event listener implementation in
 // EventListenerManager.
 NS_EVENT_MESSAGE(NS_EVENT_ALL,          1)
 
 NS_EVENT_MESSAGE(NS_WINDOW_START,       100)
 // Widget may be destroyed
 NS_EVENT_MESSAGE(NS_XUL_CLOSE,          NS_WINDOW_START + 1)
--- a/widget/IMEData.h
+++ b/widget/IMEData.h
@@ -413,17 +413,17 @@ struct IMENotification final
       case NOTIFY_IME_OF_SELECTION_CHANGE:
         mSelectionChangeData.mString = new nsString();
         mSelectionChangeData.Clear();
         break;
       case NOTIFY_IME_OF_TEXT_CHANGE:
         mTextChangeData.Clear();
         break;
       case NOTIFY_IME_OF_MOUSE_BUTTON_EVENT:
-        mMouseButtonEventData.mEventMessage = NS_EVENT_NULL;
+        mMouseButtonEventData.mEventMessage = eVoidEvent;
         mMouseButtonEventData.mOffset = UINT32_MAX;
         mMouseButtonEventData.mCursorPos.Set(nsIntPoint(0, 0));
         mMouseButtonEventData.mCharRect.Set(nsIntRect(0, 0, 0, 0));
         mMouseButtonEventData.mButton = -1;
         mMouseButtonEventData.mButtons = 0;
         mMouseButtonEventData.mModifiers = 0;
       default:
         break;
--- a/widget/InputData.cpp
+++ b/widget/InputData.cpp
@@ -76,17 +76,17 @@ MultiTouchInput::MultiTouchInput(const W
 }
 
 WidgetTouchEvent
 MultiTouchInput::ToWidgetTouchEvent(nsIWidget* aWidget) const
 {
   MOZ_ASSERT(NS_IsMainThread(),
              "Can only convert To WidgetTouchEvent on main thread");
 
-  EventMessage touchEventMessage = NS_EVENT_NULL;
+  EventMessage touchEventMessage = eVoidEvent;
   switch (mType) {
   case MULTITOUCH_START:
     touchEventMessage = NS_TOUCH_START;
     break;
   case MULTITOUCH_MOVE:
     touchEventMessage = NS_TOUCH_MOVE;
     break;
   case MULTITOUCH_END:
@@ -96,17 +96,17 @@ MultiTouchInput::ToWidgetTouchEvent(nsIW
     touchEventMessage = NS_TOUCH_CANCEL;
     break;
   default:
     MOZ_ASSERT_UNREACHABLE("Did not assign a type to WidgetTouchEvent in MultiTouchInput");
     break;
   }
 
   WidgetTouchEvent event(true, touchEventMessage, aWidget);
-  if (touchEventMessage == NS_EVENT_NULL) {
+  if (touchEventMessage == eVoidEvent) {
     return event;
   }
 
   event.modifiers = this->modifiers;
   event.time = this->mTime;
   event.timeStamp = this->mTimeStamp;
 
   for (size_t i = 0; i < mTouches.Length(); i++) {
@@ -117,17 +117,17 @@ MultiTouchInput::ToWidgetTouchEvent(nsIW
 }
 
 WidgetMouseEvent
 MultiTouchInput::ToWidgetMouseEvent(nsIWidget* aWidget) const
 {
   MOZ_ASSERT(NS_IsMainThread(),
              "Can only convert To WidgetMouseEvent on main thread");
 
-  EventMessage mouseEventMessage = NS_EVENT_NULL;
+  EventMessage mouseEventMessage = eVoidEvent;
   switch (mType) {
     case MultiTouchInput::MULTITOUCH_START:
       mouseEventMessage = NS_MOUSE_BUTTON_DOWN;
       break;
     case MultiTouchInput::MULTITOUCH_MOVE:
       mouseEventMessage = NS_MOUSE_MOVE;
       break;
     case MultiTouchInput::MULTITOUCH_CANCEL:
--- a/widget/android/AndroidJavaWrappers.cpp
+++ b/widget/android/AndroidJavaWrappers.cpp
@@ -684,17 +684,17 @@ AndroidGeckoEvent::ApzEventStatus()
 
 WidgetTouchEvent
 AndroidGeckoEvent::MakeTouchEvent(nsIWidget* widget)
 {
     if (Type() == APZ_INPUT_EVENT) {
         return mApzInput.ToWidgetTouchEvent(widget);
     }
 
-    EventMessage type = NS_EVENT_NULL;
+    EventMessage type = eVoidEvent;
     int startIndex = 0;
     int endIndex = Count();
 
     switch (Action()) {
         case AndroidMotionEvent::ACTION_HOVER_ENTER: {
             if (ToolTypes()[0] == AndroidMotionEvent::TOOL_TYPE_MOUSE) {
                 break;
             }
@@ -730,17 +730,17 @@ AndroidGeckoEvent::MakeTouchEvent(nsIWid
         case AndroidMotionEvent::ACTION_OUTSIDE:
         case AndroidMotionEvent::ACTION_CANCEL: {
             type = NS_TOUCH_CANCEL;
             break;
         }
     }
 
     WidgetTouchEvent event(true, type, widget);
-    if (type == NS_EVENT_NULL) {
+    if (type == eVoidEvent) {
         // An event we don't know about
         return event;
     }
 
     event.modifiers = DOMModifiers();
     event.time = Time();
 
     const LayoutDeviceIntPoint& offset = widget->WidgetToScreenOffset();
@@ -825,17 +825,17 @@ AndroidGeckoEvent::MakeMultiTouchInput(n
     }
 
     return event;
 }
 
 WidgetMouseEvent
 AndroidGeckoEvent::MakeMouseEvent(nsIWidget* widget)
 {
-    EventMessage msg = NS_EVENT_NULL;
+    EventMessage msg = eVoidEvent;
     if (Points().Length() > 0) {
         switch (Action()) {
             case AndroidMotionEvent::ACTION_HOVER_MOVE:
                 msg = NS_MOUSE_MOVE;
                 break;
             case AndroidMotionEvent::ACTION_HOVER_ENTER:
                 msg = NS_MOUSE_ENTER_WIDGET;
                 break;
@@ -845,17 +845,17 @@ AndroidGeckoEvent::MakeMouseEvent(nsIWid
             default:
                 break;
         }
     }
 
     WidgetMouseEvent event(true, msg, widget,
                            WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
 
-    if (msg == NS_EVENT_NULL) {
+    if (msg == eVoidEvent) {
         // unknown type, or no point data. abort
         return event;
     }
 
     // XXX can we synthesize different buttons?
     event.button = WidgetMouseEvent::eLeftButton;
     if (msg != NS_MOUSE_MOVE) {
         event.clickCount = 1;
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -961,17 +961,17 @@ nsWindow::GetNativeData(uint32_t aDataTy
 }
 
 void
 nsWindow::OnMouseEvent(AndroidGeckoEvent *ae)
 {
     nsRefPtr<nsWindow> kungFuDeathGrip(this);
 
     WidgetMouseEvent event = ae->MakeMouseEvent(this);
-    if (event.mMessage == NS_EVENT_NULL) {
+    if (event.mMessage == eVoidEvent) {
         // invalid event type, abort
         return;
     }
 
     DispatchEvent(&event);
 }
 
 bool
@@ -1047,17 +1047,17 @@ bool nsWindow::OnMultitouchEvent(Android
     // of the next sequence.
     static bool sDefaultPreventedNotified = false;
     static bool sLastWasDownEvent = false;
 
     bool preventDefaultActions = false;
     bool isDownEvent = false;
 
     WidgetTouchEvent event = ae->MakeTouchEvent(this);
-    if (event.mMessage != NS_EVENT_NULL) {
+    if (event.mMessage != eVoidEvent) {
         nsEventStatus status;
         DispatchEvent(&event, status);
         // We check mMultipleActionsPrevented because that's what <input type=range>
         // sets when someone starts dragging the thumb. It doesn't set the status
         // because it doesn't want to prevent the code that gives the input focus
         // from running.
         preventDefaultActions = (status == nsEventStatus_eConsumeNoDefault ||
                                 event.mFlags.mMultipleActionsPrevented);
@@ -1113,17 +1113,17 @@ bool nsWindow::OnMultitouchEvent(Android
 }
 
 void
 nsWindow::OnNativeGestureEvent(AndroidGeckoEvent *ae)
 {
     LayoutDeviceIntPoint pt(ae->Points()[0].x,
                             ae->Points()[0].y);
     double delta = ae->X();
-    EventMessage msg = NS_EVENT_NULL;
+    EventMessage msg = eVoidEvent;
 
     switch (ae->Action()) {
         case AndroidMotionEvent::ACTION_MAGNIFY_START:
             msg = NS_SIMPLE_GESTURE_MAGNIFY_START;
             mStartDist = delta;
             mLastDist = delta;
             break;
         case AndroidMotionEvent::ACTION_MAGNIFY:
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1318,17 +1318,17 @@ NativeKey::HandleAppCommandMessage() con
       return true;
     }
   }
 
   // Dispatch a command event or a content command event if the command is
   // supported.
   if (!consumed) {
     uint32_t appCommand = GET_APPCOMMAND_LPARAM(mMsg.lParam);
-    EventMessage contentCommandMessage = NS_EVENT_NULL;
+    EventMessage contentCommandMessage = eVoidEvent;
     switch (appCommand) {
       case APPCOMMAND_BROWSER_BACKWARD:
       case APPCOMMAND_BROWSER_FORWARD:
       case APPCOMMAND_BROWSER_REFRESH:
       case APPCOMMAND_BROWSER_STOP:
       case APPCOMMAND_BROWSER_SEARCH:
       case APPCOMMAND_BROWSER_FAVORITES:
       case APPCOMMAND_BROWSER_HOME:
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6502,17 +6502,17 @@ bool nsWindow::OnGesture(WPARAM wParam, 
     }
 
     mGesture.CloseGestureInfoHandle((HGESTUREINFO)lParam);
 
     return true;
   }
 
   // Other gestures translate into simple gesture events:
-  WidgetSimpleGestureEvent event(true, NS_EVENT_NULL, this);
+  WidgetSimpleGestureEvent event(true, eVoidEvent, this);
   if ( !mGesture.ProcessGestureMessage(mWnd, wParam, lParam, event) ) {
     return false; // fall through to DefWndProc
   }
   
   // Polish up and send off the new event
   ModifierKeyState modifierKeyState;
   modifierKeyState.InitInputEvent(event);
   event.button    = 0;