From 8f0b224c34db3ba6944002ad542da623fc2e9d0f Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Fri, 27 Sep 2013 15:20:54 +0900 Subject: [PATCH] Bug 920377 part.5 Get rid of nsAnimationEvent r=roc --- content/events/src/nsDOMAnimationEvent.cpp | 13 +++++++------ content/events/src/nsDOMAnimationEvent.h | 6 +++--- content/events/src/nsDOMEvent.cpp | 14 +++++++------- content/events/src/nsEventDispatcher.cpp | 2 +- dom/interfaces/events/nsIDOMEvent.idl | 2 +- layout/style/nsAnimationManager.h | 4 ++-- widget/ContentEvents.h | 1 - widget/EventForwards.h | 1 - 8 files changed, 21 insertions(+), 22 deletions(-) diff --git a/content/events/src/nsDOMAnimationEvent.cpp b/content/events/src/nsDOMAnimationEvent.cpp index 5f81d4804f9a..8c4a93e8e38c 100644 --- a/content/events/src/nsDOMAnimationEvent.cpp +++ b/content/events/src/nsDOMAnimationEvent.cpp @@ -7,14 +7,15 @@ #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; @@ -86,7 +87,7 @@ nsresult NS_NewDOMAnimationEvent(nsIDOMEvent **aInstancePtrResult, mozilla::dom::EventTarget* aOwner, nsPresContext *aPresContext, - nsAnimationEvent *aEvent) + InternalAnimationEvent *aEvent) { nsDOMAnimationEvent* it = new nsDOMAnimationEvent(aOwner, aPresContext, aEvent); diff --git a/content/events/src/nsDOMAnimationEvent.h b/content/events/src/nsDOMAnimationEvent.h index 4a9955250537..0b3b6712e6f9 100644 --- a/content/events/src/nsDOMAnimationEvent.h +++ b/content/events/src/nsDOMAnimationEvent.h @@ -18,7 +18,7 @@ class nsDOMAnimationEvent : public nsDOMEvent, public: nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner, nsPresContext *aPresContext, - nsAnimationEvent *aEvent); + mozilla::InternalAnimationEvent* aEvent); ~nsDOMAnimationEvent(); NS_DECL_ISUPPORTS_INHERITED @@ -47,10 +47,10 @@ public: } private: - nsAnimationEvent* AnimationEvent() { + mozilla::InternalAnimationEvent* AnimationEvent() { NS_ABORT_IF_FALSE(mEvent->eventStructType == NS_ANIMATION_EVENT, "unexpected struct type"); - return static_cast(mEvent); + return static_cast(mEvent); } }; diff --git a/content/events/src/nsDOMEvent.cpp b/content/events/src/nsDOMEvent.cpp index 531d9a0418f9..3e10735751d4 100644 --- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -723,13 +723,13 @@ nsDOMEvent::DuplicatePrivateData() } case NS_ANIMATION_EVENT: { - nsAnimationEvent* oldAnimationEvent = - static_cast(mEvent); - nsAnimationEvent* animationEvent = - new nsAnimationEvent(false, msg, - oldAnimationEvent->animationName, - oldAnimationEvent->elapsedTime, - oldAnimationEvent->pseudoElement); + InternalAnimationEvent* oldAnimationEvent = + static_cast(mEvent); + InternalAnimationEvent* animationEvent = + new InternalAnimationEvent(false, msg, + oldAnimationEvent->animationName, + oldAnimationEvent->elapsedTime, + oldAnimationEvent->pseudoElement); animationEvent->AssignAnimationEventData(*oldAnimationEvent, true); newEvent = animationEvent; break; diff --git a/content/events/src/nsEventDispatcher.cpp b/content/events/src/nsEventDispatcher.cpp index ff36a8687b27..e902a2bfa685 100644 --- a/content/events/src/nsEventDispatcher.cpp +++ b/content/events/src/nsEventDispatcher.cpp @@ -747,7 +747,7 @@ nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner, static_cast(aEvent)); case NS_ANIMATION_EVENT: return NS_NewDOMAnimationEvent(aDOMEvent, aOwner, aPresContext, - static_cast(aEvent)); + static_cast(aEvent)); default: // For all other types of events, create a vanilla event object. return NS_NewDOMEvent(aDOMEvent, aOwner, aPresContext, aEvent); diff --git a/dom/interfaces/events/nsIDOMEvent.idl b/dom/interfaces/events/nsIDOMEvent.idl index eb53561a6e46..ee69d087955d 100644 --- a/dom/interfaces/events/nsIDOMEvent.idl +++ b/dom/interfaces/events/nsIDOMEvent.idl @@ -370,7 +370,7 @@ 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, diff --git a/layout/style/nsAnimationManager.h b/layout/style/nsAnimationManager.h index a74eceb6ca4c..c2e75817f539 100644 --- a/layout/style/nsAnimationManager.h +++ b/layout/style/nsAnimationManager.h @@ -23,7 +23,7 @@ class Declaration; struct AnimationEventInfo { nsRefPtr mElement; - nsAnimationEvent mEvent; + mozilla::InternalAnimationEvent mEvent; AnimationEventInfo(mozilla::dom::Element *aElement, const nsString& aAnimationName, @@ -35,7 +35,7 @@ struct AnimationEventInfo { { } - // 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), diff --git a/widget/ContentEvents.h b/widget/ContentEvents.h index 364d1fe0f956..fea7076f22a0 100644 --- a/widget/ContentEvents.h +++ b/widget/ContentEvents.h @@ -255,6 +255,5 @@ typedef mozilla::InternalFormEvent nsFormEvent; typedef mozilla::InternalClipboardEvent nsClipboardEvent; typedef mozilla::InternalFocusEvent nsFocusEvent; typedef mozilla::InternalTransitionEvent nsTransitionEvent; -typedef mozilla::InternalAnimationEvent nsAnimationEvent; #endif // mozilla_ContentEvents_h__ diff --git a/widget/EventForwards.h b/widget/EventForwards.h index de20ef793bc7..4500fdb9159e 100644 --- a/widget/EventForwards.h +++ b/widget/EventForwards.h @@ -135,6 +135,5 @@ typedef mozilla::InternalFormEvent nsFormEvent; typedef mozilla::InternalClipboardEvent nsClipboardEvent; typedef mozilla::InternalFocusEvent nsFocusEvent; typedef mozilla::InternalTransitionEvent nsTransitionEvent; -typedef mozilla::InternalAnimationEvent nsAnimationEvent; #endif // mozilla_EventForwards_h__