Bug 1046101 part.18 Rename NS_TOUCH_EVENT to eTouchEventClass r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 04 Aug 2014 14:28:53 +0900
changeset 219284 cf0c9fbd6cb2fea36b2937f24702af55fe942f1d
parent 219283 eba87b3656a5263006fdf596fcf7e05e6d88bbf8
child 219285 ad442dc11b0576b11a95760b79d4d05c47405173
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [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.18 Rename NS_TOUCH_EVENT to eTouchEventClass r=smaug
content/html/content/src/HTMLInputElement.cpp
dom/events/Event.cpp
dom/events/EventDispatcher.cpp
dom/events/EventNameList.h
dom/events/EventStateManager.cpp
dom/events/UIEvent.cpp
dom/ipc/TabParent.cpp
gfx/layers/apz/src/APZCTreeManager.cpp
layout/base/PositionedEventTargeting.cpp
layout/base/nsLayoutUtils.cpp
layout/base/nsPresShell.cpp
layout/forms/nsRangeFrame.cpp
layout/generic/nsFrame.cpp
layout/xul/nsResizerFrame.cpp
layout/xul/nsSliderFrame.cpp
widget/BasicEvents.h
widget/TouchEvents.h
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -4265,17 +4265,17 @@ HTMLInputElement::PostHandleEvent(EventC
 
 void
 HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
 {
   MOZ_ASSERT(mType == NS_FORM_INPUT_RANGE);
 
   if (nsEventStatus_eConsumeNoDefault == aVisitor.mEventStatus ||
       !(aVisitor.mEvent->mClass == eMouseEventClass ||
-        aVisitor.mEvent->mClass == NS_TOUCH_EVENT ||
+        aVisitor.mEvent->mClass == eTouchEventClass ||
         aVisitor.mEvent->mClass == eKeyboardEventClass)) {
     return;
   }
 
   nsRangeFrame* rangeFrame = do_QueryFrame(GetPrimaryFrame());
   if (!rangeFrame && mIsDraggingRange) {
     CancelRangeThumbDrag();
     return;
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -735,17 +735,17 @@ Event::GetEventPopupControlState(WidgetE
       case NS_KEY_DOWN :
         if (PopupAllowedForEvent("keydown")) {
           abuse = openControlled;
         }
         break;
       }
     }
     break;
-  case NS_TOUCH_EVENT :
+  case eTouchEventClass:
     if (aEvent->mFlags.mIsTrusted) {
       switch (aEvent->message) {
       case NS_TOUCH_START :
         if (PopupAllowedForEvent("touchstart")) {
           abuse = openControlled;
         }
         break;
       case NS_TOUCH_END :
@@ -846,17 +846,17 @@ Event::GetScreenCoords(nsPresContext* aP
     return EventStateManager::sLastScreenPoint;
   }
 
   if (!aEvent || 
        (aEvent->mClass != eMouseEventClass &&
         aEvent->mClass != eMouseScrollEventClass &&
         aEvent->mClass != eWheelEventClass &&
         aEvent->mClass != ePointerEventClass &&
-        aEvent->mClass != NS_TOUCH_EVENT &&
+        aEvent->mClass != eTouchEventClass &&
         aEvent->mClass != eDragEventClass &&
         aEvent->mClass != eSimpleGestureEventClass)) {
     return nsIntPoint(0, 0);
   }
 
   WidgetGUIEvent* guiEvent = aEvent->AsGUIEvent();
   if (!guiEvent->widget) {
     return LayoutDeviceIntPoint::ToUntyped(aPoint);
@@ -901,17 +901,17 @@ Event::GetClientCoords(nsPresContext* aP
   if (EventStateManager::sIsPointerLocked) {
     return EventStateManager::sLastClientPoint;
   }
 
   if (!aEvent ||
       (aEvent->mClass != eMouseEventClass &&
        aEvent->mClass != eMouseScrollEventClass &&
        aEvent->mClass != eWheelEventClass &&
-       aEvent->mClass != NS_TOUCH_EVENT &&
+       aEvent->mClass != eTouchEventClass &&
        aEvent->mClass != eDragEventClass &&
        aEvent->mClass != ePointerEventClass &&
        aEvent->mClass != eSimpleGestureEventClass) ||
       !aPresContext ||
       !aEvent->AsGUIEvent()->widget) {
     return aDefaultPoint;
   }
 
--- a/dom/events/EventDispatcher.cpp
+++ b/dom/events/EventDispatcher.cpp
@@ -736,17 +736,17 @@ EventDispatcher::CreateEvent(EventTarget
       return NS_NewDOMCommandEvent(aDOMEvent, aOwner, aPresContext,
                                    aEvent->AsCommandEvent());
     case eSimpleGestureEventClass:
       return NS_NewDOMSimpleGestureEvent(aDOMEvent, aOwner, aPresContext,
                                          aEvent->AsSimpleGestureEvent());
     case ePointerEventClass:
       return NS_NewDOMPointerEvent(aDOMEvent, aOwner, aPresContext,
                                    aEvent->AsPointerEvent());
-    case NS_TOUCH_EVENT:
+    case eTouchEventClass:
       return NS_NewDOMTouchEvent(aDOMEvent, aOwner, aPresContext,
                                  aEvent->AsTouchEvent());
     case NS_TRANSITION_EVENT:
       return NS_NewDOMTransitionEvent(aDOMEvent, aOwner, aPresContext,
                                       aEvent->AsTransitionEvent());
     case NS_ANIMATION_EVENT:
       return NS_NewDOMAnimationEvent(aDOMEvent, aOwner, aPresContext,
                                      aEvent->AsAnimationEvent());
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -545,29 +545,29 @@ WINDOW_ONLY_EVENT(moznetworkdownload,
                   NS_NETWORK_DOWNLOAD_EVENT,
                   EventNameType_None,
                   NS_EVENT)
 #endif // MOZ_B2G
 
 TOUCH_EVENT(touchstart,
             NS_TOUCH_START,
             EventNameType_All,
-            NS_TOUCH_EVENT)
+            eTouchEventClass)
 TOUCH_EVENT(touchend,
             NS_TOUCH_END,
             EventNameType_All,
-            NS_TOUCH_EVENT)
+            eTouchEventClass)
 TOUCH_EVENT(touchmove,
             NS_TOUCH_MOVE,
             EventNameType_All,
-            NS_TOUCH_EVENT )
+            eTouchEventClass )
 TOUCH_EVENT(touchcancel,
             NS_TOUCH_CANCEL,
             EventNameType_All,
-            NS_TOUCH_EVENT)
+            eTouchEventClass)
 
 DOCUMENT_ONLY_EVENT(readystatechange,
                     NS_READYSTATECHANGE,
                     EventNameType_HTMLXUL,
                     NS_EVENT)
 
 NON_IDL_EVENT(MozMouseHittest,
               NS_MOUSE_MOZHITTEST,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -1094,17 +1094,17 @@ EventStateManager::DispatchCrossProcessE
     return remote->SendRealMouseEvent(*aEvent->AsMouseEvent());
   }
   case eKeyboardEventClass: {
     return remote->SendRealKeyEvent(*aEvent->AsKeyboardEvent());
   }
   case eWheelEventClass: {
     return remote->SendMouseWheelEvent(*aEvent->AsWheelEvent());
   }
-  case NS_TOUCH_EVENT: {
+  case eTouchEventClass: {
     // Let the child process synthesize a mouse event if needed, and
     // ensure we don't synthesize one in this process.
     *aStatus = nsEventStatus_eConsumeNoDefault;
     return remote->SendRealTouchEvent(*aEvent->AsTouchEvent());
   }
   default: {
     MOZ_CRASH("Attempt to send non-whitelisted event?");
   }
@@ -1166,17 +1166,17 @@ CrossProcessSafeEvent(const WidgetEvent&
     case NS_MOUSE_BUTTON_UP:
     case NS_MOUSE_MOVE:
     case NS_CONTEXTMENU:
     case NS_MOUSE_EXIT:
       return true;
     default:
       return false;
     }
-  case NS_TOUCH_EVENT:
+  case eTouchEventClass:
     switch (aEvent.message) {
     case NS_TOUCH_START:
     case NS_TOUCH_MOVE:
     case NS_TOUCH_END:
     case NS_TOUCH_CANCEL:
       return true;
     default:
       return false;
@@ -1195,17 +1195,17 @@ EventStateManager::HandleCrossProcessEve
     return false;
   }
 
   // Collect the remote event targets we're going to forward this
   // event to.
   //
   // NB: the elements of |targets| must be unique, for correctness.
   nsAutoTArray<nsCOMPtr<nsIContent>, 1> targets;
-  if (aEvent->mClass != NS_TOUCH_EVENT ||
+  if (aEvent->mClass != eTouchEventClass ||
       aEvent->message == NS_TOUCH_START) {
     // If this event only has one target, and it's remote, add it to
     // the array.
     nsIFrame* frame = GetEventTarget();
     nsIContent* target = frame ? frame->GetContent() : nullptr;
     if (IsRemoteTarget(target)) {
       targets.AppendElement(target);
     }
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -295,17 +295,17 @@ UIEvent::SetCancelBubble(bool aCancelBub
 nsIntPoint
 UIEvent::GetLayerPoint() const
 {
   if (!mEvent ||
       (mEvent->mClass != eMouseEventClass &&
        mEvent->mClass != eMouseScrollEventClass &&
        mEvent->mClass != eWheelEventClass &&
        mEvent->mClass != ePointerEventClass &&
-       mEvent->mClass != NS_TOUCH_EVENT &&
+       mEvent->mClass != eTouchEventClass &&
        mEvent->mClass != eDragEventClass &&
        mEvent->mClass != eSimpleGestureEventClass) ||
       !mPresContext ||
       mEventIsInternal) {
     return mLayerPoint;
   }
   // XXX I'm not really sure this is correct; it's my best shot, though
   nsIFrame* targetFrame = mPresContext->EventStateManager()->GetEventTarget();
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -774,17 +774,17 @@ TabParent::MapEventCoordinatesForChildPr
   MapEventCoordinatesForChildProcess(offset, aEvent);
   return true;
 }
 
 void
 TabParent::MapEventCoordinatesForChildProcess(
   const LayoutDeviceIntPoint& aOffset, WidgetEvent* aEvent)
 {
-  if (aEvent->mClass != NS_TOUCH_EVENT) {
+  if (aEvent->mClass != eTouchEventClass) {
     aEvent->refPoint = aOffset;
   } else {
     aEvent->refPoint = LayoutDeviceIntPoint();
     // Then offset all the touch points by that distance, to put them
     // in the space where top-left is 0,0.
     const WidgetTouchEvent::TouchArray& touches =
       aEvent->AsTouchEvent()->touches;
     for (uint32_t i = 0; i < touches.Length(); ++i) {
@@ -1010,17 +1010,17 @@ TabParent::GetEventCapturer()
   return sEventCapturer;
 }
 
 bool
 TabParent::TryCapture(const WidgetGUIEvent& aEvent)
 {
   MOZ_ASSERT(sEventCapturer == this && mEventCaptureDepth > 0);
 
-  if (aEvent.mClass != NS_TOUCH_EVENT) {
+  if (aEvent.mClass != eTouchEventClass) {
     // Only capture of touch events is implemented, for now.
     return false;
   }
 
   WidgetTouchEvent event(*aEvent.AsTouchEvent());
 
   bool isTouchPointUp = (event.message == NS_TOUCH_END ||
                          event.message == NS_TOUCH_CANCEL);
@@ -2077,17 +2077,17 @@ TabParent::InjectTouchEvent(const nsAStr
                             uint32_t* aRxs,
                             uint32_t* aRys,
                             float* aRotationAngles,
                             float* aForces,
                             uint32_t aCount,
                             int32_t aModifiers)
 {
   uint32_t msg;
-  nsContentUtils::GetEventIdAndAtom(aType, NS_TOUCH_EVENT, &msg);
+  nsContentUtils::GetEventIdAndAtom(aType, eTouchEventClass, &msg);
   if (msg != NS_TOUCH_START && msg != NS_TOUCH_MOVE &&
       msg != NS_TOUCH_END && msg != NS_TOUCH_CANCEL) {
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     return NS_ERROR_FAILURE;
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -689,17 +689,17 @@ APZCTreeManager::ReceiveInputEvent(Widge
 {
   // This function will be removed as part of bug 930939.
   // In general it is preferable to use the version of ReceiveInputEvent
   // that takes an InputData, as that is usable from off-main-thread.
 
   MOZ_ASSERT(NS_IsMainThread());
 
   switch (aEvent.mClass) {
-    case NS_TOUCH_EVENT: {
+    case eTouchEventClass: {
       WidgetTouchEvent& touchEvent = *aEvent.AsTouchEvent();
       MultiTouchInput touchInput(touchEvent);
       nsEventStatus result = ProcessTouchInput(touchInput, aOutTargetGuid);
       // touchInput was modified in-place to possibly remove some
       // touch points (if we are overscrolled), and the coordinates were
       // modified using the APZ untransform. We need to copy these changes
       // back into the WidgetInputEvent.
       touchEvent.touches.Clear();
--- a/layout/base/PositionedEventTargeting.cpp
+++ b/layout/base/PositionedEventTargeting.cpp
@@ -73,17 +73,17 @@ struct EventRadiusPrefs
 static EventRadiusPrefs sMouseEventRadiusPrefs;
 static EventRadiusPrefs sTouchEventRadiusPrefs;
 
 static const EventRadiusPrefs*
 GetPrefsFor(EventClassID aEventClassID)
 {
   EventRadiusPrefs* prefs = nullptr;
   const char* prefBranch = nullptr;
-  if (aEventClassID == NS_TOUCH_EVENT) {
+  if (aEventClassID == eTouchEventClass) {
     prefBranch = "touch";
     prefs = &sTouchEventRadiusPrefs;
   } else if (aEventClassID == eMouseEventClass) {
     // Mostly for testing purposes
     prefBranch = "mouse";
     prefs = &sMouseEventRadiusPrefs;
   } else {
     return nullptr;
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1871,17 +1871,17 @@ nsLayoutUtils::GetEventCoordinatesRelati
 {
   if (!aEvent || (aEvent->mClass != eMouseEventClass &&
                   aEvent->mClass != eMouseScrollEventClass &&
                   aEvent->mClass != eWheelEventClass &&
                   aEvent->mClass != eDragEventClass &&
                   aEvent->mClass != eSimpleGestureEventClass &&
                   aEvent->mClass != ePointerEventClass &&
                   aEvent->mClass != eGestureNotifyEventClass &&
-                  aEvent->mClass != NS_TOUCH_EVENT &&
+                  aEvent->mClass != eTouchEventClass &&
                   aEvent->mClass != eQueryContentEventClass))
     return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
 
   return GetEventCoordinatesRelativeTo(aEvent,
            LayoutDeviceIntPoint::ToUntyped(aEvent->AsGUIEvent()->refPoint),
            aFrame);
 }
 
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -6731,17 +6731,17 @@ DispatchPointerFromMouseOrTouch(PresShel
     WidgetPointerEvent event(*mouseEvent);
     event.message = pointerMessage;
     event.button = button;
     event.pressure = event.buttons ?
                      mouseEvent->pressure ? mouseEvent->pressure : 0.5f :
                      0.0f;
     event.convertToPointer = mouseEvent->convertToPointer = false;
     aShell->HandleEvent(aFrame, &event, aDontRetargetEvents, aStatus);
-  } else if (aEvent->mClass == NS_TOUCH_EVENT) {
+  } else if (aEvent->mClass == eTouchEventClass) {
     WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
     // loop over all touches and dispatch pointer events on each touch
     // copy the event
     switch (touchEvent->message) {
     case NS_TOUCH_MOVE:
       pointerMessage = NS_POINTER_MOVE;
       break;
     case NS_TOUCH_END:
@@ -6922,17 +6922,17 @@ PresShell::HandleEvent(nsIFrame* aFrame,
       retargetEventDoc = window->GetExtantDoc();
       if (!retargetEventDoc)
         return NS_OK;
     } else if (capturingContent) {
       // if the mouse is being captured then retarget the mouse event at the
       // document that is being captured.
       retargetEventDoc = capturingContent->GetCrossShadowCurrentDoc();
 #ifdef ANDROID
-    } else if (aEvent->mClass == NS_TOUCH_EVENT) {
+    } else if (aEvent->mClass == eTouchEventClass) {
       retargetEventDoc = GetTouchEventTargetDocument();
 #endif
     }
 
     if (retargetEventDoc) {
       nsCOMPtr<nsIPresShell> presShell = retargetEventDoc->GetShell();
       if (!presShell)
         return NS_OK;
@@ -6970,17 +6970,17 @@ PresShell::HandleEvent(nsIFrame* aFrame,
     return NS_OK;
   }
 
   nsIFrame* frame = aFrame;
 
   if (aEvent->IsUsingCoordinates()) {
     ReleasePointerCaptureCaller releasePointerCaptureCaller;
     if (nsLayoutUtils::AreAsyncAnimationsEnabled() && mDocument) {
-      if (aEvent->mClass == NS_TOUCH_EVENT) {
+      if (aEvent->mClass == eTouchEventClass) {
         nsIDocument::UnlockPointer();
       }
 
       {  // scope for scriptBlocker.
         nsAutoScriptBlocker scriptBlocker;
         GetRootPresShell()->GetDocument()->
           EnumerateSubDocuments(FlushThrottledStyles, nullptr);
       }
@@ -7051,17 +7051,17 @@ PresShell::HandleEvent(nsIFrame* aFrame,
       }
       else {
         ClearMouseCapture(nullptr);
         capturingContent = nullptr;
       }
     }
 
     // all touch events except for touchstart use a captured target
-    if (aEvent->mClass == NS_TOUCH_EVENT &&
+    if (aEvent->mClass == eTouchEventClass &&
         aEvent->message != NS_TOUCH_START) {
       captureRetarget = true;
     }
 
     WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
     bool isWindowLevelMouseExit = (aEvent->message == NS_MOUSE_EXIT) &&
       (mouseEvent && mouseEvent->exit == WidgetMouseEvent::eTopLevel);
 
@@ -7757,17 +7757,17 @@ PresShell::HandleEventInternal(WidgetEve
         nsContentUtils::IsHandlingKeyBoardEvent();
       if (aEvent->mClass == eKeyboardEventClass) {
         nsContentUtils::SetIsHandlingKeyBoardEvent(true);
       }
       if (aEvent->IsAllowedToDispatchDOMEvent()) {
         MOZ_ASSERT(nsContentUtils::IsSafeToRunScript(),
           "Somebody changed aEvent to cause a DOM event!");
         nsPresShellEventCB eventCB(this);
-        if (aEvent->mClass == NS_TOUCH_EVENT) {
+        if (aEvent->mClass == eTouchEventClass) {
           DispatchTouchEvent(aEvent, aStatus, &eventCB, touchIsNew);
         } else {
           nsCOMPtr<nsINode> eventTarget = mCurrentEventContent.get();
           nsPresShellEventCB* eventCBPtr = &eventCB;
           if (!eventTarget) {
             nsCOMPtr<nsIContent> targetContent;
             if (mCurrentEventFrame) {
               rv = mCurrentEventFrame->
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -462,17 +462,17 @@ nsRangeFrame::GetValueAsFractionOfRange(
   
   return ((value - minimum) / (maximum - minimum)).toDouble();
 }
 
 Decimal
 nsRangeFrame::GetValueAtEventPoint(WidgetGUIEvent* aEvent)
 {
   MOZ_ASSERT(aEvent->mClass == eMouseEventClass ||
-             aEvent->mClass == NS_TOUCH_EVENT,
+             aEvent->mClass == eTouchEventClass,
              "Unexpected event type - aEvent->refPoint may be meaningless");
 
   MOZ_ASSERT(mContent->IsHTML(nsGkAtoms::input), "bad cast");
   dom::HTMLInputElement* input = static_cast<dom::HTMLInputElement*>(mContent);
 
   MOZ_ASSERT(input->GetType() == NS_FORM_INPUT_RANGE);
 
   Decimal minimum = input->GetMinimum();
@@ -480,17 +480,17 @@ nsRangeFrame::GetValueAtEventPoint(Widge
   MOZ_ASSERT(minimum.isFinite() && maximum.isFinite(),
              "type=range should have a default maximum/minimum");
   if (maximum <= minimum) {
     return minimum;
   }
   Decimal range = maximum - minimum;
 
   LayoutDeviceIntPoint absPoint;
-  if (aEvent->mClass == NS_TOUCH_EVENT) {
+  if (aEvent->mClass == eTouchEventClass) {
     MOZ_ASSERT(aEvent->AsTouchEvent()->touches.Length() == 1,
                "Unexpected number of touches");
     absPoint = LayoutDeviceIntPoint::FromUntyped(
       aEvent->AsTouchEvent()->touches[0]->mRefPoint);
   } else {
     absPoint = aEvent->refPoint;
   }
   nsPoint point =
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2462,17 +2462,17 @@ nsFrame::HandleEvent(nsPresContext* aPre
   if (aEvent->message == NS_MOUSE_MOVE) {
     // XXX If the second argument of HandleDrag() is WidgetMouseEvent,
     //     the implementation becomes simpler.
     return HandleDrag(aPresContext, aEvent, aEventStatus);
   }
 
   if ((aEvent->mClass == eMouseEventClass &&
        aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
-      aEvent->mClass == NS_TOUCH_EVENT) {
+      aEvent->mClass == eTouchEventClass) {
     if (aEvent->message == NS_MOUSE_BUTTON_DOWN || aEvent->message == NS_TOUCH_START) {
       HandlePress(aPresContext, aEvent, aEventStatus);
     } else if (aEvent->message == NS_MOUSE_BUTTON_UP || aEvent->message == NS_TOUCH_END) {
       HandleRelease(aPresContext, aEvent, aEventStatus);
     }
   }
   return NS_OK;
 }
@@ -2674,17 +2674,17 @@ nsFrame::HandlePress(nsPresContext* aPre
                      nsEventStatus* aEventStatus)
 {
   NS_ENSURE_ARG_POINTER(aEventStatus);
   if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
     return NS_OK;
   }
 
   NS_ENSURE_ARG_POINTER(aEvent);
-  if (aEvent->mClass == NS_TOUCH_EVENT) {
+  if (aEvent->mClass == eTouchEventClass) {
     return NS_OK;
   }
 
   //We often get out of sync state issues with mousedown events that
   //get interrupted by alerts/dialogs.
   //Check with the ESM to see if we should process this one
   if (!aPresContext->EventStateManager()->EventStatusOK(aEvent)) 
     return NS_OK;
--- a/layout/xul/nsResizerFrame.cpp
+++ b/layout/xul/nsResizerFrame.cpp
@@ -59,17 +59,17 @@ nsResizerFrame::HandleEvent(nsPresContex
   }
 
   nsWeakFrame weakFrame(this);
   bool doDefault = true;
 
   switch (aEvent->message) {
     case NS_TOUCH_START:
     case NS_MOUSE_BUTTON_DOWN: {
-      if (aEvent->mClass == NS_TOUCH_EVENT ||
+      if (aEvent->mClass == eTouchEventClass ||
           (aEvent->mClass == eMouseEventClass &&
            aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton)) {
         nsCOMPtr<nsIBaseWindow> window;
         nsIPresShell* presShell = aPresContext->GetPresShell();
         nsIContent* contentToResize =
           GetContentToResize(presShell, getter_AddRefs(window));
         if (contentToResize) {
           nsIFrame* frameToResize = contentToResize->GetPrimaryFrame();
@@ -124,17 +124,17 @@ nsResizerFrame::HandleEvent(nsPresContex
 
         nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED);
       }
     }
     break;
 
   case NS_TOUCH_END:
   case NS_MOUSE_BUTTON_UP: {
-    if (aEvent->mClass == NS_TOUCH_EVENT ||
+    if (aEvent->mClass == eTouchEventClass ||
         (aEvent->mClass == eMouseEventClass &&
          aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton)) {
       // we're done tracking.
       mTrackingMouseMove = false;
 
       nsIPresShell::SetCapturingContent(nullptr, 0);
 
       doDefault = false;
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -465,17 +465,17 @@ nsSliderFrame::HandleEvent(nsPresContext
         else {
           // vertical scrollbar - check if mouse is left or right of thumb
           if (eventPoint.x < -gSnapMultiplier * thumbSize.width ||
               eventPoint.x > thumbSize.width +
                                gSnapMultiplier * thumbSize.width)
             isMouseOutsideThumb = true;
         }
       }
-      if (aEvent->mClass == NS_TOUCH_EVENT) {
+      if (aEvent->mClass == eTouchEventClass) {
         *aEventStatus = nsEventStatus_eConsumeNoDefault;
       }
       if (isMouseOutsideThumb)
       {
         SetCurrentThumbPosition(scrollbar, mThumbStart, false, false);
         return NS_OK;
       }
 
@@ -518,17 +518,17 @@ nsSliderFrame::HandleEvent(nsPresContext
 
     // set it
     nsWeakFrame weakFrame(this);
     // should aMaySnap be true here?
     SetCurrentThumbPosition(scrollbar, pos - thumbLength/2, false, false);
     NS_ENSURE_TRUE(weakFrame.IsAlive(), NS_OK);
 
     DragThumb(true);
-    if (aEvent->mClass == NS_TOUCH_EVENT) {
+    if (aEvent->mClass == eTouchEventClass) {
       *aEventStatus = nsEventStatus_eConsumeNoDefault;
     }
 
     if (isHorizontal)
       mThumbStart = thumbFrame->GetPosition().x;
     else
       mThumbStart = thumbFrame->GetPosition().y;
 
--- a/widget/BasicEvents.h
+++ b/widget/BasicEvents.h
@@ -44,17 +44,17 @@ enum EventClassID MOZ_ENUM_TYPE(EventCla
   eDragEventClass,                   // WidgetDragEvent
   eMouseScrollEventClass,            // WidgetMouseScrollEvent
   eWheelEventClass,                  // WidgetWheelEvent
   ePointerEventClass,                // PointerEvent
 
   // TouchEvents.h
   eGestureNotifyEventClass,          // WidgetGestureNotifyEvent
   eSimpleGestureEventClass,          // WidgetSimpleGestureEvent
-  NS_TOUCH_EVENT,                    // WidgetTouchEvent
+  eTouchEventClass,                  // WidgetTouchEvent
 
   // ContentEvents.h
   NS_SCROLLPORT_EVENT,               // InternalScrollPortEvent
   NS_SCROLLAREA_EVENT,               // InternalScrollAreaEvent
   NS_FORM_EVENT,                     // InternalFormEvent
   NS_FOCUS_EVENT,                    // InternalFocusEvent
   NS_CLIPBOARD_EVENT,                // InternalClipboardEvent
   NS_TRANSITION_EVENT,               // InternalTransitionEvent
--- a/widget/TouchEvents.h
+++ b/widget/TouchEvents.h
@@ -160,43 +160,43 @@ public:
   typedef nsAutoTArray<nsRefPtr<mozilla::dom::Touch>, 10> AutoTouchArray;
 
   virtual WidgetTouchEvent* AsTouchEvent() MOZ_OVERRIDE { return this; }
 
   WidgetTouchEvent()
   {
   }
 
-  WidgetTouchEvent(const WidgetTouchEvent& aOther) :
-    WidgetInputEvent(aOther.mFlags.mIsTrusted, aOther.message, aOther.widget,
-                     NS_TOUCH_EVENT)
+  WidgetTouchEvent(const WidgetTouchEvent& aOther)
+    : WidgetInputEvent(aOther.mFlags.mIsTrusted, aOther.message, aOther.widget,
+                       eTouchEventClass)
   {
     modifiers = aOther.modifiers;
     time = aOther.time;
     timeStamp = aOther.timeStamp;
     touches.AppendElements(aOther.touches);
     mFlags.mCancelable = message != NS_TOUCH_CANCEL;
     MOZ_COUNT_CTOR(WidgetTouchEvent);
   }
 
-  WidgetTouchEvent(bool aIsTrusted, uint32_t aMessage, nsIWidget* aWidget) :
-    WidgetInputEvent(aIsTrusted, aMessage, aWidget, NS_TOUCH_EVENT)
+  WidgetTouchEvent(bool aIsTrusted, uint32_t aMessage, nsIWidget* aWidget)
+    : WidgetInputEvent(aIsTrusted, aMessage, aWidget, eTouchEventClass)
   {
     MOZ_COUNT_CTOR(WidgetTouchEvent);
     mFlags.mCancelable = message != NS_TOUCH_CANCEL;
   }
 
   virtual ~WidgetTouchEvent()
   {
     MOZ_COUNT_DTOR(WidgetTouchEvent);
   }
 
   virtual WidgetEvent* Duplicate() const MOZ_OVERRIDE
   {
-    MOZ_ASSERT(mClass == NS_TOUCH_EVENT,
+    MOZ_ASSERT(mClass == eTouchEventClass,
                "Duplicate() must be overridden by sub class");
     // Not copying widget, it is a weak reference.
     WidgetTouchEvent* result = new WidgetTouchEvent(false, message, nullptr);
     result->AssignTouchEventData(*this, true);
     result->mFlags = mFlags;
     return result;
   }