Bug 920377 part.29 Get rid of nsMouseScrollEvent r=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 01 Oct 2013 16:23:02 +0900
changeset 163253 58a39673d3d70aaecf49c3b9f2d2ce29e2e13b7f
parent 163252 94b92dd29c9f8fcb638bb211644d1175f831f890
child 163254 f550869d86bc6e7b3733fc33d49ca952f6e50af7
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs920377
milestone27.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 920377 part.29 Get rid of nsMouseScrollEvent r=roc
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMMouseEvent.cpp
content/events/src/nsDOMMouseScrollEvent.cpp
content/events/src/nsEventStateManager.cpp
dom/ipc/PBrowser.ipdl
widget/EventForwards.h
widget/MouseEvents.h
widget/cocoa/nsChildView.mm
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -600,20 +600,20 @@ nsDOMEvent::DuplicatePrivateData()
       WidgetCompositionEvent* oldCompositionEvent =
         static_cast<WidgetCompositionEvent*>(mEvent);
       compositionEvent->AssignCompositionEventData(*oldCompositionEvent, true);
       newEvent = compositionEvent;
       break;
     }
     case NS_MOUSE_SCROLL_EVENT:
     {
-      nsMouseScrollEvent* oldMouseScrollEvent =
-        static_cast<nsMouseScrollEvent*>(mEvent);
-      nsMouseScrollEvent* mouseScrollEvent =
-        new nsMouseScrollEvent(false, msg, nullptr);
+      WidgetMouseScrollEvent* oldMouseScrollEvent =
+        static_cast<WidgetMouseScrollEvent*>(mEvent);
+      WidgetMouseScrollEvent* mouseScrollEvent =
+        new WidgetMouseScrollEvent(false, msg, nullptr);
       mouseScrollEvent->AssignMouseScrollEventData(*oldMouseScrollEvent, true);
       newEvent = mouseScrollEvent;
       break;
     }
     case NS_WHEEL_EVENT:
     {
       WheelEvent* oldWheelEvent = static_cast<WheelEvent*>(mEvent);
       WheelEvent* wheelEvent = new WheelEvent(false, msg, nullptr);
--- a/content/events/src/nsDOMMouseEvent.cpp
+++ b/content/events/src/nsDOMMouseEvent.cpp
@@ -13,17 +13,17 @@ using namespace mozilla;
 
 nsDOMMouseEvent::nsDOMMouseEvent(mozilla::dom::EventTarget* aOwner,
                                  nsPresContext* aPresContext,
                                  WidgetInputEvent* aEvent)
   : nsDOMUIEvent(aOwner, aPresContext, aEvent ? aEvent :
                  new nsMouseEvent(false, 0, nullptr,
                                   nsMouseEvent::eReal))
 {
-  // There's no way to make this class' ctor allocate an nsMouseScrollEvent.
+  // 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.
   
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
--- a/content/events/src/nsDOMMouseScrollEvent.cpp
+++ b/content/events/src/nsDOMMouseScrollEvent.cpp
@@ -8,39 +8,40 @@
 #include "mozilla/MouseEvents.h"
 
 using namespace mozilla;
 
 nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
                                              nsPresContext* aPresContext,
                                              WidgetInputEvent* aEvent)
   : nsDOMMouseEvent(aOwner, aPresContext,
-                    aEvent ? aEvent : new nsMouseScrollEvent(false, 0, nullptr))
+                    aEvent ? aEvent :
+                             new WidgetMouseScrollEvent(false, 0, nullptr))
 {
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
     mEvent->refPoint.x = mEvent->refPoint.y = 0;
     static_cast<nsMouseEvent*>(mEvent)->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 
   if(mEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
-    mDetail = static_cast<nsMouseScrollEvent*>(mEvent)->delta;
+    mDetail = static_cast<WidgetMouseScrollEvent*>(mEvent)->delta;
   }
 }
 
 nsDOMMouseScrollEvent::~nsDOMMouseScrollEvent()
 {
   if (mEventIsInternal && mEvent) {
     switch (mEvent->eventStructType)
     {
       case NS_MOUSE_SCROLL_EVENT:
-        delete static_cast<nsMouseScrollEvent*>(mEvent);
+        delete static_cast<WidgetMouseScrollEvent*>(mEvent);
         break;
       default:
         delete mEvent;
         break;
     }
     mEvent = nullptr;
   }
 }
@@ -61,17 +62,17 @@ nsDOMMouseScrollEvent::InitMouseScrollEv
                                 int32_t aAxis)
 {
   nsresult rv = nsDOMMouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable, aView, aDetail,
                                                 aScreenX, aScreenY, aClientX, aClientY, aCtrlKey,
                                                 aAltKey, aShiftKey, aMetaKey, aButton, aRelatedTarget);
   NS_ENSURE_SUCCESS(rv, rv);
   
   if (mEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
-    static_cast<nsMouseScrollEvent*>(mEvent)->isHorizontal =
+    static_cast<WidgetMouseScrollEvent*>(mEvent)->isHorizontal =
                                                 (aAxis == HORIZONTAL_AXIS);
   }
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
@@ -81,17 +82,17 @@ nsDOMMouseScrollEvent::GetAxis(int32_t* 
   *aResult = Axis();
   return NS_OK;
 }
 
 int32_t
 nsDOMMouseScrollEvent::Axis()
 {
   if (mEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
-    return static_cast<nsMouseScrollEvent*>(mEvent)->isHorizontal ?
+    return static_cast<WidgetMouseScrollEvent*>(mEvent)->isHorizontal ?
              static_cast<int32_t>(HORIZONTAL_AXIS) :
              static_cast<int32_t>(VERTICAL_AXIS);
   }
   return 0;
 }
 
 nsresult NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
                                    mozilla::dom::EventTarget* aOwner,
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -2473,18 +2473,18 @@ nsEventStateManager::SendLineScrollEvent
     targetContent = GetFocusedContent();
   if (!targetContent)
     return;
 
   while (targetContent->IsNodeOfType(nsINode::eTEXT)) {
     targetContent = targetContent->GetParent();
   }
 
-  nsMouseScrollEvent event(aEvent->mFlags.mIsTrusted, NS_MOUSE_SCROLL,
-                           aEvent->widget);
+  WidgetMouseScrollEvent event(aEvent->mFlags.mIsTrusted, NS_MOUSE_SCROLL,
+                               aEvent->widget);
   if (*aStatus == nsEventStatus_eConsumeNoDefault) {
     event.mFlags.mDefaultPrevented = true;
   }
   event.refPoint = aEvent->refPoint;
   event.widget = aEvent->widget;
   event.time = aEvent->time;
   event.modifiers = aEvent->modifiers;
   event.buttons = aEvent->buttons;
@@ -2509,18 +2509,18 @@ nsEventStateManager::SendPixelScrollEven
     if (!targetContent)
       return;
   }
 
   while (targetContent->IsNodeOfType(nsINode::eTEXT)) {
     targetContent = targetContent->GetParent();
   }
 
-  nsMouseScrollEvent event(aEvent->mFlags.mIsTrusted, NS_MOUSE_PIXEL_SCROLL,
-                           aEvent->widget);
+  WidgetMouseScrollEvent event(aEvent->mFlags.mIsTrusted, NS_MOUSE_PIXEL_SCROLL,
+                               aEvent->widget);
   if (*aStatus == nsEventStatus_eConsumeNoDefault) {
     event.mFlags.mDefaultPrevented = true;
   }
   event.refPoint = aEvent->refPoint;
   event.widget = aEvent->widget;
   event.time = aEvent->time;
   event.modifiers = aEvent->modifiers;
   event.buttons = aEvent->buttons;
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -38,17 +38,16 @@ using mozilla::WindowsHandle;
 using nscolor;
 using mozilla::WidgetCompositionEvent;
 using nsIMEUpdatePreference;
 using nsIntPoint;
 using nsIntRect;
 using nsIntSize;
 using mozilla::WidgetKeyboardEvent;
 using nsMouseEvent;
-using nsMouseScrollEvent;
 using mozilla::WheelEvent;
 using nsRect;
 using mozilla::WidgetSelectionEvent;
 using mozilla::WidgetTextEvent;
 using mozilla::WidgetTouchEvent;
 using RemoteDOMEvent;
 using mozilla::dom::ScreenOrientation;
 using mozilla::layers::TextureFactoryIdentifier;
--- a/widget/EventForwards.h
+++ b/widget/EventForwards.h
@@ -101,15 +101,14 @@ class WidgetPluginEvent;
 // MutationEvent.h (content/events/public)
 class InternalMutationEvent;
 } // namespace mozilla
 
 // TODO: Remove following typedefs
 typedef mozilla::WidgetEvent               nsEvent;
 typedef mozilla::WidgetGUIEvent            nsGUIEvent;
 typedef mozilla::WidgetMouseEvent          nsMouseEvent;
-typedef mozilla::WidgetMouseScrollEvent    nsMouseScrollEvent;
 
 namespace mozilla {
 typedef WidgetWheelEvent                   WheelEvent;
 }
 
 #endif // mozilla_EventForwards_h__
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -420,11 +420,10 @@ public:
 
 // TODO: Remove following typedef
 typedef WidgetWheelEvent                WheelEvent;
 
 } // namespace mozilla
 
 // TODO: Remove following typedefs
 typedef mozilla::WidgetMouseEvent       nsMouseEvent;
-typedef mozilla::WidgetMouseScrollEvent nsMouseScrollEvent;
 
 #endif // mozilla_MouseEvents_h__
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -4117,19 +4117,19 @@ NSEvent* gLastDragMouseDownEvent = nil;
   // Verify that this is a scroll wheel event with proper phase to be tracked
   // by the OS.
   if ([anEvent type] != NSScrollWheel || [anEvent phase] == NSEventPhaseNone) {
     return;
   }
 
   // Only initiate tracking if the user has tried to scroll past the edge of
   // the current page (as indicated by 'overflow' being non-zero).  Gecko only
-  // sets nsMouseScrollEvent.scrollOverflow when it's processing
+  // sets WidgetMouseScrollEvent.scrollOverflow when it's processing
   // NS_MOUSE_PIXEL_SCROLL events (not NS_MOUSE_SCROLL events).
-  // nsMouseScrollEvent.scrollOverflow only indicates left or right overflow
+  // WidgetMouseScrollEvent.scrollOverflow only indicates left or right overflow
   // for horizontal NS_MOUSE_PIXEL_SCROLL events.
   if (!overflow) {
     return;
   }
 
   CGFloat deltaX, deltaY;
   if ([anEvent hasPreciseScrollingDeltas]) {
     deltaX = [anEvent scrollingDeltaX];