Bug 975688 part.1 Rename DOMWheelEvent to WheelEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 26 Feb 2014 14:23:55 +0900
changeset 170621 d047b89102aa6cac60f7e0a8b8d8e4f6569b8428
parent 170620 89b4178ff5e7748ef7b9e0090081a235c9dc2352
child 170622 8fb9f057658a74bddf8d1711860d2cb406024bdd
push id26293
push usercbook@mozilla.com
push dateWed, 26 Feb 2014 11:47:28 +0000
treeherdermozilla-central@3513449fb9c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs975688
milestone30.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 975688 part.1 Rename DOMWheelEvent to WheelEvent r=smaug
dom/bindings/Bindings.conf
dom/events/DOMWheelEvent.cpp
dom/events/DOMWheelEvent.h
dom/events/WheelEvent.cpp
dom/events/WheelEvent.h
dom/events/moz.build
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1508,18 +1508,17 @@ DOMInterfaces = {
     'headerFile': 'WebGLVertexArray.h'
 },
 
 'WebSocket': {
     'headerFile': 'WebSocket.h',
 },
 
 'WheelEvent': {
-    'headerFile': 'DOMWheelEvent.h',
-    'nativeType': 'mozilla::dom::DOMWheelEvent',
+    'nativeType': 'mozilla::dom::WheelEvent',
 },
 
 'Window': {
     'nativeType': 'nsGlobalWindow',
     # When turning on Window, remember to drop the "'register': False"
     # from ChromeWindow.
     'hasXPConnectImpls': True,
     'register': False,
rename from dom/events/DOMWheelEvent.cpp
rename to dom/events/WheelEvent.cpp
--- a/dom/events/DOMWheelEvent.cpp
+++ b/dom/events/WheelEvent.cpp
@@ -1,62 +1,62 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "DOMWheelEvent.h"
+#include "mozilla/dom/WheelEvent.h"
 #include "mozilla/MouseEvents.h"
 #include "prtime.h"
 
 namespace mozilla {
 namespace dom {
 
-DOMWheelEvent::DOMWheelEvent(EventTarget* aOwner,
-                             nsPresContext* aPresContext,
-                             WidgetWheelEvent* aWheelEvent)
+WheelEvent::WheelEvent(EventTarget* aOwner,
+                       nsPresContext* aPresContext,
+                       WidgetWheelEvent* aWheelEvent)
   : nsDOMMouseEvent(aOwner, aPresContext,
                     aWheelEvent ? aWheelEvent :
                                   new WidgetWheelEvent(false, 0, nullptr))
 {
   if (aWheelEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
     mEvent->refPoint.x = mEvent->refPoint.y = 0;
     mEvent->AsWheelEvent()->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 }
 
-NS_IMPL_ADDREF_INHERITED(DOMWheelEvent, nsDOMMouseEvent)
-NS_IMPL_RELEASE_INHERITED(DOMWheelEvent, nsDOMMouseEvent)
+NS_IMPL_ADDREF_INHERITED(WheelEvent, nsDOMMouseEvent)
+NS_IMPL_RELEASE_INHERITED(WheelEvent, nsDOMMouseEvent)
 
-NS_INTERFACE_MAP_BEGIN(DOMWheelEvent)
+NS_INTERFACE_MAP_BEGIN(WheelEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMWheelEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
 
 NS_IMETHODIMP
-DOMWheelEvent::InitWheelEvent(const nsAString & aType,
-                              bool aCanBubble,
-                              bool aCancelable,
-                              nsIDOMWindow *aView,
-                              int32_t aDetail,
-                              int32_t aScreenX,
-                              int32_t aScreenY,
-                              int32_t aClientX,
-                              int32_t aClientY, 
-                              uint16_t aButton,
-                              nsIDOMEventTarget *aRelatedTarget,
-                              const nsAString& aModifiersList,
-                              double aDeltaX,
-                              double aDeltaY,
-                              double aDeltaZ,
-                              uint32_t aDeltaMode)
+WheelEvent::InitWheelEvent(const nsAString& aType,
+                           bool aCanBubble,
+                           bool aCancelable,
+                           nsIDOMWindow* aView,
+                           int32_t aDetail,
+                           int32_t aScreenX,
+                           int32_t aScreenY,
+                           int32_t aClientX,
+                           int32_t aClientY, 
+                           uint16_t aButton,
+                           nsIDOMEventTarget* aRelatedTarget,
+                           const nsAString& aModifiersList,
+                           double aDeltaX,
+                           double aDeltaY,
+                           double aDeltaZ,
+                           uint32_t aDeltaMode)
 {
   nsresult rv =
     nsDOMMouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable, aView,
                                     aDetail, aScreenX, aScreenY,
                                     aClientX, aClientY, aButton,
                                     aRelatedTarget, aModifiersList);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -65,68 +65,68 @@ DOMWheelEvent::InitWheelEvent(const nsAS
   wheelEvent->deltaY = aDeltaY;
   wheelEvent->deltaZ = aDeltaZ;
   wheelEvent->deltaMode = aDeltaMode;
 
   return NS_OK;
 }
 
 double
-DOMWheelEvent::DeltaX()
+WheelEvent::DeltaX()
 {
   return mEvent->AsWheelEvent()->deltaX;
 }
 
 NS_IMETHODIMP
-DOMWheelEvent::GetDeltaX(double* aDeltaX)
+WheelEvent::GetDeltaX(double* aDeltaX)
 {
   NS_ENSURE_ARG_POINTER(aDeltaX);
 
   *aDeltaX = DeltaX();
   return NS_OK;
 }
 
 double
-DOMWheelEvent::DeltaY()
+WheelEvent::DeltaY()
 {
   return mEvent->AsWheelEvent()->deltaY;
 }
 
 NS_IMETHODIMP
-DOMWheelEvent::GetDeltaY(double* aDeltaY)
+WheelEvent::GetDeltaY(double* aDeltaY)
 {
   NS_ENSURE_ARG_POINTER(aDeltaY);
 
   *aDeltaY = DeltaY();
   return NS_OK;
 }
 
 double
-DOMWheelEvent::DeltaZ()
+WheelEvent::DeltaZ()
 {
   return mEvent->AsWheelEvent()->deltaZ;
 }
 
 NS_IMETHODIMP
-DOMWheelEvent::GetDeltaZ(double* aDeltaZ)
+WheelEvent::GetDeltaZ(double* aDeltaZ)
 {
   NS_ENSURE_ARG_POINTER(aDeltaZ);
 
   *aDeltaZ = DeltaZ();
   return NS_OK;
 }
 
 uint32_t
-DOMWheelEvent::DeltaMode()
+WheelEvent::DeltaMode()
 {
   return mEvent->AsWheelEvent()->deltaMode;
 }
 
 NS_IMETHODIMP
-DOMWheelEvent::GetDeltaMode(uint32_t* aDeltaMode)
+WheelEvent::GetDeltaMode(uint32_t* aDeltaMode)
 {
   NS_ENSURE_ARG_POINTER(aDeltaMode);
 
   *aDeltaMode = DeltaMode();
   return NS_OK;
 }
 
 static void
@@ -151,24 +151,24 @@ GetModifierList(bool aCtrl, bool aShift,
   if (aMeta) {
     if (!aModifierList.IsEmpty()) {
       aModifierList.AppendLiteral(" ");
     }
     aModifierList.AppendLiteral(NS_DOM_KEYNAME_META);
   }
 }
 
-already_AddRefed<DOMWheelEvent>
-DOMWheelEvent::Constructor(const GlobalObject& aGlobal,
-                           const nsAString& aType,
-                           const WheelEventInit& aParam,
-                           mozilla::ErrorResult& aRv)
+already_AddRefed<WheelEvent>
+WheelEvent::Constructor(const GlobalObject& aGlobal,
+                        const nsAString& aType,
+                        const WheelEventInit& aParam,
+                        ErrorResult& aRv)
 {
   nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
-  nsRefPtr<DOMWheelEvent> e = new DOMWheelEvent(t, nullptr, nullptr);
+  nsRefPtr<WheelEvent> e = new WheelEvent(t, nullptr, nullptr);
   bool trusted = e->Init(t);
   nsAutoString modifierList;
   GetModifierList(aParam.mCtrlKey, aParam.mShiftKey,
                   aParam.mAltKey, aParam.mMetaKey,
                   modifierList);
   aRv = e->InitWheelEvent(aType, aParam.mBubbles, aParam.mCancelable,
                           aParam.mView, aParam.mDetail,
                           aParam.mScreenX, aParam.mScreenY,
@@ -180,17 +180,19 @@ DOMWheelEvent::Constructor(const GlobalO
   e->SetTrusted(trusted);
   return e.forget();
 }
 
 } // namespace dom
 } // namespace mozilla
 
 using namespace mozilla;
+using namespace mozilla::dom;
 
-nsresult NS_NewDOMWheelEvent(nsIDOMEvent** aInstancePtrResult,
-                             mozilla::dom::EventTarget* aOwner,
-                             nsPresContext* aPresContext,
-                             WidgetWheelEvent* aEvent)
+nsresult
+NS_NewDOMWheelEvent(nsIDOMEvent** aInstancePtrResult,
+                    EventTarget* aOwner,
+                    nsPresContext* aPresContext,
+                    WidgetWheelEvent* aEvent)
 {
-  dom::DOMWheelEvent* it = new dom::DOMWheelEvent(aOwner, aPresContext, aEvent);
+  WheelEvent* it = new WheelEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
rename from dom/events/DOMWheelEvent.h
rename to dom/events/WheelEvent.h
--- a/dom/events/DOMWheelEvent.h
+++ b/dom/events/WheelEvent.h
@@ -1,55 +1,55 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_dom_DOMWheelEvent_h__
-#define mozilla_dom_DOMWheelEvent_h__
+#ifndef mozilla_dom_WheelEvent_h_
+#define mozilla_dom_WheelEvent_h_
 
 #include "nsIDOMWheelEvent.h"
 #include "nsDOMMouseEvent.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/dom/WheelEventBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-class DOMWheelEvent : public nsDOMMouseEvent,
-                      public nsIDOMWheelEvent
+class WheelEvent : public nsDOMMouseEvent,
+                   public nsIDOMWheelEvent
 {
 public:
-  DOMWheelEvent(mozilla::dom::EventTarget* aOwner,
-                nsPresContext* aPresContext,
-                WidgetWheelEvent* aWheelEvent);
+  WheelEvent(EventTarget* aOwner,
+             nsPresContext* aPresContext,
+             WidgetWheelEvent* aWheelEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMWheelEvent Interface
   NS_DECL_NSIDOMWHEELEVENT
   
   // Forward to base class
   NS_FORWARD_TO_NSDOMMOUSEEVENT
 
   static
-  already_AddRefed<DOMWheelEvent> Constructor(const GlobalObject& aGlobal,
-                                              const nsAString& aType,
-                                              const WheelEventInit& aParam,
-                                              mozilla::ErrorResult& aRv);
+  already_AddRefed<WheelEvent> Constructor(const GlobalObject& aGlobal,
+                                           const nsAString& aType,
+                                           const WheelEventInit& aParam,
+                                           ErrorResult& aRv);
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::WheelEventBinding::Wrap(aCx, aScope, this);
+    return WheelEventBinding::Wrap(aCx, aScope, this);
   }
 
   double DeltaX();
   double DeltaY();
   double DeltaZ();
   uint32_t DeltaMode();
 };
 
 } // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_dom_DOMWheelEvent_h__
+#endif // mozilla_dom_WheelEvent_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -34,23 +34,23 @@ EXPORTS += [
 EXPORTS.mozilla += [
     'MutationEvent.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'EventTarget.h',
     'PointerEvent.h',
     'Touch.h',
+    'WheelEvent.h',
 ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     EXPORTS.mozilla.dom += ['SpeechRecognitionError.h']
 
 UNIFIED_SOURCES += [
-    'DOMWheelEvent.cpp',
     'EventTarget.cpp',
     'nsAsyncDOMEvent.cpp',
     'nsContentEventHandler.cpp',
     'nsDOMAnimationEvent.cpp',
     'nsDOMBeforeUnloadEvent.cpp',
     'nsDOMClipboardEvent.cpp',
     'nsDOMCommandEvent.cpp',
     'nsDOMCompositionEvent.cpp',
@@ -75,16 +75,17 @@ UNIFIED_SOURCES += [
     'nsEventListenerService.cpp',
     'nsIMEStateManager.cpp',
     'nsJSEventListener.cpp',
     'nsPaintRequest.cpp',
     'nsPrivateTextRange.cpp',
     'PointerEvent.cpp',
     'TextComposition.cpp',
     'Touch.cpp',
+    'WheelEvent.cpp',
 ]
 
 SOURCES += [
     # nsDOMEvent.cpp should be built separately because it includes
     # ipc/IPCMessageUtils.h, which on Windows includes windows.h.
     'nsDOMEvent.cpp',
     # nsDOMEvent.cpp should be built separately because it includes
     # ipc/IPCMessageUtils.h, which on Windows includes windows.h.