Bug 920377 part.11 Get rid of nsScrollPortEvent r=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 27 Sep 2013 15:20:56 +0900
changeset 162770 299f2671ffc5a085d5c68609460337e52fcb209e
parent 162769 bd82d2c60f4654055505f012ce8fbc0b8ef7c953
child 162771 45f2e3fce2c1141daac7e878197462ce8d234c17
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.11 Get rid of nsScrollPortEvent r=roc
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMUIEvent.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
widget/ContentEvents.h
widget/EventForwards.h
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -614,20 +614,20 @@ nsDOMEvent::DuplicatePrivateData()
       WheelEvent* oldWheelEvent = static_cast<WheelEvent*>(mEvent);
       WheelEvent* wheelEvent = new WheelEvent(false, msg, nullptr);
       wheelEvent->AssignWheelEventData(*oldWheelEvent, true);
       newEvent = wheelEvent;
       break;
     }
     case NS_SCROLLPORT_EVENT:
     {
-      nsScrollPortEvent* oldScrollPortEvent =
-        static_cast<nsScrollPortEvent*>(mEvent);
-      nsScrollPortEvent* scrollPortEvent =
-        new nsScrollPortEvent(false, msg, nullptr);
+      InternalScrollPortEvent* oldScrollPortEvent =
+        static_cast<InternalScrollPortEvent*>(mEvent);
+      InternalScrollPortEvent* scrollPortEvent =
+        new InternalScrollPortEvent(false, msg, nullptr);
       scrollPortEvent->AssignScrollPortEventData(*oldScrollPortEvent, true);
       newEvent = scrollPortEvent;
       break;
     }
     case NS_SCROLLAREA_EVENT:
     {
       InternalScrollAreaEvent* oldScrollAreaEvent =
         static_cast<InternalScrollAreaEvent*>(mEvent);
--- a/content/events/src/nsDOMUIEvent.cpp
+++ b/content/events/src/nsDOMUIEvent.cpp
@@ -47,17 +47,18 @@ nsDOMUIEvent::nsDOMUIEvent(mozilla::dom:
     {
       nsUIEvent *event = static_cast<nsUIEvent*>(mEvent);
       mDetail = event->detail;
       break;
     }
 
     case NS_SCROLLPORT_EVENT:
     {
-      nsScrollPortEvent* scrollEvent = static_cast<nsScrollPortEvent*>(mEvent);
+      InternalScrollPortEvent* scrollEvent =
+        static_cast<InternalScrollPortEvent*>(mEvent);
       mDetail = (int32_t)scrollEvent->orient;
       break;
     }
 
     default:
       mDetail = 0;
       break;
   }
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2748,42 +2748,41 @@ nsGfxScrollFrameInner::FireScrollPortEve
   if (!vertChanged && !horizChanged) {
     return NS_OK;
   }
 
   // If both either overflowed or underflowed then we dispatch only one
   // DOM event.
   bool both = vertChanged && horizChanged &&
                 newVerticalOverflow == newHorizontalOverflow;
-  nsScrollPortEvent::orientType orient;
+  InternalScrollPortEvent::orientType orient;
   if (both) {
-    orient = nsScrollPortEvent::both;
+    orient = InternalScrollPortEvent::both;
     mHorizontalOverflow = newHorizontalOverflow;
     mVerticalOverflow = newVerticalOverflow;
   }
   else if (vertChanged) {
-    orient = nsScrollPortEvent::vertical;
+    orient = InternalScrollPortEvent::vertical;
     mVerticalOverflow = newVerticalOverflow;
     if (horizChanged) {
       // We need to dispatch a separate horizontal DOM event. Do that the next
       // time around since dispatching the vertical DOM event might destroy
       // the frame.
       PostOverflowEvent();
     }
   }
   else {
-    orient = nsScrollPortEvent::horizontal;
+    orient = InternalScrollPortEvent::horizontal;
     mHorizontalOverflow = newHorizontalOverflow;
   }
 
-  nsScrollPortEvent event(true,
-                          (orient == nsScrollPortEvent::horizontal ?
-                           mHorizontalOverflow : mVerticalOverflow) ?
-                            NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW,
-                          nullptr);
+  InternalScrollPortEvent event(true,
+    (orient == InternalScrollPortEvent::horizontal ? mHorizontalOverflow :
+                                                     mVerticalOverflow) ?
+    NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW, nullptr);
   event.orient = orient;
   return nsEventDispatcher::Dispatch(mOuter->GetContent(),
                                      mOuter->PresContext(), &event);
 }
 
 void
 nsGfxScrollFrameInner::ReloadChildFrames()
 {
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -921,27 +921,28 @@ nsTreeBodyFrame::CheckOverflow(const Scr
 
   nsWeakFrame weakFrame(this);
 
   nsRefPtr<nsPresContext> presContext = PresContext();
   nsCOMPtr<nsIPresShell> presShell = presContext->GetPresShell();
   nsCOMPtr<nsIContent> content = mContent;
 
   if (verticalOverflowChanged) {
-    nsScrollPortEvent event(true, mVerticalOverflow ? NS_SCROLLPORT_OVERFLOW
-                            : NS_SCROLLPORT_UNDERFLOW, nullptr);
-    event.orient = nsScrollPortEvent::vertical;
+    InternalScrollPortEvent event(true,
+      mVerticalOverflow ? NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW,
+      nullptr);
+    event.orient = InternalScrollPortEvent::vertical;
     nsEventDispatcher::Dispatch(content, presContext, &event);
   }
 
   if (horizontalOverflowChanged) {
-    nsScrollPortEvent event(true,
-                            mHorizontalOverflow ? NS_SCROLLPORT_OVERFLOW
-                            : NS_SCROLLPORT_UNDERFLOW, nullptr);
-    event.orient = nsScrollPortEvent::horizontal;
+    InternalScrollPortEvent event(true,
+      mHorizontalOverflow ? NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW,
+      nullptr);
+    event.orient = InternalScrollPortEvent::horizontal;
     nsEventDispatcher::Dispatch(content, presContext, &event);
   }
 
   // The synchronous event dispatch above can trigger reflow notifications.
   // Flush those explicitly now, so that we can guard against potential infinite
   // recursion. See bug 905909.
   if (!weakFrame.IsAlive()) {
     return;
--- a/widget/ContentEvents.h
+++ b/widget/ContentEvents.h
@@ -244,11 +244,10 @@ public:
     // with the constructor.
   }
 };
 
 } // namespace mozilla
 
 // TODO: Remove following typedefs
 typedef mozilla::InternalScriptErrorEvent nsScriptErrorEvent;
-typedef mozilla::InternalScrollPortEvent  nsScrollPortEvent;
 
 #endif // mozilla_ContentEvents_h__
--- a/widget/EventForwards.h
+++ b/widget/EventForwards.h
@@ -124,11 +124,10 @@ typedef mozilla::WidgetMouseScrollEvent 
 namespace mozilla {
 typedef WidgetWheelEvent                   WheelEvent;
 }
 
 typedef mozilla::WidgetGestureNotifyEvent  nsGestureNotifyEvent;
 typedef mozilla::WidgetSimpleGestureEvent  nsSimpleGestureEvent;
 typedef mozilla::WidgetTouchEvent          nsTouchEvent;
 typedef mozilla::InternalScriptErrorEvent  nsScriptErrorEvent;
-typedef mozilla::InternalScrollPortEvent   nsScrollPortEvent;
 
 #endif // mozilla_EventForwards_h__