Bug 920377 part.5 Get rid of nsAnimationEvent r=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 27 Sep 2013 15:20:54 +0900
changeset 148971 7fc126f540f8f5b1e72ae65ace3b7eeb2554b210
parent 148970 5c6b7f254a3b33949cafd0d1e2de63ab1ebb2a44
child 148972 78f0a1cb042e3d5e9913acef737346008345e5a3
push id2869
push userkwierso@gmail.com
push dateSat, 28 Sep 2013 03:38:41 +0000
treeherderfx-team@2f4397db1830 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs920377
milestone27.0a1
Bug 920377 part.5 Get rid of nsAnimationEvent r=roc
content/events/src/nsDOMAnimationEvent.cpp
content/events/src/nsDOMAnimationEvent.h
content/events/src/nsDOMEvent.cpp
content/events/src/nsEventDispatcher.cpp
dom/interfaces/events/nsIDOMEvent.idl
layout/style/nsAnimationManager.h
widget/ContentEvents.h
widget/EventForwards.h
--- a/content/events/src/nsDOMAnimationEvent.cpp
+++ b/content/events/src/nsDOMAnimationEvent.cpp
@@ -2,24 +2,25 @@
 /* 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 "nsDOMAnimationEvent.h"
 #include "prtime.h"
 #include "mozilla/ContentEvents.h"
 
+using namespace mozilla;
+
 nsDOMAnimationEvent::nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
                                          nsPresContext *aPresContext,
-                                         nsAnimationEvent *aEvent)
+                                         InternalAnimationEvent* aEvent)
   : nsDOMEvent(aOwner, aPresContext,
-               aEvent ? aEvent : new nsAnimationEvent(false, 0,
-                                                      EmptyString(),
-                                                      0.0,
-                                                      EmptyString()))
+               aEvent ? aEvent :
+                        new InternalAnimationEvent(false, 0, EmptyString(),
+                                                   0.0, EmptyString()))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
@@ -81,14 +82,14 @@ nsDOMAnimationEvent::GetPseudoElement(ns
   aPseudoElement = AnimationEvent()->pseudoElement;
   return NS_OK;
 }
 
 nsresult
 NS_NewDOMAnimationEvent(nsIDOMEvent **aInstancePtrResult,
                         mozilla::dom::EventTarget* aOwner,
                         nsPresContext *aPresContext,
-                        nsAnimationEvent *aEvent)
+                        InternalAnimationEvent *aEvent)
 {
   nsDOMAnimationEvent* it =
     new nsDOMAnimationEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMAnimationEvent.h
+++ b/content/events/src/nsDOMAnimationEvent.h
@@ -13,17 +13,17 @@
 class nsAString;
 
 class nsDOMAnimationEvent : public nsDOMEvent,
                             public nsIDOMAnimationEvent
 {
 public:
   nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
                       nsPresContext *aPresContext,
-                      nsAnimationEvent *aEvent);
+                      mozilla::InternalAnimationEvent* aEvent);
   ~nsDOMAnimationEvent();
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_FORWARD_TO_NSDOMEVENT
   NS_DECL_NSIDOMANIMATIONEVENT
 
   static already_AddRefed<nsDOMAnimationEvent>
   Constructor(const mozilla::dom::GlobalObject& aGlobal,
@@ -42,16 +42,16 @@ public:
   // GetPseudoElement(nsAString& aPseudoElement);
 
   float ElapsedTime()
   {
     return AnimationEvent()->elapsedTime;
   }
 
 private:
-  nsAnimationEvent* AnimationEvent() {
+  mozilla::InternalAnimationEvent* AnimationEvent() {
     NS_ABORT_IF_FALSE(mEvent->eventStructType == NS_ANIMATION_EVENT,
                       "unexpected struct type");
-    return static_cast<nsAnimationEvent*>(mEvent);
+    return static_cast<mozilla::InternalAnimationEvent*>(mEvent);
   }
 };
 
 #endif /* !defined(nsDOMAnimationEvent_h_) */
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -718,23 +718,23 @@ nsDOMEvent::DuplicatePrivateData()
                                oldTransitionEvent->elapsedTime,
                                oldTransitionEvent->pseudoElement);
       transitionEvent->AssignTransitionEventData(*oldTransitionEvent, true);
       newEvent = transitionEvent;
       break;
     }
     case NS_ANIMATION_EVENT:
     {
-      nsAnimationEvent* oldAnimationEvent =
-        static_cast<nsAnimationEvent*>(mEvent);
-      nsAnimationEvent* animationEvent =
-        new nsAnimationEvent(false, msg,
-                             oldAnimationEvent->animationName,
-                             oldAnimationEvent->elapsedTime,
-                             oldAnimationEvent->pseudoElement);
+      InternalAnimationEvent* oldAnimationEvent =
+        static_cast<InternalAnimationEvent*>(mEvent);
+      InternalAnimationEvent* animationEvent =
+        new InternalAnimationEvent(false, msg,
+                                   oldAnimationEvent->animationName,
+                                   oldAnimationEvent->elapsedTime,
+                                   oldAnimationEvent->pseudoElement);
       animationEvent->AssignAnimationEventData(*oldAnimationEvent, true);
       newEvent = animationEvent;
       break;
     }
     case NS_TOUCH_EVENT:
     {
       nsTouchEvent* oldTouchEvent = static_cast<nsTouchEvent*>(mEvent);
       nsTouchEvent* touchEvent = new nsTouchEvent(false, oldTouchEvent);
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -742,17 +742,17 @@ nsEventDispatcher::CreateEvent(mozilla::
     case NS_TOUCH_EVENT:
       return NS_NewDOMTouchEvent(aDOMEvent, aOwner, aPresContext,
                                  static_cast<nsTouchEvent*>(aEvent));
     case NS_TRANSITION_EVENT:
       return NS_NewDOMTransitionEvent(aDOMEvent, aOwner, aPresContext,
                                       static_cast<nsTransitionEvent*>(aEvent));
     case NS_ANIMATION_EVENT:
       return NS_NewDOMAnimationEvent(aDOMEvent, aOwner, aPresContext,
-                                     static_cast<nsAnimationEvent*>(aEvent));
+               static_cast<InternalAnimationEvent*>(aEvent));
     default:
       // For all other types of events, create a vanilla event object.
       return NS_NewDOMEvent(aDOMEvent, aOwner, aPresContext, aEvent);
     }
   }
 
   // And if we didn't get an event, check the type argument.
 
--- a/dom/interfaces/events/nsIDOMEvent.idl
+++ b/dom/interfaces/events/nsIDOMEvent.idl
@@ -365,17 +365,17 @@ nsresult
 NS_NewDOMTransitionEvent(nsIDOMEvent** aInstancePtrResult,
                          mozilla::dom::EventTarget* aOwner,
                          nsPresContext* aPresContext,
                          nsTransitionEvent* aEvent);
 nsresult
 NS_NewDOMAnimationEvent(nsIDOMEvent** aInstancePtrResult,
                         mozilla::dom::EventTarget* aOwner,
                         nsPresContext* aPresContext,
-                        nsAnimationEvent* aEvent);
+                        mozilla::InternalAnimationEvent* aEvent);
 nsresult
 NS_NewDOMTouchEvent(nsIDOMEvent** aInstancePtrResult,
                     mozilla::dom::EventTarget* aOwner,
                     nsPresContext* aPresContext,
                     nsTouchEvent* aEvent);
 nsresult
 NS_NewDOMMozSettingsEvent(nsIDOMEvent** aInstancePtrResult,
                           mozilla::dom::EventTarget* aOwner,
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -18,29 +18,29 @@ class nsStyleContext;
 namespace mozilla {
 namespace css {
 class Declaration;
 }
 }
 
 struct AnimationEventInfo {
   nsRefPtr<mozilla::dom::Element> mElement;
-  nsAnimationEvent mEvent;
+  mozilla::InternalAnimationEvent mEvent;
 
   AnimationEventInfo(mozilla::dom::Element *aElement,
                      const nsString& aAnimationName,
                      uint32_t aMessage, mozilla::TimeDuration aElapsedTime,
                      const nsAString& aPseudoElement)
     : mElement(aElement),
       mEvent(true, aMessage, aAnimationName, aElapsedTime.ToSeconds(),
              aPseudoElement)
   {
   }
 
-  // nsAnimationEvent doesn't support copy-construction, so we need
+  // InternalAnimationEvent doesn't support copy-construction, so we need
   // to ourselves in order to work with nsTArray
   AnimationEventInfo(const AnimationEventInfo &aOther)
     : mElement(aOther.mElement),
       mEvent(true, aOther.mEvent.message,
              aOther.mEvent.animationName, aOther.mEvent.elapsedTime,
              aOther.mEvent.pseudoElement)
   {
   }
--- a/widget/ContentEvents.h
+++ b/widget/ContentEvents.h
@@ -250,11 +250,10 @@ public:
 // TODO: Remove following typedefs
 typedef mozilla::InternalScriptErrorEvent nsScriptErrorEvent;
 typedef mozilla::InternalScrollPortEvent  nsScrollPortEvent;
 typedef mozilla::InternalScrollAreaEvent  nsScrollAreaEvent;
 typedef mozilla::InternalFormEvent        nsFormEvent;
 typedef mozilla::InternalClipboardEvent   nsClipboardEvent;
 typedef mozilla::InternalFocusEvent       nsFocusEvent;
 typedef mozilla::InternalTransitionEvent  nsTransitionEvent;
-typedef mozilla::InternalAnimationEvent   nsAnimationEvent;
 
 #endif // mozilla_ContentEvents_h__
--- a/widget/EventForwards.h
+++ b/widget/EventForwards.h
@@ -130,11 +130,10 @@ typedef mozilla::WidgetSimpleGestureEven
 typedef mozilla::WidgetTouchEvent          nsTouchEvent;
 typedef mozilla::InternalScriptErrorEvent  nsScriptErrorEvent;
 typedef mozilla::InternalScrollPortEvent   nsScrollPortEvent;
 typedef mozilla::InternalScrollAreaEvent   nsScrollAreaEvent;
 typedef mozilla::InternalFormEvent         nsFormEvent;
 typedef mozilla::InternalClipboardEvent    nsClipboardEvent;
 typedef mozilla::InternalFocusEvent        nsFocusEvent;
 typedef mozilla::InternalTransitionEvent   nsTransitionEvent;
-typedef mozilla::InternalAnimationEvent    nsAnimationEvent;
 
 #endif // mozilla_EventForwards_h__