Bug 975688 part.2 Rename nsDOMAnimationEvent to mozilla::dom::AnimationEvent r=smaug

--HG--
rename : dom/events/nsDOMAnimationEvent.cpp => dom/events/AnimationEvent.cpp
rename : dom/events/nsDOMAnimationEvent.h => dom/events/AnimationEvent.h
This commit is contained in:
Masayuki Nakano 2014-02-26 14:23:56 +09:00
parent a4dd828377
commit 64ccb1e296
4 changed files with 54 additions and 41 deletions

View File

@ -98,7 +98,7 @@ DOMInterfaces = {
},
'AnimationEvent': {
'nativeType': 'nsDOMAnimationEvent',
'nativeType': 'mozilla::dom::AnimationEvent',
},
'ArchiveReader': {

View File

@ -3,15 +3,16 @@
* 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/dom/AnimationEvent.h"
#include "mozilla/ContentEvents.h"
#include "prtime.h"
using namespace mozilla;
namespace mozilla {
namespace dom {
nsDOMAnimationEvent::nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext,
InternalAnimationEvent* aEvent)
AnimationEvent::AnimationEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
InternalAnimationEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext,
aEvent ? aEvent : new InternalAnimationEvent(false, 0))
{
@ -24,22 +25,22 @@ nsDOMAnimationEvent::nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
}
}
NS_INTERFACE_MAP_BEGIN(nsDOMAnimationEvent)
NS_INTERFACE_MAP_BEGIN(AnimationEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMAnimationEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMAnimationEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMAnimationEvent, nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(AnimationEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(AnimationEvent, nsDOMEvent)
//static
already_AddRefed<nsDOMAnimationEvent>
nsDOMAnimationEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
const nsAString& aType,
const mozilla::dom::AnimationEventInit& aParam,
mozilla::ErrorResult& aRv)
already_AddRefed<AnimationEvent>
AnimationEvent::Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const AnimationEventInit& aParam,
ErrorResult& aRv)
{
nsCOMPtr<mozilla::dom::EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
nsRefPtr<nsDOMAnimationEvent> e = new nsDOMAnimationEvent(t, nullptr, nullptr);
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
nsRefPtr<AnimationEvent> e = new AnimationEvent(t, nullptr, nullptr);
bool trusted = e->Init(t);
aRv = e->InitEvent(aType, aParam.mBubbles, aParam.mCancelable);
@ -54,39 +55,44 @@ nsDOMAnimationEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
}
NS_IMETHODIMP
nsDOMAnimationEvent::GetAnimationName(nsAString & aAnimationName)
AnimationEvent::GetAnimationName(nsAString& aAnimationName)
{
aAnimationName = mEvent->AsAnimationEvent()->animationName;
return NS_OK;
}
NS_IMETHODIMP
nsDOMAnimationEvent::GetElapsedTime(float *aElapsedTime)
AnimationEvent::GetElapsedTime(float* aElapsedTime)
{
*aElapsedTime = ElapsedTime();
return NS_OK;
}
float
nsDOMAnimationEvent::ElapsedTime()
AnimationEvent::ElapsedTime()
{
return mEvent->AsAnimationEvent()->elapsedTime;
}
NS_IMETHODIMP
nsDOMAnimationEvent::GetPseudoElement(nsAString& aPseudoElement)
AnimationEvent::GetPseudoElement(nsAString& aPseudoElement)
{
aPseudoElement = mEvent->AsAnimationEvent()->pseudoElement;
return NS_OK;
}
} // namespace dom
} // namespace mozilla
using namespace mozilla;
using namespace mozilla::dom;
nsresult
NS_NewDOMAnimationEvent(nsIDOMEvent **aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext,
InternalAnimationEvent *aEvent)
NS_NewDOMAnimationEvent(nsIDOMEvent** aInstancePtrResult,
EventTarget* aOwner,
nsPresContext* aPresContext,
InternalAnimationEvent* aEvent)
{
nsDOMAnimationEvent* it =
new nsDOMAnimationEvent(aOwner, aPresContext, aEvent);
AnimationEvent* it = new AnimationEvent(aOwner, aPresContext, aEvent);
return CallQueryInterface(it, aInstancePtrResult);
}

View File

@ -2,8 +2,8 @@
/* 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 nsDOMAnimationEvent_h_
#define nsDOMAnimationEvent_h_
#ifndef mozilla_dom_AnimationEvent_h_
#define mozilla_dom_AnimationEvent_h_
#include "nsDOMEvent.h"
#include "nsIDOMAnimationEvent.h"
@ -12,28 +12,31 @@
class nsAString;
class nsDOMAnimationEvent : public nsDOMEvent,
public nsIDOMAnimationEvent
namespace mozilla {
namespace dom {
class AnimationEvent : public nsDOMEvent,
public nsIDOMAnimationEvent
{
public:
nsDOMAnimationEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext *aPresContext,
mozilla::InternalAnimationEvent* aEvent);
AnimationEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
InternalAnimationEvent* aEvent);
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_TO_NSDOMEVENT
NS_DECL_NSIDOMANIMATIONEVENT
static already_AddRefed<nsDOMAnimationEvent>
Constructor(const mozilla::dom::GlobalObject& aGlobal,
static already_AddRefed<AnimationEvent>
Constructor(const GlobalObject& aGlobal,
const nsAString& aType,
const mozilla::dom::AnimationEventInit& aParam,
mozilla::ErrorResult& aRv);
const AnimationEventInit& aParam,
ErrorResult& aRv);
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
{
return mozilla::dom::AnimationEventBinding::Wrap(aCx, aScope, this);
return AnimationEventBinding::Wrap(aCx, aScope, this);
}
// xpidl implementation
@ -43,4 +46,7 @@ public:
float ElapsedTime();
};
#endif /* !defined(nsDOMAnimationEvent_h_) */
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_AnimationEvent_h_

View File

@ -36,6 +36,7 @@ EXPORTS.mozilla += [
]
EXPORTS.mozilla.dom += [
'AnimationEvent.h',
'EventTarget.h',
'PointerEvent.h',
'Touch.h',
@ -46,10 +47,10 @@ if CONFIG['MOZ_WEBSPEECH']:
EXPORTS.mozilla.dom += ['SpeechRecognitionError.h']
UNIFIED_SOURCES += [
'AnimationEvent.cpp',
'EventTarget.cpp',
'nsAsyncDOMEvent.cpp',
'nsContentEventHandler.cpp',
'nsDOMAnimationEvent.cpp',
'nsDOMBeforeUnloadEvent.cpp',
'nsDOMClipboardEvent.cpp',
'nsDOMCommandEvent.cpp',