Bug 975688 part.22 Rename nsDOMTrasitionEvent to mozilla::dom::TrasitionEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 28 Feb 2014 23:58:42 +0900
changeset 171520 78f44c7e55f107eec6b38bcd7b6fa86a43b8a84f
parent 171519 031dc7e7c0742dca42bbd82d866dffc097b0bbdf
child 171521 cb9e4644b197eb538117ba52368896d4a22cb985
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerssmaug
bugs975688
milestone30.0a1
Bug 975688 part.22 Rename nsDOMTrasitionEvent to mozilla::dom::TrasitionEvent r=smaug
dom/bindings/Bindings.conf
dom/events/TransitionEvent.cpp
dom/events/TransitionEvent.h
dom/events/moz.build
dom/events/nsDOMTransitionEvent.cpp
dom/events/nsDOMTransitionEvent.h
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -1226,20 +1226,16 @@ DOMInterfaces = {
 'TimeRanges': {
     'wrapperCache': False
 },
 
 'TouchList': {
     'headerFile': 'mozilla/dom/TouchEvent.h',
 },
 
-'TransitionEvent': {
-    'nativeType': 'nsDOMTransitionEvent',
-},
-
 'TreeColumns': {
     'nativeType': 'nsTreeColumns',
 },
 
 'TreeWalker': {
     'wrapperCache': False,
     'resultNotAddRefed': [ 'root', 'currentNode' ],
 },
rename from dom/events/nsDOMTransitionEvent.cpp
rename to dom/events/TransitionEvent.cpp
--- a/dom/events/nsDOMTransitionEvent.cpp
+++ b/dom/events/TransitionEvent.cpp
@@ -1,92 +1,98 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* 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 "nsDOMTransitionEvent.h"
+#include "mozilla/dom/TransitionEvent.h"
+#include "mozilla/ContentEvents.h"
 #include "prtime.h"
-#include "mozilla/ContentEvents.h"
 
-using namespace mozilla;
+namespace mozilla {
+namespace dom {
 
-nsDOMTransitionEvent::nsDOMTransitionEvent(mozilla::dom::EventTarget* aOwner,
-                                           nsPresContext *aPresContext,
-                                           InternalTransitionEvent* aEvent)
+TransitionEvent::TransitionEvent(EventTarget* aOwner,
+                                 nsPresContext* aPresContext,
+                                 InternalTransitionEvent* aEvent)
   : nsDOMEvent(aOwner, aPresContext,
                aEvent ? aEvent : new InternalTransitionEvent(false, 0))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
 }
 
-NS_INTERFACE_MAP_BEGIN(nsDOMTransitionEvent)
+NS_INTERFACE_MAP_BEGIN(TransitionEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMTransitionEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
 
-NS_IMPL_ADDREF_INHERITED(nsDOMTransitionEvent, nsDOMEvent)
-NS_IMPL_RELEASE_INHERITED(nsDOMTransitionEvent, nsDOMEvent)
+NS_IMPL_ADDREF_INHERITED(TransitionEvent, nsDOMEvent)
+NS_IMPL_RELEASE_INHERITED(TransitionEvent, nsDOMEvent)
 
-//static
-already_AddRefed<nsDOMTransitionEvent>
-nsDOMTransitionEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
-                                  const nsAString& aType,
-                                  const mozilla::dom::TransitionEventInit& aParam,
-                                  mozilla::ErrorResult& aRv)
+// static
+already_AddRefed<TransitionEvent>
+TransitionEvent::Constructor(const GlobalObject& aGlobal,
+                             const nsAString& aType,
+                             const TransitionEventInit& aParam,
+                             ErrorResult& aRv)
 {
-  nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
-  nsRefPtr<nsDOMTransitionEvent> e = new nsDOMTransitionEvent(t, nullptr, nullptr);
+  nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
+  nsRefPtr<TransitionEvent> e = new TransitionEvent(t, nullptr, nullptr);
   bool trusted = e->Init(t);
 
   aRv = e->InitEvent(aType, aParam.mBubbles, aParam.mCancelable);
 
   InternalTransitionEvent* internalEvent = e->mEvent->AsTransitionEvent();
   internalEvent->propertyName = aParam.mPropertyName;
   internalEvent->elapsedTime = aParam.mElapsedTime;
   internalEvent->pseudoElement = aParam.mPseudoElement;
 
   e->SetTrusted(trusted);
   return e.forget();
 }
 
 NS_IMETHODIMP
-nsDOMTransitionEvent::GetPropertyName(nsAString & aPropertyName)
+TransitionEvent::GetPropertyName(nsAString& aPropertyName)
 {
   aPropertyName = mEvent->AsTransitionEvent()->propertyName;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMTransitionEvent::GetElapsedTime(float *aElapsedTime)
+TransitionEvent::GetElapsedTime(float* aElapsedTime)
 {
   *aElapsedTime = ElapsedTime();
   return NS_OK;
 }
 
 float
-nsDOMTransitionEvent::ElapsedTime()
+TransitionEvent::ElapsedTime()
 {
   return mEvent->AsTransitionEvent()->elapsedTime;
 }
 
 NS_IMETHODIMP
-nsDOMTransitionEvent::GetPseudoElement(nsAString& aPseudoElement)
+TransitionEvent::GetPseudoElement(nsAString& aPseudoElement)
 {
   aPseudoElement = mEvent->AsTransitionEvent()->pseudoElement;
   return NS_OK;
 }
 
+} // namespace dom
+} // namespace mozilla
+
+using namespace mozilla;
+using namespace mozilla::dom;
+
 nsresult
-NS_NewDOMTransitionEvent(nsIDOMEvent **aInstancePtrResult,
-                         mozilla::dom::EventTarget* aOwner,
-                         nsPresContext *aPresContext,
+NS_NewDOMTransitionEvent(nsIDOMEvent** aInstancePtrResult,
+                         EventTarget* aOwner,
+                         nsPresContext* aPresContext,
                          InternalTransitionEvent* aEvent)
 {
-  nsDOMTransitionEvent *it =
-    new nsDOMTransitionEvent(aOwner, aPresContext, aEvent);
+  TransitionEvent *it = new TransitionEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
rename from dom/events/nsDOMTransitionEvent.h
rename to dom/events/TransitionEvent.h
--- a/dom/events/nsDOMTransitionEvent.h
+++ b/dom/events/TransitionEvent.h
@@ -1,46 +1,52 @@
 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
 /* 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 nsDOMTransitionEvent_h_
-#define nsDOMTransitionEvent_h_
+#ifndef mozilla_dom_TransitionEvent_h_
+#define mozilla_dom_TransitionEvent_h_
 
 #include "nsDOMEvent.h"
 #include "nsIDOMTransitionEvent.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/dom/TransitionEventBinding.h"
 
 class nsAString;
 
-class nsDOMTransitionEvent : public nsDOMEvent,
-                             public nsIDOMTransitionEvent
+namespace mozilla {
+namespace dom {
+
+class TransitionEvent : public nsDOMEvent,
+                        public nsIDOMTransitionEvent
 {
 public:
-  nsDOMTransitionEvent(mozilla::dom::EventTarget* aOwner,
-                       nsPresContext *aPresContext,
-                       mozilla::InternalTransitionEvent* aEvent);
+  TransitionEvent(EventTarget* aOwner,
+                  nsPresContext* aPresContext,
+                  InternalTransitionEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_FORWARD_TO_NSDOMEVENT
   NS_DECL_NSIDOMTRANSITIONEVENT
 
-  static already_AddRefed<nsDOMTransitionEvent>
-  Constructor(const mozilla::dom::GlobalObject& aGlobal,
+  static already_AddRefed<TransitionEvent>
+  Constructor(const GlobalObject& aGlobal,
               const nsAString& aType,
-              const mozilla::dom::TransitionEventInit& aParam,
-              mozilla::ErrorResult& aRv);
+              const TransitionEventInit& aParam,
+              ErrorResult& aRv);
 
   virtual JSObject* WrapObject(JSContext* aCx,
-			       JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
+                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
-    return mozilla::dom::TransitionEventBinding::Wrap(aCx, aScope, this);
+    return TransitionEventBinding::Wrap(aCx, aScope, this);
   }
 
   // xpidl implementation
   // GetPropertyName(nsAString& aPropertyName)
   // GetPseudoElement(nsAString& aPreudoElement)
 
   float ElapsedTime();
 };
 
-#endif /* !defined(nsDOMTransitionEvent_h_) */
+} // namespace dom
+} // namespace mozilla
+
+#endif // mozilla_dom_TransitionEvent_h_
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -51,16 +51,17 @@ EXPORTS.mozilla.dom += [
     'MouseEvent.h',
     'MouseScrollEvent.h',
     'MutationEvent.h',
     'NotifyAudioAvailableEvent.h',
     'PointerEvent.h',
     'SimpleGestureEvent.h',
     'Touch.h',
     'TouchEvent.h',
+    'TransitionEvent.h',
     'WheelEvent.h',
 ]
 
 if CONFIG['MOZ_WEBSPEECH']:
     EXPORTS.mozilla.dom += ['SpeechRecognitionError.h']
 
 UNIFIED_SOURCES += [
     'AnimationEvent.cpp',
@@ -79,29 +80,29 @@ UNIFIED_SOURCES += [
     'MouseEvent.cpp',
     'MouseScrollEvent.cpp',
     'MutationEvent.cpp',
     'NotifyAudioAvailableEvent.cpp',
     'nsAsyncDOMEvent.cpp',
     'nsContentEventHandler.cpp',
     'nsDOMEventTargetHelper.cpp',
     'nsDOMTextEvent.cpp',
-    'nsDOMTransitionEvent.cpp',
     'nsDOMXULCommandEvent.cpp',
     'nsEventDispatcher.cpp',
     'nsEventListenerService.cpp',
     'nsIMEStateManager.cpp',
     'nsJSEventListener.cpp',
     'nsPaintRequest.cpp',
     'nsPrivateTextRange.cpp',
     'PointerEvent.cpp',
     'SimpleGestureEvent.cpp',
     'TextComposition.cpp',
     'Touch.cpp',
     'TouchEvent.cpp',
+    'TransitionEvent.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