Bug 920377 part.31 Get rid of nsEvent r=roc

This commit is contained in:
Masayuki Nakano 2013-10-02 12:46:04 +09:00
parent d9fe18d02f
commit 5e5853070a
94 changed files with 287 additions and 236 deletions

View File

@ -781,7 +781,7 @@ public:
*/
using nsIContent::DispatchEvent;
static nsresult DispatchEvent(nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
nsIContent* aTarget,
bool aFullDispatch,
nsEventStatus* aStatus);

View File

@ -1372,7 +1372,7 @@ public:
* aDOMEvent->GetInternalNSEvent().
* XXX Is this necessary?
*/
static nsEvent* GetNativeEvent(nsIDOMEvent* aDOMEvent);
static mozilla::WidgetEvent* GetNativeEvent(nsIDOMEvent* aDOMEvent);
/**
* Get the candidates for accelkeys for aDOMKeyEvent.

View File

@ -1403,7 +1403,7 @@ Element::IsNodeOfType(uint32_t aFlags) const
/* static */
nsresult
Element::DispatchEvent(nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
nsIContent* aTarget,
bool aFullDispatch,
nsEventStatus* aStatus)

View File

@ -4554,7 +4554,7 @@ nsContentUtils::GetLocalizedEllipsis()
}
//static
nsEvent*
WidgetEvent*
nsContentUtils::GetNativeEvent(nsIDOMEvent* aDOMEvent)
{
return aDOMEvent ? aDOMEvent->GetInternalNSEvent() : nullptr;

View File

@ -4626,7 +4626,7 @@ nsDocument::DispatchContentLoadedEvents()
// the ancestor document if we used the normal event
// dispatching code.
nsEvent* innerEvent = event->GetInternalNSEvent();
WidgetEvent* innerEvent = event->GetInternalNSEvent();
if (innerEvent) {
nsEventStatus status = nsEventStatus_eIgnore;

View File

@ -1147,7 +1147,7 @@ nsINode::PostHandleEvent(nsEventChainPostVisitor& /*aVisitor*/)
}
nsresult
nsINode::DispatchDOMEvent(nsEvent* aEvent,
nsINode::DispatchDOMEvent(WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsPresContext* aPresContext,
nsEventStatus* aEventStatus)

View File

@ -15,6 +15,7 @@
#include "nsGkAtoms.h"
#include "nsContentSink.h"
using namespace mozilla;
using namespace mozilla::dom;
NS_IMETHODIMP
@ -58,7 +59,7 @@ nsScriptElement::ScriptEvaluated(nsresult aResult,
nsEventStatus status = nsEventStatus_eIgnore;
uint32_t type = NS_SUCCEEDED(aResult) ? NS_LOAD : NS_LOAD_ERROR;
nsEvent event(true, type);
WidgetEvent event(true, type);
// Load event doesn't bubble.
event.mFlags.mBubbles = (type != NS_LOAD);

View File

@ -34,7 +34,7 @@ public:
: mEventNode(aEventNode), mEvent(aEvent), mDispatchChromeOnly(false)
{ }
nsAsyncDOMEvent(nsINode *aEventNode, nsEvent &aEvent);
nsAsyncDOMEvent(nsINode* aEventNode, mozilla::WidgetEvent& aEvent);
NS_IMETHOD Run() MOZ_OVERRIDE;
nsresult PostDOMEvent();

View File

@ -46,7 +46,7 @@ class EventTarget;
class nsEventChainVisitor {
public:
nsEventChainVisitor(nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsEventStatus aEventStatus = nsEventStatus_eIgnore)
: mPresContext(aPresContext), mEvent(aEvent), mDOMEvent(aDOMEvent),
@ -59,9 +59,9 @@ public:
nsPresContext* const mPresContext;
/**
* The nsEvent which is being dispatched. Never nullptr.
* The WidgetEvent which is being dispatched. Never nullptr.
*/
nsEvent* const mEvent;
mozilla::WidgetEvent* const mEvent;
/**
* The DOM Event assiciated with the mEvent. Possibly nullptr if a DOM Event
@ -101,7 +101,7 @@ public:
class nsEventChainPreVisitor : public nsEventChainVisitor {
public:
nsEventChainPreVisitor(nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsEventStatus aEventStatus,
bool aIsInAnon)
@ -221,11 +221,11 @@ public:
* If aTargets is non-null, event target chain will be created, but
* event won't be handled. In this case aEvent->message should be
* NS_EVENT_NULL.
* @note Use this method when dispatching an nsEvent.
* @note Use this method when dispatching a WidgetEvent.
*/
static nsresult Dispatch(nsISupports* aTarget,
nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent = nullptr,
nsEventStatus* aEventStatus = nullptr,
nsDispatchingCallback* aCallback = nullptr,
@ -240,7 +240,8 @@ public:
* @note Use this method when dispatching nsIDOMEvent.
*/
static nsresult DispatchDOMEvent(nsISupports* aTarget,
nsEvent* aEvent, nsIDOMEvent* aDOMEvent,
mozilla::WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsPresContext* aPresContext,
nsEventStatus* aEventStatus);
@ -249,7 +250,7 @@ public:
*/
static nsresult CreateEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
const nsAString& aEventType,
nsIDOMEvent** aDOMEvent);

View File

@ -8,7 +8,10 @@
namespace mozilla {
namespace dom {
SpeechRecognitionError::SpeechRecognitionError(mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, nsEvent* aEvent)
SpeechRecognitionError::SpeechRecognitionError(
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent),
mError()
{}

View File

@ -17,7 +17,7 @@ class SpeechRecognitionError : public nsDOMEvent
public:
SpeechRecognitionError(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
WidgetEvent* aEvent);
virtual ~SpeechRecognitionError();
static already_AddRefed<SpeechRecognitionError>

View File

@ -100,7 +100,7 @@ Touch::Target() const
}
void
Touch::InitializePoints(nsPresContext* aPresContext, nsEvent* aEvent)
Touch::InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent)
{
if (mPointsInitialized) {
return;

View File

@ -48,7 +48,7 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch)
void InitializePoints(nsPresContext* aPresContext, nsEvent* aEvent);
void InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent);
void SetTarget(mozilla::dom::EventTarget* aTarget);

View File

@ -11,9 +11,10 @@
#include "mozilla/BasicEvents.h"
#include "mozilla/dom/EventTarget.h"
using namespace mozilla;
using namespace mozilla::dom;
nsAsyncDOMEvent::nsAsyncDOMEvent(nsINode *aEventNode, nsEvent &aEvent)
nsAsyncDOMEvent::nsAsyncDOMEvent(nsINode* aEventNode, WidgetEvent& aEvent)
: mEventNode(aEventNode), mDispatchChromeOnly(false)
{
MOZ_ASSERT(mEventNode);

View File

@ -5,6 +5,8 @@
#include "nsDOMBeforeUnloadEvent.h"
using namespace mozilla;
NS_IMPL_ADDREF_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
@ -29,7 +31,7 @@ nsDOMBeforeUnloadEvent::GetReturnValue(nsAString& aReturnValue)
nsresult NS_NewDOMBeforeUnloadEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent *aEvent)
WidgetEvent* aEvent)
{
nsDOMBeforeUnloadEvent* it =
new nsDOMBeforeUnloadEvent(aOwner, aPresContext, aEvent);

View File

@ -15,7 +15,8 @@ class nsDOMBeforeUnloadEvent : public nsDOMEvent,
{
public:
nsDOMBeforeUnloadEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent)
nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent)
{
}

View File

@ -7,10 +7,12 @@
#include "nsContentUtils.h"
#include "nsIXPConnect.h"
using namespace mozilla;
nsDOMDataContainerEvent::nsDOMDataContainerEvent(
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent)
WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent)
{
}
@ -77,7 +79,7 @@ nsresult
NS_NewDOMDataContainerEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent)
WidgetEvent* aEvent)
{
nsDOMDataContainerEvent* it =
new nsDOMDataContainerEvent(aOwner, aPresContext, aEvent);

View File

@ -16,7 +16,8 @@ class nsDOMDataContainerEvent : public nsDOMEvent,
{
public:
nsDOMDataContainerEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent);
nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent);
NS_DECL_ISUPPORTS_INHERITED

View File

@ -102,7 +102,7 @@ nsresult
NS_NewDOMDeviceMotionEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent *aEvent)
WidgetEvent* aEvent)
{
NS_ENSURE_ARG_POINTER(aInstancePtrResult);

View File

@ -46,7 +46,8 @@ class nsDOMDeviceMotionEvent MOZ_FINAL : public nsDOMEvent,
public:
nsDOMDeviceMotionEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent)
nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent)
{
}

View File

@ -37,7 +37,7 @@ static char *sPopupAllowedEvents;
nsDOMEvent::nsDOMEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent)
nsPresContext* aPresContext, WidgetEvent* aEvent)
{
ConstructorInit(aOwner, aPresContext, aEvent);
}
@ -49,7 +49,7 @@ nsDOMEvent::nsDOMEvent(nsPIDOMWindow* aParent)
void
nsDOMEvent::ConstructorInit(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent)
nsPresContext* aPresContext, WidgetEvent* aEvent)
{
SetIsDOMBinding();
SetOwner(aOwner);
@ -65,16 +65,16 @@ nsDOMEvent::ConstructorInit(mozilla::dom::EventTarget* aOwner,
mEventIsInternal = true;
/*
A derived class might want to allocate its own type of aEvent
(derived from nsEvent). To do this, it should take care to pass
(derived from WidgetEvent). To do this, it should take care to pass
a non-nullptr aEvent to this ctor, e.g.:
nsDOMFooEvent::nsDOMFooEvent(..., nsEvent* aEvent)
nsDOMFooEvent::nsDOMFooEvent(..., WidgetEvent* aEvent)
: nsDOMEvent(..., aEvent ? aEvent : new nsFooEvent())
Then, to override the mEventIsInternal assignments done by the
base ctor, it should do this in its own ctor:
nsDOMFooEvent::nsDOMFooEvent(..., nsEvent* aEvent)
nsDOMFooEvent::nsDOMFooEvent(..., WidgetEvent* aEvent)
...
{
...
@ -87,7 +87,7 @@ nsDOMEvent::ConstructorInit(mozilla::dom::EventTarget* aOwner,
...
}
*/
mEvent = new nsEvent(false, 0);
mEvent = new WidgetEvent(false, 0);
mEvent->time = PR_Now();
}
@ -506,18 +506,18 @@ nsDOMEvent::DuplicatePrivateData()
// FIXME! Simplify this method and make it somehow easily extendable,
// Bug 329127
NS_ASSERTION(mEvent, "No nsEvent for nsDOMEvent duplication!");
NS_ASSERTION(mEvent, "No WidgetEvent for nsDOMEvent duplication!");
if (mEventIsInternal) {
return NS_OK;
}
nsEvent* newEvent = nullptr;
WidgetEvent* newEvent = nullptr;
uint32_t msg = mEvent->message;
switch (mEvent->eventStructType) {
case NS_EVENT:
{
newEvent = new nsEvent(false, msg);
newEvent = new WidgetEvent(false, msg);
newEvent->AssignEventData(*mEvent, true);
break;
}
@ -790,7 +790,7 @@ nsDOMEvent::IsDispatchStopped()
return mEvent->mFlags.mPropagationStopped;
}
NS_IMETHODIMP_(nsEvent*)
NS_IMETHODIMP_(WidgetEvent*)
nsDOMEvent::GetInternalNSEvent()
{
return mEvent;
@ -844,7 +844,7 @@ PopupAllowedForEvent(const char *eventName)
// static
PopupControlState
nsDOMEvent::GetEventPopupControlState(nsEvent *aEvent)
nsDOMEvent::GetEventPopupControlState(WidgetEvent* aEvent)
{
// generally if an event handler is running, new windows are disallowed.
// check for exceptions:
@ -1024,7 +1024,7 @@ nsDOMEvent::Shutdown()
nsIntPoint
nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
LayoutDeviceIntPoint aPoint)
{
if (nsEventStateManager::sIsPointerLocked) {
@ -1056,7 +1056,7 @@ nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
//static
CSSIntPoint
nsDOMEvent::GetPageCoords(nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
LayoutDeviceIntPoint aPoint,
CSSIntPoint aDefaultPoint)
{
@ -1080,7 +1080,7 @@ nsDOMEvent::GetPageCoords(nsPresContext* aPresContext,
// static
CSSIntPoint
nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
LayoutDeviceIntPoint aPoint,
CSSIntPoint aDefaultPoint)
{
@ -1129,7 +1129,7 @@ const char* nsDOMEvent::GetEventName(uint32_t aEventType)
default:
break;
}
// XXXldb We can hit this case for nsEvent objects that we didn't
// XXXldb We can hit this case for WidgetEvent objects that we didn't
// create and that are not user defined events since this function and
// SetEventType are incomplete. (But fixing that requires fixing the
// arrays in nsEventListenerManager too, since the events for which
@ -1244,7 +1244,7 @@ nsDOMEvent::SetOwner(mozilla::dom::EventTarget* aOwner)
nsresult NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent *aEvent)
WidgetEvent* aEvent)
{
nsRefPtr<nsDOMEvent> it =
new nsDOMEvent(aOwner, aPresContext, aEvent);

View File

@ -41,12 +41,13 @@ class nsDOMEvent : public nsDOMEventBase,
{
public:
nsDOMEvent(mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
nsDOMEvent(nsPIDOMWindow* aWindow);
virtual ~nsDOMEvent();
private:
void ConstructorInit(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent);
nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent);
public:
void GetParentObject(nsIScriptGlobalObject** aParentObject)
{
@ -97,7 +98,8 @@ public:
// Returns true if the event should be trusted.
bool Init(mozilla::dom::EventTarget* aGlobal);
static PopupControlState GetEventPopupControlState(nsEvent *aEvent);
static PopupControlState GetEventPopupControlState(
mozilla::WidgetEvent* aEvent);
static void PopupAllowedEventsChanged();
@ -105,15 +107,18 @@ public:
static const char* GetEventName(uint32_t aEventType);
static mozilla::CSSIntPoint
GetClientCoords(nsPresContext* aPresContext, nsEvent* aEvent,
GetClientCoords(nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent,
mozilla::LayoutDeviceIntPoint aPoint,
mozilla::CSSIntPoint aDefaultPoint);
static mozilla::CSSIntPoint
GetPageCoords(nsPresContext* aPresContext, nsEvent* aEvent,
GetPageCoords(nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent,
mozilla::LayoutDeviceIntPoint aPoint,
mozilla::CSSIntPoint aDefaultPoint);
static nsIntPoint
GetScreenCoords(nsPresContext* aPresContext, nsEvent* aEvent,
GetScreenCoords(nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent,
mozilla::LayoutDeviceIntPoint aPoint);
static already_AddRefed<nsDOMEvent> Constructor(const mozilla::dom::GlobalObject& aGlobal,
@ -185,7 +190,7 @@ protected:
void SetEventType(const nsAString& aEventTypeArg);
already_AddRefed<nsIContent> GetTargetFromFrame();
nsEvent* mEvent;
mozilla::WidgetEvent* mEvent;
nsRefPtr<nsPresContext> mPresContext;
nsCOMPtr<mozilla::dom::EventTarget> mExplicitOriginalTarget;
nsCOMPtr<nsPIDOMWindow> mOwner; // nsPIDOMWindow for now.
@ -216,7 +221,7 @@ protected:
NS_IMETHOD GetIsTrusted(bool* aIsTrusted) { return _to GetIsTrusted(aIsTrusted); } \
NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget) { return _to SetTarget(aTarget); } \
NS_IMETHOD_(bool) IsDispatchStopped(void) { return _to IsDispatchStopped(); } \
NS_IMETHOD_(nsEvent *) GetInternalNSEvent(void) { return _to GetInternalNSEvent(); } \
NS_IMETHOD_(mozilla::WidgetEvent*) GetInternalNSEvent(void) { return _to GetInternalNSEvent(); } \
NS_IMETHOD_(void) SetTrusted(bool aTrusted) { _to SetTrusted(aTrusted); } \
NS_IMETHOD_(void) SetOwner(mozilla::dom::EventTarget* aOwner) { _to SetOwner(aOwner); } \
NS_IMETHOD_(nsDOMEvent *) InternalDOMEvent(void) { return _to InternalDOMEvent(); }

View File

@ -308,7 +308,7 @@ nsDOMEventTargetHelper::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
}
nsresult
nsDOMEventTargetHelper::DispatchDOMEvent(nsEvent* aEvent,
nsDOMEventTargetHelper::DispatchDOMEvent(WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsPresContext* aPresContext,
nsEventStatus* aEventStatus)

View File

@ -216,7 +216,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsDOMEventTargetHelper,
virtual nsresult PostHandleEvent(nsEventChainPostVisitor & aVisitor) { \
return _to PostHandleEvent(aVisitor); \
} \
virtual nsresult DispatchDOMEvent(nsEvent *aEvent, nsIDOMEvent *aDOMEvent, nsPresContext *aPresContext, nsEventStatus *aEventStatus) { \
virtual nsresult DispatchDOMEvent(mozilla::WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent, nsPresContext* aPresContext, nsEventStatus* aEventStatus) { \
return _to DispatchDOMEvent(aEvent, aDOMEvent, aPresContext, aEventStatus); \
} \
virtual nsEventListenerManager * GetListenerManager(bool aMayCreate) { \

View File

@ -43,7 +43,7 @@ NS_IMPL_RELEASE_INHERITED(nsDOMMessageEvent, nsDOMEvent)
nsDOMMessageEvent::nsDOMMessageEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent)
WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent),
mData(JSVAL_VOID)
{
@ -197,7 +197,7 @@ nsresult
NS_NewDOMMessageEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent)
WidgetEvent* aEvent)
{
nsDOMMessageEvent* it = new nsDOMMessageEvent(aOwner, aPresContext, aEvent);

View File

@ -30,7 +30,8 @@ class nsDOMMessageEvent : public nsDOMEvent,
{
public:
nsDOMMessageEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent);
nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent);
~nsDOMMessageEvent();
NS_DECL_ISUPPORTS_INHERITED

View File

@ -15,7 +15,7 @@ using namespace mozilla::dom;
nsDOMNotifyAudioAvailableEvent::nsDOMNotifyAudioAvailableEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
uint32_t aEventType,
float* aFrameBuffer,
uint32_t aFrameBufferLength,
@ -156,7 +156,7 @@ nsDOMNotifyAudioAvailableEvent::InitAudioAvailableEvent(const nsAString& aType,
nsresult NS_NewDOMAudioAvailableEvent(nsIDOMEvent** aInstancePtrResult,
EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent *aEvent,
WidgetEvent* aEvent,
uint32_t aEventType,
float* aFrameBuffer,
uint32_t aFrameBufferLength,

View File

@ -19,7 +19,8 @@ class nsDOMNotifyAudioAvailableEvent : public nsDOMEvent,
{
public:
nsDOMNotifyAudioAvailableEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent,
nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent,
uint32_t aEventType, float * aFrameBuffer,
uint32_t aFrameBufferLength, float aTime);
@ -33,7 +34,7 @@ public:
nsresult NS_NewDOMAudioAvailableEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent *aEvent,
mozilla::WidgetEvent* aEvent,
uint32_t aEventType,
float * aFrameBuffer,
uint32_t aFrameBufferLength,

View File

@ -11,11 +11,12 @@
#include "nsPaintRequest.h"
#include "mozilla/dom/DOMRect.h"
using namespace mozilla;
using namespace mozilla::dom;
nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
uint32_t aEventType,
nsInvalidateRequestList* aInvalidateRequests)
: nsDOMEvent(aOwner, aPresContext, aEvent)
@ -157,7 +158,7 @@ nsDOMNotifyPaintEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
nsresult NS_NewDOMNotifyPaintEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent *aEvent,
WidgetEvent* aEvent,
uint32_t aEventType,
nsInvalidateRequestList* aInvalidateRequests)
{

View File

@ -30,7 +30,7 @@ class nsDOMNotifyPaintEvent : public nsDOMEvent,
public:
nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
uint32_t aEventType,
nsInvalidateRequestList* aInvalidateRequests);

View File

@ -38,7 +38,8 @@ public:
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
static nsIntPoint
CalculateScreenPoint(nsPresContext* aPresContext, nsEvent* aEvent)
CalculateScreenPoint(nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent)
{
if (!aEvent ||
(aEvent->eventStructType != NS_MOUSE_EVENT &&
@ -63,7 +64,7 @@ public:
}
static CSSIntPoint CalculateClientPoint(nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
CSSIntPoint* aDefaultClientPoint)
{
if (!aEvent ||

View File

@ -389,14 +389,14 @@ EventTargetChainItemForChromeTarget(nsTArray<nsEventTargetChainItem>& aChain,
/* static */ nsresult
nsEventDispatcher::Dispatch(nsISupports* aTarget,
nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsEventStatus* aEventStatus,
nsDispatchingCallback* aCallback,
nsCOMArray<EventTarget>* aTargets)
{
PROFILER_LABEL("nsEventDispatcher", "Dispatch");
NS_ASSERTION(aEvent, "Trying to dispatch without nsEvent!");
NS_ASSERTION(aEvent, "Trying to dispatch without WidgetEvent!");
NS_ENSURE_TRUE(!aEvent->mFlags.mIsBeingDispatched,
NS_ERROR_DOM_INVALID_STATE_ERR);
NS_ASSERTION(!aTargets || !aEvent->message, "Wrong parameters!");
@ -463,7 +463,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
}
if (aDOMEvent) {
nsEvent* innerEvent = aDOMEvent->GetInternalNSEvent();
WidgetEvent* innerEvent = aDOMEvent->GetInternalNSEvent();
NS_ASSERTION(innerEvent == aEvent,
"The inner event of aDOMEvent is not the same as aEvent!");
}
@ -648,13 +648,13 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
/* static */ nsresult
nsEventDispatcher::DispatchDOMEvent(nsISupports* aTarget,
nsEvent* aEvent,
WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsPresContext* aPresContext,
nsEventStatus* aEventStatus)
{
if (aDOMEvent) {
nsEvent* innerEvent = aDOMEvent->GetInternalNSEvent();
WidgetEvent* innerEvent = aDOMEvent->GetInternalNSEvent();
NS_ENSURE_TRUE(innerEvent, NS_ERROR_ILLEGAL_VALUE);
bool dontResetTrusted = false;
@ -682,7 +682,7 @@ nsEventDispatcher::DispatchDOMEvent(nsISupports* aTarget,
/* static */ nsresult
nsEventDispatcher::CreateEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
const nsAString& aEventType,
nsIDOMEvent** aDOMEvent)
{

View File

@ -510,7 +510,8 @@ nsEventListenerManager::RemoveEventListenerInternal(
}
bool
nsEventListenerManager::ListenerCanHandle(nsListenerStruct* aLs, nsEvent* aEvent)
nsEventListenerManager::ListenerCanHandle(nsListenerStruct* aLs,
WidgetEvent* aEvent)
{
// This is slightly different from EVENT_TYPE_EQUALS in that it returns
// true even when aEvent->message == NS_USER_DEFINED_EVENT and
@ -968,7 +969,7 @@ nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct,
void
nsEventListenerManager::HandleEventInternal(nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
nsIDOMEvent** aDOMEvent,
EventTarget* aCurrentTarget,
nsEventStatus* aEventStatus,

View File

@ -187,7 +187,7 @@ struct nsListenerStruct
}
}
MOZ_ALWAYS_INLINE bool IsListening(const nsEvent* aEvent) const
MOZ_ALWAYS_INLINE bool IsListening(const mozilla::WidgetEvent* aEvent) const
{
if (mFlags.mInSystemGroup != aEvent->mFlags.mInSystemGroup) {
return false;
@ -298,7 +298,7 @@ public:
void RemoveEventHandler(nsIAtom *aName, const nsAString& aTypeString);
void HandleEvent(nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
nsIDOMEvent** aDOMEvent,
mozilla::dom::EventTarget* aCurrentTarget,
nsEventStatus* aEventStatus,
@ -405,7 +405,7 @@ public:
mozilla::dom::EventTarget* GetTarget() { return mTarget; }
protected:
void HandleEventInternal(nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
nsIDOMEvent** aDOMEvent,
mozilla::dom::EventTarget* aCurrentTarget,
nsEventStatus* aEventStatus,
@ -528,7 +528,7 @@ protected:
nsPIDOMWindow* GetInnerWindowForTarget();
already_AddRefed<nsPIDOMWindow> GetTargetAsInnerWindow() const;
bool ListenerCanHandle(nsListenerStruct* aLs, nsEvent* aEvent);
bool ListenerCanHandle(nsListenerStruct* aLs, mozilla::WidgetEvent* aEvent);
uint32_t mMayHavePaintEventListener : 1;
uint32_t mMayHaveMutationListeners : 1;

View File

@ -19,6 +19,7 @@
#include "mozilla/Maybe.h"
#include "nsServiceManagerUtils.h"
using namespace mozilla;
using namespace mozilla::dom;
using mozilla::AutoSafeJSContext;
@ -192,7 +193,7 @@ nsEventListenerService::GetEventTargetChainFor(nsIDOMEventTarget* aEventTarget,
*aCount = 0;
*aOutArray = nullptr;
NS_ENSURE_ARG(aEventTarget);
nsEvent event(true, NS_EVENT_NULL);
WidgetEvent event(true, NS_EVENT_NULL);
nsCOMArray<EventTarget> targets;
nsresult rv = nsEventDispatcher::Dispatch(aEventTarget, nullptr, &event,
nullptr, nullptr, nullptr, &targets);

View File

@ -132,7 +132,7 @@ RoundDown(double aDouble)
}
static inline bool
IsMouseEventReal(nsEvent* aEvent)
IsMouseEventReal(WidgetEvent* aEvent)
{
NS_ABORT_IF_FALSE(aEvent->IsMouseDerivedEvent(), "Not a mouse event");
// Return true if not synthesized.
@ -277,7 +277,7 @@ public:
// frame might be destroyed in the event handler.
static bool UpdateTransaction(WheelEvent* aEvent);
static void EndTransaction();
static void OnEvent(nsEvent* aEvent);
static void OnEvent(WidgetEvent* aEvent);
static void Shutdown();
static uint32_t GetTimeoutTime();
@ -375,7 +375,7 @@ nsMouseWheelTransaction::UpdateTransaction(WheelEvent* aEvent)
sScrollSeriesCounter = 0;
sScrollSeriesCounter++;
// We should use current time instead of nsEvent.time.
// We should use current time instead of WidgetEvent.time.
// 1. Some events doesn't have the correct creation time.
// 2. If the computer runs slowly by other processes eating the CPU resource,
// the event creation time doesn't keep real time.
@ -394,7 +394,7 @@ nsMouseWheelTransaction::EndTransaction()
}
void
nsMouseWheelTransaction::OnEvent(nsEvent* aEvent)
nsMouseWheelTransaction::OnEvent(WidgetEvent* aEvent)
{
if (!sTargetFrame)
return;
@ -780,7 +780,7 @@ NS_IMPL_CYCLE_COLLECTION_17(nsEventStateManager,
nsresult
nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
nsEvent *aEvent,
WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus* aStatus)
{
@ -1377,7 +1377,7 @@ nsEventStateManager::HandleAccessKey(nsPresContext* aPresContext,
}// end of HandleAccessKey
bool
nsEventStateManager::DispatchCrossProcessEvent(nsEvent* aEvent,
nsEventStateManager::DispatchCrossProcessEvent(WidgetEvent* aEvent,
nsFrameLoader* aFrameLoader,
nsEventStatus *aStatus) {
PBrowserParent* remoteBrowser = aFrameLoader->GetRemoteBrowser();
@ -1438,7 +1438,7 @@ nsEventStateManager::IsRemoteTarget(nsIContent* target) {
/*static*/ LayoutDeviceIntPoint
nsEventStateManager::GetChildProcessOffset(nsFrameLoader* aFrameLoader,
const nsEvent& aEvent)
const WidgetEvent& aEvent)
{
// The "toplevel widget" in child processes is always at position
// 0,0. Map the event coordinates to match that.
@ -1455,7 +1455,7 @@ nsEventStateManager::GetChildProcessOffset(nsFrameLoader* aFrameLoader,
}
bool
CrossProcessSafeEvent(const nsEvent& aEvent)
CrossProcessSafeEvent(const WidgetEvent& aEvent)
{
switch (aEvent.eventStructType) {
case NS_KEY_EVENT:
@ -1487,7 +1487,7 @@ CrossProcessSafeEvent(const nsEvent& aEvent)
}
bool
nsEventStateManager::HandleCrossProcessEvent(nsEvent *aEvent,
nsEventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus *aStatus) {
if (*aStatus == nsEventStatus_eConsumeNoDefault ||
@ -2933,7 +2933,7 @@ NodeAllowsClickThrough(nsINode* aNode)
nsresult
nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
nsEvent *aEvent,
WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus* aStatus)
{
@ -3450,7 +3450,7 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
}
bool
nsEventStateManager::RemoteQueryContentEvent(nsEvent *aEvent)
nsEventStateManager::RemoteQueryContentEvent(WidgetEvent* aEvent)
{
WidgetQueryContentEvent *queryEvent =
static_cast<WidgetQueryContentEvent*>(aEvent);
@ -3508,7 +3508,8 @@ nsEventStateManager::ClearFrameRefs(nsIFrame* aFrame)
void
nsEventStateManager::UpdateCursor(nsPresContext* aPresContext,
nsEvent* aEvent, nsIFrame* aTargetFrame,
WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus* aStatus)
{
if (aTargetFrame && IsRemoteTarget(aTargetFrame->GetContent())) {
@ -4495,7 +4496,7 @@ nsEventStateManager::GetEventTarget()
}
already_AddRefed<nsIContent>
nsEventStateManager::GetEventTargetContent(nsEvent* aEvent)
nsEventStateManager::GetEventTargetContent(WidgetEvent* aEvent)
{
if (aEvent &&
(aEvent->message == NS_FOCUS_CONTENT ||

View File

@ -69,7 +69,7 @@ public:
* DOM or frame event handling should occur here as well.
*/
nsresult PreHandleEvent(nsPresContext* aPresContext,
nsEvent *aEvent,
mozilla::WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus* aStatus);
@ -79,7 +79,7 @@ public:
* DOM and frame processing.
*/
nsresult PostHandleEvent(nsPresContext* aPresContext,
nsEvent *aEvent,
mozilla::WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus* aStatus);
@ -96,7 +96,8 @@ public:
void ClearFrameRefs(nsIFrame* aFrame);
nsIFrame* GetEventTarget();
already_AddRefed<nsIContent> GetEventTargetContent(nsEvent* aEvent);
already_AddRefed<nsIContent> GetEventTargetContent(
mozilla::WidgetEvent* aEvent);
/**
* Notify that the given NS_EVENT_STATE_* bit has changed for this content.
@ -190,8 +191,9 @@ public:
static void SetFullScreenState(mozilla::dom::Element* aElement, bool aIsFullScreen);
static bool IsRemoteTarget(nsIContent* aTarget);
static LayoutDeviceIntPoint GetChildProcessOffset(nsFrameLoader* aFrameLoader,
const nsEvent& aEvent);
static LayoutDeviceIntPoint GetChildProcessOffset(
nsFrameLoader* aFrameLoader,
const mozilla::WidgetEvent& aEvent);
// Holds the point in screen coords that a mouse event was dispatched to,
// before we went into pointer lock mode. This is constantly updated while
@ -244,7 +246,10 @@ protected:
*/
static int32_t GetAccessModifierMaskFor(nsISupports* aDocShell);
void UpdateCursor(nsPresContext* aPresContext, nsEvent* aEvent, nsIFrame* aTargetFrame, nsEventStatus* aStatus);
void UpdateCursor(nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus* aStatus);
/**
* Turn a GUI mouse event into a mouse event targeted at the specified
* content. This returns the primary frame for the content (or null
@ -713,15 +718,16 @@ protected:
void DoQuerySelectedText(mozilla::WidgetQueryContentEvent* aEvent);
bool RemoteQueryContentEvent(nsEvent *aEvent);
bool RemoteQueryContentEvent(mozilla::WidgetEvent* aEvent);
mozilla::dom::TabParent *GetCrossProcessTarget();
bool IsTargetCrossProcess(mozilla::WidgetGUIEvent* aEvent);
bool DispatchCrossProcessEvent(nsEvent* aEvent, nsFrameLoader* remote,
nsEventStatus *aStatus);
bool HandleCrossProcessEvent(nsEvent *aEvent,
nsIFrame* aTargetFrame,
bool DispatchCrossProcessEvent(mozilla::WidgetEvent* aEvent,
nsFrameLoader* aRemote,
nsEventStatus *aStatus);
bool HandleCrossProcessEvent(mozilla::WidgetEvent* aEvent,
nsIFrame* aTargetFrame,
nsEventStatus* aStatus);
private:
static inline void DoStateChange(mozilla::dom::Element* aElement,
@ -834,7 +840,7 @@ class nsAutoHandlingUserInputStatePusher
{
public:
nsAutoHandlingUserInputStatePusher(bool aIsHandlingUserInput,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
nsIDocument* aDocument)
: mIsHandlingUserInput(aIsHandlingUserInput),
mIsMouseDown(aEvent && aEvent->message == NS_MOUSE_BUTTON_DOWN),

View File

@ -522,7 +522,7 @@ nsIMEStateManager::EnsureTextCompositionArray()
void
nsIMEStateManager::DispatchCompositionEvent(nsINode* aEventTargetNode,
nsPresContext* aPresContext,
nsEvent* aEvent,
WidgetEvent* aEvent,
nsEventStatus* aStatus,
nsDispatchingCallback* aCallBack)
{

View File

@ -90,7 +90,7 @@ public:
*/
static void DispatchCompositionEvent(nsINode* aEventTargetNode,
nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
nsEventStatus* aStatus,
nsDispatchingCallback* aCallBack);

View File

@ -707,7 +707,7 @@ HTMLFormElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
}
nsresult
HTMLFormElement::DoSubmitOrReset(nsEvent* aEvent,
HTMLFormElement::DoSubmitOrReset(WidgetEvent* aEvent,
int32_t aMessage)
{
// Make sure the presentation is up-to-date
@ -759,7 +759,7 @@ HTMLFormElement::DoReset()
}
nsresult
HTMLFormElement::DoSubmit(nsEvent* aEvent)
HTMLFormElement::DoSubmit(WidgetEvent* aEvent)
{
NS_ASSERTION(GetCurrentDoc(), "Should never get here without a current doc");
@ -814,7 +814,7 @@ HTMLFormElement::DoSubmit(nsEvent* aEvent)
nsresult
HTMLFormElement::BuildSubmission(nsFormSubmission** aFormSubmission,
nsEvent* aEvent)
WidgetEvent* aEvent)
{
NS_ASSERTION(!mPendingSubmission, "tried to build two submissions!");

View File

@ -438,7 +438,7 @@ protected:
nsRefPtr<HTMLFormElement> mForm;
};
nsresult DoSubmitOrReset(nsEvent* aEvent,
nsresult DoSubmitOrReset(WidgetEvent* aEvent,
int32_t aMessage);
nsresult DoReset();
@ -456,7 +456,7 @@ protected:
* @param aPresContext the presentation context
* @param aEvent the DOM event that was passed to us for the submit
*/
nsresult DoSubmit(nsEvent* aEvent);
nsresult DoSubmit(WidgetEvent* aEvent);
/**
* Prepare the submission object (called by DoSubmit)
@ -465,7 +465,7 @@ protected:
* @param aEvent the DOM event that was passed to us for the submit
*/
nsresult BuildSubmission(nsFormSubmission** aFormSubmission,
nsEvent* aEvent);
WidgetEvent* aEvent);
/**
* Perform the submission (called by DoSubmit and FlushPendingSubmission)
*

View File

@ -2917,7 +2917,7 @@ HTMLInputElement::DispatchSelectEvent(nsPresContext* aPresContext)
// If already handling select event, don't dispatch a second.
if (!mHandlingSelectEvent) {
nsEvent event(nsContentUtils::IsCallerChrome(), NS_FORM_SELECTED);
WidgetEvent event(nsContentUtils::IsCallerChrome(), NS_FORM_SELECTED);
mHandlingSelectEvent = true;
nsEventDispatcher::Dispatch(static_cast<nsIContent*>(this),

View File

@ -83,7 +83,7 @@ HTMLLabelElement::Focus(ErrorResult& aError)
}
static bool
EventTargetIn(nsEvent *aEvent, nsIContent *aChild, nsIContent *aStop)
EventTargetIn(WidgetEvent* aEvent, nsIContent* aChild, nsIContent* aStop)
{
nsCOMPtr<nsIContent> c = do_QueryInterface(aEvent->target);
nsIContent *content = c;

View File

@ -75,7 +75,7 @@ HTMLMenuElement::SendShowEvent()
return NS_ERROR_FAILURE;
}
nsEvent event(true, NS_SHOW_EVENT);
WidgetEvent event(true, NS_SHOW_EVENT);
event.mFlags.mBubbles = false;
event.mFlags.mCancelable = false;

View File

@ -775,7 +775,7 @@ nsTextInputListener::NotifySelectionChanged(nsIDOMDocument* aDoc, nsISelection*
if (presShell)
{
nsEventStatus status = nsEventStatus_eIgnore;
nsEvent event(true, NS_FORM_SELECTED);
WidgetEvent event(true, NS_FORM_SELECTED);
presShell->HandleEventWithTarget(&event, mFrame, content, &status);
}

View File

@ -22,7 +22,7 @@ NS_IMPL_RELEASE_INHERITED(AudioProcessingEvent, nsDOMEvent)
AudioProcessingEvent::AudioProcessingEvent(ScriptProcessorNode* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent)
WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent)
, mPlaybackTime(0.0)
, mNode(aOwner)

View File

@ -19,8 +19,8 @@ class AudioProcessingEvent : public nsDOMEvent,
{
public:
AudioProcessingEvent(ScriptProcessorNode* aOwner,
nsPresContext *aPresContext,
nsEvent *aEvent);
nsPresContext* aPresContext,
WidgetEvent* aEvent);
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_TO_NSDOMEVENT

View File

@ -22,7 +22,7 @@ NS_IMPL_RELEASE_INHERITED(OfflineAudioCompletionEvent, nsDOMEvent)
OfflineAudioCompletionEvent::OfflineAudioCompletionEvent(AudioContext* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent)
WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent)
{
SetIsDOMBinding();

View File

@ -20,8 +20,8 @@ class OfflineAudioCompletionEvent : public nsDOMEvent,
{
public:
OfflineAudioCompletionEvent(AudioContext* aOwner,
nsPresContext *aPresContext,
nsEvent *aEvent);
nsPresContext* aPresContext,
WidgetEvent* aEvent);
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_TO_NSDOMEVENT

View File

@ -11,7 +11,8 @@
using namespace mozilla;
nsDOMTimeEvent::nsDOMTimeEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent)
nsPresContext* aPresContext,
WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext,
aEvent ? aEvent : new InternalUIEvent(false, 0, 0)),
mDetail(0)
@ -86,7 +87,7 @@ nsDOMTimeEvent::InitTimeEvent(const nsAString& aTypeArg,
nsresult NS_NewDOMTimeEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent)
WidgetEvent* aEvent)
{
nsDOMTimeEvent* it = new nsDOMTimeEvent(aOwner, aPresContext, aEvent);
return CallQueryInterface(it, aInstancePtrResult);

View File

@ -15,7 +15,8 @@ class nsDOMTimeEvent MOZ_FINAL : public nsDOMEvent,
{
public:
nsDOMTimeEvent(mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext, nsEvent* aEvent);
nsPresContext* aPresContext,
mozilla::WidgetEvent* aEvent);
// nsISupports interface:
NS_DECL_ISUPPORTS_INHERITED

View File

@ -910,7 +910,7 @@ bool
nsXBLPrototypeHandler::ModifiersMatchMask(nsIDOMUIEvent* aEvent,
bool aIgnoreShiftKey)
{
nsEvent* event = aEvent->GetInternalNSEvent();
WidgetEvent* event = aEvent->GetInternalNSEvent();
NS_ENSURE_TRUE(event && event->IsInputDerivedEvent(), false);
WidgetInputEvent* inputEvent = static_cast<WidgetInputEvent*>(event);

View File

@ -581,7 +581,7 @@ XMLDocument::EndLoad()
// Generate a document load event for the case when an XML
// document was loaded as pure data without any presentation
// attached to it.
nsEvent event(true, NS_LOAD);
WidgetEvent event(true, NS_LOAD);
nsEventDispatcher::Dispatch(static_cast<nsIDocument*>(this), nullptr,
&event);
}

View File

@ -614,7 +614,7 @@ protected:
nsresult ExecuteOnBroadcastHandler(nsIDOMElement* anElement, const nsAString& attrName);
static nsresult
ExecuteJSCode(nsIDOMElement* anElement, nsEvent* aEvent);
ExecuteJSCode(nsIDOMElement* anElement, mozilla::WidgetEvent* aEvent);
// Helper routine that crawls a parent chain looking for a tree element.
NS_IMETHOD GetParentTree(nsIDOMXULMultiSelectControlElement** aTreeElement);

View File

@ -940,7 +940,7 @@ XULDocument::ExecuteOnBroadcastHandlerFor(Element* aBroadcaster,
// This is the right <observes> element. Execute the
// |onbroadcast| event handler
nsEvent event(true, NS_XUL_BROADCAST);
WidgetEvent event(true, NS_XUL_BROADCAST);
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {

View File

@ -35,6 +35,8 @@
#include "mozilla/BasicEvents.h"
#include "mozilla/dom/Element.h"
using namespace mozilla;
#ifdef PR_LOGGING
static PRLogModuleInfo* gLog;
#endif
@ -419,7 +421,7 @@ nsXULCommandDispatcher::UpdateCommands(const nsAString& aEventName)
// Handle the DOM event
nsEventStatus status = nsEventStatus_eIgnore;
nsEvent event(true, NS_XUL_COMMAND_UPDATE);
WidgetEvent event(true, NS_XUL_COMMAND_UPDATE);
nsEventDispatcher::Dispatch(content, context, &event, nullptr, &status);
}

View File

@ -1768,7 +1768,7 @@ nsDOMWindowUtils::DispatchDOMEventViaPresShell(nsIDOMNode* aTarget,
NS_ENSURE_STATE(aEvent);
aEvent->SetTrusted(aTrusted);
nsEvent* internalEvent = aEvent->GetInternalNSEvent();
WidgetEvent* internalEvent = aEvent->GetInternalNSEvent();
NS_ENSURE_STATE(internalEvent);
nsCOMPtr<nsIContent> content = do_QueryInterface(aTarget);
NS_ENSURE_STATE(content);

View File

@ -3055,7 +3055,7 @@ nsGlobalWindow::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
// onload event for the frame element.
nsEventStatus status = nsEventStatus_eIgnore;
nsEvent event(aVisitor.mEvent->mFlags.mIsTrusted, NS_LOAD);
WidgetEvent event(aVisitor.mEvent->mFlags.mIsTrusted, NS_LOAD);
event.mFlags.mBubbles = false;
// Most of the time we could get a pres context to pass in here,
@ -3071,7 +3071,7 @@ nsGlobalWindow::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
}
nsresult
nsGlobalWindow::DispatchDOMEvent(nsEvent* aEvent,
nsGlobalWindow::DispatchDOMEvent(WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsPresContext* aPresContext,
nsEventStatus* aEventStatus)
@ -7000,7 +7000,7 @@ PostMessageEvent::Run()
presContext = shell->GetPresContext();
message->SetTrusted(mTrustedCaller);
nsEvent *internalEvent = message->GetInternalNSEvent();
WidgetEvent* internalEvent = message->GetInternalNSEvent();
nsEventStatus status = nsEventStatus_eIgnore;
nsEventDispatcher::Dispatch(static_cast<nsPIDOMWindow*>(mTargetWindow),
@ -9890,7 +9890,7 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
event->SetTrusted(true);
if (fireMozStorageChanged) {
nsEvent *internalEvent = event->GetInternalNSEvent();
WidgetEvent* internalEvent = event->GetInternalNSEvent();
internalEvent->mFlags.mOnlyChromeDispatch = true;
}
@ -11787,7 +11787,7 @@ nsGlobalChromeWindow::BeginWindowMove(nsIDOMEvent *aMouseDownEvent, nsIDOMElemen
}
NS_ENSURE_TRUE(aMouseDownEvent, NS_ERROR_FAILURE);
nsEvent *internalEvent = aMouseDownEvent->GetInternalNSEvent();
WidgetEvent* internalEvent = aMouseDownEvent->GetInternalNSEvent();
NS_ENSURE_TRUE(internalEvent &&
internalEvent->eventStructType == NS_MOUSE_EVENT,
NS_ERROR_FAILURE);

View File

@ -84,7 +84,7 @@ nsWindowRoot::DispatchEvent(nsIDOMEvent* aEvt, bool *aRetVal)
}
nsresult
nsWindowRoot::DispatchDOMEvent(nsEvent* aEvent,
nsWindowRoot::DispatchDOMEvent(WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsPresContext* aPresContext,
nsEventStatus* aEventStatus)

View File

@ -3466,10 +3466,10 @@ nsDOMDeviceStorage::PostHandleEvent(nsEventChainPostVisitor & aVisitor)
}
nsresult
nsDOMDeviceStorage::DispatchDOMEvent(nsEvent *aEvent,
nsIDOMEvent *aDOMEvent,
nsPresContext *aPresContext,
nsEventStatus *aEventStatus)
nsDOMDeviceStorage::DispatchDOMEvent(WidgetEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsPresContext* aPresContext,
nsEventStatus* aEventStatus)
{
return nsDOMEventTargetHelper::DispatchDOMEvent(aEvent,
aDOMEvent,

View File

@ -25,6 +25,7 @@
#include "ipc/IndexedDBChild.h"
#include "ipc/IndexedDBParent.h"
using namespace mozilla;
USING_INDEXEDDB_NAMESPACE
using mozilla::dom::quota::QuotaManager;
@ -466,7 +467,7 @@ AsyncConnectionHelper::OnSuccess()
nsresult rv = mRequest->DispatchEvent(event, &dummy);
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
nsEvent* internalEvent = event->GetInternalNSEvent();
WidgetEvent* internalEvent = event->GetInternalNSEvent();
NS_ASSERTION(internalEvent, "This should never be null!");
NS_ASSERTION(!mTransaction ||
@ -509,7 +510,7 @@ AsyncConnectionHelper::OnError()
mTransaction->IsAborted(),
"How else can this be closed?!");
nsEvent* internalEvent = event->GetInternalNSEvent();
WidgetEvent* internalEvent = event->GetInternalNSEvent();
NS_ASSERTION(internalEvent, "This should never be null!");
if (internalEvent->mFlags.mExceptionHasBeenRisen &&

View File

@ -749,7 +749,7 @@ interface nsIDOMWindowUtils : nsISupports {
in boolean aTrusted);
/**
* Sets nsEvent::mFlags::mOnlyChromeDispatch to true to ensure that
* Sets WidgetEvent::mFlags::mOnlyChromeDispatch to true to ensure that
* the event is propagated only to chrome.
* Event's .target property will be aTarget.
* Returns the same value as what EventTarget.dispatchEvent does.

View File

@ -7,7 +7,7 @@
interface nsIDOMEventTarget;
[ptr] native nsEventPtr(nsEvent);
[ptr] native WidgetEventPtr(mozilla::WidgetEvent);
[ptr] native nsDOMEventPtr(nsDOMEvent);
[ptr] native IPCMessagePtr(IPC::Message);
[ptr] native ConstIPCMessagePtr(const IPC::Message);
@ -206,7 +206,7 @@ interface nsIDOMEvent : nsISupports
[noscript] void duplicatePrivateData();
[noscript] void setTarget(in nsIDOMEventTarget aTarget);
[notxpcom] boolean IsDispatchStopped();
[notxpcom] nsEventPtr GetInternalNSEvent();
[notxpcom] WidgetEventPtr GetInternalNSEvent();
[noscript,notxpcom] void SetTrusted(in boolean aTrusted);
[notxpcom] void Serialize(in IPCMessagePtr aMsg,
in boolean aSerializeInterfaceType);
@ -227,12 +227,12 @@ nsresult
NS_NewDOMEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent *aEvent);
mozilla::WidgetEvent* aEvent);
nsresult
NS_NewDOMDataContainerEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
nsresult
NS_NewDOMUIEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
@ -288,7 +288,7 @@ nsresult
NS_NewDOMDeviceMotionEvent(nsIDOMEvent** aResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
nsresult
NS_NewDOMTextEvent(nsIDOMEvent** aResult,
mozilla::dom::EventTarget* aOwner,
@ -298,12 +298,12 @@ nsresult
NS_NewDOMBeforeUnloadEvent(nsIDOMEvent** aResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
nsresult
NS_NewDOMSVGEvent(nsIDOMEvent** aResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
nsresult
NS_NewDOMSVGZoomEvent(nsIDOMEvent** aResult,
mozilla::dom::EventTarget* aOwner,
@ -313,7 +313,7 @@ nsresult
NS_NewDOMTimeEvent(nsIDOMEvent** aResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
nsresult
NS_NewDOMXULCommandEvent(nsIDOMEvent** aResult,
mozilla::dom::EventTarget* aOwner,
@ -328,25 +328,25 @@ nsresult
NS_NewDOMMessageEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
nsresult
NS_NewDOMProgressEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
// This empties aInvalidateRequests.
nsresult
NS_NewDOMNotifyPaintEvent(nsIDOMEvent** aResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
uint32_t aEventType = 0,
nsInvalidateRequestList* aInvalidateRequests = nullptr);
nsresult
NS_NewDOMAudioAvailableEvent(nsIDOMEvent** aResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent,
mozilla::WidgetEvent* aEvent,
uint32_t aEventType = 0,
float* aFrameBuffer = nullptr,
uint32_t aFrameBufferLength = 0,
@ -380,10 +380,10 @@ nsresult
NS_NewDOMMozSettingsEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
nsresult
NS_NewDOMMozApplicationEvent(nsIDOMEvent** aInstancePtrResult,
mozilla::dom::EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
%}

View File

@ -34,7 +34,7 @@ class nsEventListenerManager;
[ref] native nsEventChainPreVisitorRef(nsEventChainPreVisitor);
[ref] native nsEventChainPostVisitorRef(nsEventChainPostVisitor);
[ptr] native nsEventPtr(nsEvent);
[ptr] native WidgetEventPtr(mozilla::WidgetEvent);
[ptr] native nsPresContextPtr(nsPresContext);
[ptr] native nsEventStatusPtr(nsEventStatus);
[ptr] native JSContextPtr(JSContext);
@ -248,7 +248,7 @@ interface nsIDOMEventTarget : nsISupports
* Dispatch an event.
* @param aEvent the event that is being dispatched.
* @param aDOMEvent the event that is being dispatched, use if you want to
* dispatch nsIDOMEvent, not only nsEvent.
* dispatch nsIDOMEvent, not only WidgetEvent.
* @param aPresContext the current presentation context, can be nullptr.
* @param aEventStatus the status returned from the function, can be nullptr.
*
@ -262,7 +262,7 @@ interface nsIDOMEventTarget : nsISupports
* have been converted to use nsIDOMEventTarget::dispatchEvent.
*/
[noscript, nostdcall]
void DispatchDOMEvent(in nsEventPtr aEvent,
void DispatchDOMEvent(in WidgetEventPtr aEvent,
in nsIDOMEvent aDOMEvent,
in nsPresContextPtr aPresContext,
in nsEventStatusPtr aEventStatus);

View File

@ -602,7 +602,7 @@ TabParent::SendKeyEvent(const nsAString& aType,
}
bool
TabParent::MapEventCoordinatesForChildProcess(nsEvent* aEvent)
TabParent::MapEventCoordinatesForChildProcess(WidgetEvent* aEvent)
{
nsRefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
if (!frameLoader) {
@ -615,7 +615,7 @@ TabParent::MapEventCoordinatesForChildProcess(nsEvent* aEvent)
void
TabParent::MapEventCoordinatesForChildProcess(
const LayoutDeviceIntPoint& aOffset, nsEvent* aEvent)
const LayoutDeviceIntPoint& aOffset, WidgetEvent* aEvent)
{
if (aEvent->eventStructType != NS_TOUCH_EVENT) {
aEvent->refPoint = aOffset;

View File

@ -187,9 +187,9 @@ public:
void Activate();
void Deactivate();
bool MapEventCoordinatesForChildProcess(nsEvent* aEvent);
bool MapEventCoordinatesForChildProcess(mozilla::WidgetEvent* aEvent);
void MapEventCoordinatesForChildProcess(const LayoutDeviceIntPoint& aOffset,
nsEvent* aEvent);
mozilla::WidgetEvent* aEvent);
void SendMouseEvent(const nsAString& aType, float aX, float aY,
int32_t aButton, int32_t aClickCount,

View File

@ -1787,7 +1787,7 @@ nsresult nsPluginInstanceOwner::DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent)
}
#endif
nsEvent* theEvent = aFocusEvent->GetInternalNSEvent();
WidgetEvent* theEvent = aFocusEvent->GetInternalNSEvent();
if (theEvent) {
// we only care about the message in ProcessEvent
WidgetGUIEvent focusEvent(theEvent->mFlags.mIsTrusted, theEvent->message,
@ -1829,7 +1829,7 @@ nsresult nsPluginInstanceOwner::DispatchKeyToPlugin(nsIDOMEvent* aKeyEvent)
#endif
if (mInstance) {
nsEvent *event = aKeyEvent->GetInternalNSEvent();
WidgetEvent* event = aKeyEvent->GetInternalNSEvent();
if (event && event->eventStructType == NS_KEY_EVENT) {
nsEventStatus rv = ProcessEvent(*static_cast<WidgetGUIEvent*>(event));
if (nsEventStatus_eConsumeNoDefault == rv) {
@ -1863,7 +1863,7 @@ nsPluginInstanceOwner::ProcessMouseDown(nsIDOMEvent* aMouseEvent)
}
}
nsEvent* event = aMouseEvent->GetInternalNSEvent();
WidgetEvent* event = aMouseEvent->GetInternalNSEvent();
if (event && event->eventStructType == NS_MOUSE_EVENT) {
mLastMouseDownButtonType = static_cast<nsMouseEvent*>(event)->button;
nsEventStatus rv = ProcessEvent(*static_cast<WidgetGUIEvent*>(event));
@ -1886,7 +1886,7 @@ nsresult nsPluginInstanceOwner::DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent)
if (!mWidgetVisible)
return NS_OK;
nsEvent* event = aMouseEvent->GetInternalNSEvent();
WidgetEvent* event = aMouseEvent->GetInternalNSEvent();
if (event && event->eventStructType == NS_MOUSE_EVENT) {
nsEventStatus rv = ProcessEvent(*static_cast<WidgetGUIEvent*>(event));
if (nsEventStatus_eConsumeNoDefault == rv) {
@ -1950,7 +1950,7 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
nsCOMPtr<nsIDOMDragEvent> dragEvent(do_QueryInterface(aEvent));
if (dragEvent && mInstance) {
nsEvent* ievent = aEvent->GetInternalNSEvent();
WidgetEvent* ievent = aEvent->GetInternalNSEvent();
if ((ievent && ievent->mFlags.mIsTrusted) &&
ievent->message != NS_DRAGDROP_ENTER && ievent->message != NS_DRAGDROP_OVER) {
aEvent->PreventDefault();

View File

@ -176,7 +176,7 @@ nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
Optional<uint32_t> columnNumber;
NS_ENSURE_TRUE(aEvent, NS_ERROR_UNEXPECTED);
nsEvent* event = aEvent->GetInternalNSEvent();
WidgetEvent* event = aEvent->GetInternalNSEvent();
if (event->message == NS_LOAD_ERROR &&
event->eventStructType == NS_SCRIPT_ERROR_EVENT) {
InternalScriptErrorEvent *scriptEvent =

View File

@ -43,7 +43,7 @@ public:
private:
CallEvent(EventTarget* aOwner,
nsPresContext* aPresContext,
nsEvent* aEvent)
WidgetEvent* aEvent)
: nsDOMEvent(aOwner, aPresContext, aEvent)
{
SetIsDOMBinding();

View File

@ -1844,7 +1844,7 @@ public:
// Even if the change is caused by untrusted event, we need to dispatch
// trusted input event since it's a fact.
nsEvent inputEvent(true, NS_FORM_INPUT);
WidgetEvent inputEvent(true, NS_FORM_INPUT);
inputEvent.mFlags.mCancelable = false;
inputEvent.time = static_cast<uint64_t>(PR_Now() / 1000);
nsEventStatus status = nsEventStatus_eIgnore;
@ -5166,7 +5166,7 @@ WidgetKeyboardEvent*
nsEditor::GetNativeKeyEvent(nsIDOMKeyEvent* aDOMKeyEvent)
{
NS_ENSURE_TRUE(aDOMKeyEvent, nullptr);
nsEvent* nativeEvent = aDOMKeyEvent->GetInternalNSEvent();
WidgetEvent* nativeEvent = aDOMKeyEvent->GetInternalNSEvent();
NS_ENSURE_TRUE(nativeEvent, nullptr);
NS_ENSURE_TRUE(nativeEvent->eventStructType == NS_KEY_EVENT, nullptr);
return static_cast<WidgetKeyboardEvent*>(nativeEvent);

View File

@ -962,7 +962,7 @@ nsDocumentViewer::LoadComplete(nsresult aStatus)
if(window &&
(NS_SUCCEEDED(aStatus) || aStatus == NS_ERROR_PARSED_DATA_CACHED)) {
nsEventStatus status = nsEventStatus_eIgnore;
nsEvent event(true, NS_LOAD);
WidgetEvent event(true, NS_LOAD);
event.mFlags.mBubbles = false;
// XXX Dispatching to |window|, but using |document| as the target.
event.target = mDocument;
@ -1249,7 +1249,7 @@ nsDocumentViewer::PageHide(bool aIsUnload)
// Now, fire an Unload event to the document...
nsEventStatus status = nsEventStatus_eIgnore;
nsEvent event(true, NS_PAGE_UNLOAD);
WidgetEvent event(true, NS_PAGE_UNLOAD);
event.mFlags.mBubbles = false;
// XXX Dispatching to |window|, but using |document| as the target.
event.target = mDocument;

View File

@ -770,18 +770,20 @@ public:
* Interface to dispatch events via the presshell
* @note The caller must have a strong reference to the PresShell.
*/
virtual NS_HIDDEN_(nsresult) HandleEventWithTarget(nsEvent* aEvent,
nsIFrame* aFrame,
nsIContent* aContent,
nsEventStatus* aStatus) = 0;
virtual NS_HIDDEN_(nsresult) HandleEventWithTarget(
mozilla::WidgetEvent* aEvent,
nsIFrame* aFrame,
nsIContent* aContent,
nsEventStatus* aStatus) = 0;
/**
* Dispatch event to content only (NOT full processing)
* @note The caller must have a strong reference to the PresShell.
*/
virtual NS_HIDDEN_(nsresult) HandleDOMEventWithTarget(nsIContent* aTargetContent,
nsEvent* aEvent,
nsEventStatus* aStatus) = 0;
virtual NS_HIDDEN_(nsresult) HandleDOMEventWithTarget(
nsIContent* aTargetContent,
mozilla::WidgetEvent* aEvent,
nsEventStatus* aStatus) = 0;
/**
* Dispatch event to content only (NOT full processing)
@ -799,7 +801,8 @@ public:
/**
* Gets the current target event frame from the PresShell
*/
virtual NS_HIDDEN_(already_AddRefed<nsIContent>) GetEventTargetContent(nsEvent* aEvent) = 0;
virtual NS_HIDDEN_(already_AddRefed<nsIContent>) GetEventTargetContent(
mozilla::WidgetEvent* aEvent) = 0;
/**
* Get and set the history state for the current document

View File

@ -1276,14 +1276,15 @@ nsLayoutUtils::GetDOMEventCoordinatesRelativeTo(nsIDOMEvent* aDOMEvent, nsIFrame
{
if (!aDOMEvent)
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
nsEvent *event = aDOMEvent->GetInternalNSEvent();
WidgetEvent* event = aDOMEvent->GetInternalNSEvent();
if (!event)
return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
return GetEventCoordinatesRelativeTo(event, aFrame);
}
nsPoint
nsLayoutUtils::GetEventCoordinatesRelativeTo(const nsEvent* aEvent, nsIFrame* aFrame)
nsLayoutUtils::GetEventCoordinatesRelativeTo(const WidgetEvent* aEvent,
nsIFrame* aFrame)
{
if (!aEvent || (aEvent->eventStructType != NS_MOUSE_EVENT &&
aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
@ -1302,7 +1303,7 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(const nsEvent* aEvent, nsIFrame* aF
}
nsPoint
nsLayoutUtils::GetEventCoordinatesRelativeTo(const nsEvent* aEvent,
nsLayoutUtils::GetEventCoordinatesRelativeTo(const WidgetEvent* aEvent,
const nsIntPoint aPoint,
nsIFrame* aFrame)
{
@ -1389,7 +1390,7 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(nsIWidget* aWidget,
nsIFrame*
nsLayoutUtils::GetPopupFrameForEventCoordinates(nsPresContext* aPresContext,
const nsEvent* aEvent)
const WidgetEvent* aEvent)
{
#ifdef MOZ_XUL
nsXULPopupManager* pm = nsXULPopupManager::GetInstance();

View File

@ -460,8 +460,9 @@ public:
* for some reason the coordinates for the mouse are not known (e.g.,
* the event is not a GUI event).
*/
static nsPoint GetEventCoordinatesRelativeTo(const nsEvent* aEvent,
nsIFrame* aFrame);
static nsPoint GetEventCoordinatesRelativeTo(
const mozilla::WidgetEvent* aEvent,
nsIFrame* aFrame);
/**
* Get the coordinates of a given point relative to an event and a
@ -473,9 +474,10 @@ public:
* for some reason the coordinates for the mouse are not known (e.g.,
* the event is not a GUI event).
*/
static nsPoint GetEventCoordinatesRelativeTo(const nsEvent* aEvent,
const nsIntPoint aPoint,
nsIFrame* aFrame);
static nsPoint GetEventCoordinatesRelativeTo(
const mozilla::WidgetEvent* aEvent,
const nsIntPoint aPoint,
nsIFrame* aFrame);
/**
* Get the coordinates of a given point relative to a widget and a
@ -498,8 +500,9 @@ public:
* @return Null, if there is no popup frame at the point, otherwise,
* returns top-most popup frame at the point.
*/
static nsIFrame* GetPopupFrameForEventCoordinates(nsPresContext* aPresContext,
const nsEvent* aEvent);
static nsIFrame* GetPopupFrameForEventCoordinates(
nsPresContext* aPresContext,
const mozilla::WidgetEvent* aEvent);
/**
* Translate from widget coordinates to the view's coordinates

View File

@ -1901,7 +1901,7 @@ PresShell::FireBeforeResizeEvent()
return;
// Send beforeresize event from here.
nsEvent event(true, NS_BEFORERESIZE_EVENT);
WidgetEvent event(true, NS_BEFORERESIZE_EVENT);
nsPIDOMWindow *window = mDocument->GetWindow();
if (window) {
@ -1923,7 +1923,7 @@ PresShell::FireResizeEvent()
return;
//Send resize event from here.
nsEvent event(true, NS_RESIZE_EVENT);
WidgetEvent event(true, NS_RESIZE_EVENT);
nsEventStatus status = nsEventStatus_eIgnore;
nsPIDOMWindow *window = mDocument->GetWindow();
@ -5739,7 +5739,7 @@ PresShell::GetEventTargetFrame()
}
already_AddRefed<nsIContent>
PresShell::GetEventTargetContent(nsEvent* aEvent)
PresShell::GetEventTargetContent(WidgetEvent* aEvent)
{
nsCOMPtr<nsIContent> content = GetCurrentEventContent();
if (!content) {
@ -6607,7 +6607,7 @@ PresShell::HandlePositionedEvent(nsIFrame* aTargetFrame,
}
nsresult
PresShell::HandleEventWithTarget(nsEvent* aEvent, nsIFrame* aFrame,
PresShell::HandleEventWithTarget(WidgetEvent* aEvent, nsIFrame* aFrame,
nsIContent* aContent, nsEventStatus* aStatus)
{
#if DEBUG
@ -6658,7 +6658,7 @@ static bool CanHandleContextMenuEvent(nsMouseEvent* aMouseEvent,
}
nsresult
PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
{
nsRefPtr<nsEventStateManager> manager = mPresContext->EventStateManager();
nsresult rv = NS_OK;
@ -6927,7 +6927,7 @@ PresShell::HandleEventInternal(nsEvent* aEvent, nsEventStatus* aStatus)
}
void
PresShell::DispatchTouchEvent(nsEvent *aEvent,
PresShell::DispatchTouchEvent(WidgetEvent* aEvent,
nsEventStatus* aStatus,
nsPresShellEventCB* aEventCB,
bool aTouchIsNew)
@ -7018,7 +7018,8 @@ PresShell::DispatchTouchEvent(nsEvent *aEvent,
// Dispatch event to content only (NOT full processing)
// See also HandleEventWithTarget which does full event processing.
nsresult
PresShell::HandleDOMEventWithTarget(nsIContent* aTargetContent, nsEvent* aEvent,
PresShell::HandleDOMEventWithTarget(nsIContent* aTargetContent,
WidgetEvent* aEvent,
nsEventStatus* aStatus)
{
nsresult rv = NS_OK;

View File

@ -144,11 +144,14 @@ public:
virtual nsresult AddOverrideStyleSheet(nsIStyleSheet *aSheet) MOZ_OVERRIDE;
virtual nsresult RemoveOverrideStyleSheet(nsIStyleSheet *aSheet) MOZ_OVERRIDE;
virtual NS_HIDDEN_(nsresult) HandleEventWithTarget(nsEvent* aEvent, nsIFrame* aFrame,
nsIContent* aContent,
nsEventStatus* aStatus) MOZ_OVERRIDE;
virtual NS_HIDDEN_(nsresult) HandleEventWithTarget(
mozilla::WidgetEvent* aEvent,
nsIFrame* aFrame,
nsIContent* aContent,
nsEventStatus* aStatus) MOZ_OVERRIDE;
virtual NS_HIDDEN_(nsIFrame*) GetEventTargetFrame() MOZ_OVERRIDE;
virtual NS_HIDDEN_(already_AddRefed<nsIContent>) GetEventTargetContent(nsEvent* aEvent) MOZ_OVERRIDE;
virtual NS_HIDDEN_(already_AddRefed<nsIContent>) GetEventTargetContent(
mozilla::WidgetEvent* aEvent) MOZ_OVERRIDE;
virtual nsresult ReconstructFrames(void) MOZ_OVERRIDE;
@ -187,9 +190,10 @@ public:
mozilla::WidgetGUIEvent* aEvent,
bool aDontRetargetEvents,
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
virtual NS_HIDDEN_(nsresult) HandleDOMEventWithTarget(nsIContent* aTargetContent,
nsEvent* aEvent,
nsEventStatus* aStatus) MOZ_OVERRIDE;
virtual NS_HIDDEN_(nsresult) HandleDOMEventWithTarget(
nsIContent* aTargetContent,
mozilla::WidgetEvent* aEvent,
nsEventStatus* aStatus) MOZ_OVERRIDE;
virtual NS_HIDDEN_(nsresult) HandleDOMEventWithTarget(nsIContent* aTargetContent,
nsIDOMEvent* aEvent,
nsEventStatus* aStatus) MOZ_OVERRIDE;
@ -358,7 +362,7 @@ protected:
nsresult DidCauseReflow();
friend class nsAutoCauseReflowNotifier;
void DispatchTouchEvent(nsEvent *aEvent,
void DispatchTouchEvent(mozilla::WidgetEvent* aEvent,
nsEventStatus* aStatus,
nsPresShellEventCB* aEventCB,
bool aTouchIsNew);
@ -529,7 +533,9 @@ protected:
}
}
nsresult HandleRetargetedEvent(nsEvent* aEvent, nsEventStatus* aStatus, nsIContent* aTarget)
nsresult HandleRetargetedEvent(mozilla::WidgetEvent* aEvent,
nsEventStatus* aStatus,
nsIContent* aTarget)
{
PushCurrentEventInfo(nullptr, nullptr);
mCurrentEventContent = aTarget;
@ -651,7 +657,8 @@ protected:
nsEventStatus* aEventStatus);
void PushCurrentEventInfo(nsIFrame* aFrame, nsIContent* aContent);
void PopCurrentEventInfo();
nsresult HandleEventInternal(nsEvent* aEvent, nsEventStatus *aStatus);
nsresult HandleEventInternal(mozilla::WidgetEvent* aEvent,
nsEventStatus* aStatus);
nsresult HandlePositionedEvent(nsIFrame* aTargetFrame,
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus);

View File

@ -26,6 +26,7 @@
//#define DEBUG_CANVAS_FOCUS
using namespace mozilla;
using namespace mozilla::layout;
nsIFrame*
@ -582,7 +583,7 @@ nsCanvasFrame::GetType() const
}
NS_IMETHODIMP
nsCanvasFrame::GetContentForEvent(nsEvent* aEvent,
nsCanvasFrame::GetContentForEvent(WidgetEvent* aEvent,
nsIContent** aContent)
{
NS_ENSURE_ARG_POINTER(aContent);

View File

@ -102,7 +102,7 @@ public:
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
#endif
NS_IMETHOD GetContentForEvent(nsEvent* aEvent,
NS_IMETHOD GetContentForEvent(mozilla::WidgetEvent* aEvent,
nsIContent** aContent) MOZ_OVERRIDE;
nsRect CanvasArea() const;

View File

@ -2322,7 +2322,7 @@ nsIFrame::MarkAbsoluteFramesForDisplayList(nsDisplayListBuilder* aBuilder,
}
NS_IMETHODIMP
nsFrame::GetContentForEvent(nsEvent* aEvent,
nsFrame::GetContentForEvent(WidgetEvent* aEvent,
nsIContent** aContent)
{
nsIFrame* f = nsLayoutUtils::GetNonGeneratedAncestor(this);

View File

@ -165,7 +165,7 @@ public:
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
NS_IMETHOD GetContentForEvent(nsEvent* aEvent,
NS_IMETHOD GetContentForEvent(mozilla::WidgetEvent* aEvent,
nsIContent** aContent) MOZ_OVERRIDE;
NS_IMETHOD GetCursor(const nsPoint& aPoint,
nsIFrame::Cursor& aCursor) MOZ_OVERRIDE;

View File

@ -1366,7 +1366,7 @@ public:
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) = 0;
NS_IMETHOD GetContentForEvent(nsEvent* aEvent,
NS_IMETHOD GetContentForEvent(mozilla::WidgetEvent* aEvent,
nsIContent** aContent) = 0;
// This structure keeps track of the content node and offsets associated with

View File

@ -1598,7 +1598,7 @@ nsImageFrame::GetAnchorHREFTargetAndNode(nsIURI** aHref, nsString& aTarget,
}
NS_IMETHODIMP
nsImageFrame::GetContentForEvent(nsEvent* aEvent,
nsImageFrame::GetContentForEvent(WidgetEvent* aEvent,
nsIContent** aContent)
{
NS_ENSURE_ARG_POINTER(aContent);

View File

@ -88,7 +88,7 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD GetContentForEvent(nsEvent* aEvent,
NS_IMETHOD GetContentForEvent(mozilla::WidgetEvent* aEvent,
nsIContent** aContent);
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
mozilla::WidgetGUIEvent* aEvent,

View File

@ -52,6 +52,7 @@
#define ONLOAD_CALLED_TOO_EARLY 1
using namespace mozilla;
using namespace mozilla::layers;
class nsImageBoxFrameEvent : public nsRunnable
@ -81,7 +82,7 @@ nsImageBoxFrameEvent::Run()
}
nsEventStatus status = nsEventStatus_eIgnore;
nsEvent event(true, mMessage);
WidgetEvent event(true, mMessage);
event.mFlags.mBubbles = false;
nsEventDispatcher::Dispatch(mContent, pres_context, &event, nullptr, &status);

View File

@ -182,7 +182,7 @@ nsMenuBarFrame::FindMenuWithShortcut(nsIDOMKeyEvent* aKeyEvent)
aKeyEvent->GetCharCode(&charCode);
nsAutoTArray<uint32_t, 10> accessKeys;
nsEvent* nativeEvent = nsContentUtils::GetNativeEvent(aKeyEvent);
WidgetEvent* nativeEvent = nsContentUtils::GetNativeEvent(aKeyEvent);
WidgetKeyboardEvent* nativeKeyEvent =
static_cast<WidgetKeyboardEvent*>(nativeEvent);
if (nativeKeyEvent)

View File

@ -197,7 +197,7 @@ nsMenuBarListener::KeyPress(nsIDOMEvent* aKeyEvent)
bool hasAccessKeyCandidates = charCode != 0;
if (!hasAccessKeyCandidates) {
nsEvent* nativeEvent = nsContentUtils::GetNativeEvent(aKeyEvent);
WidgetEvent* nativeEvent = nsContentUtils::GetNativeEvent(aKeyEvent);
WidgetKeyboardEvent* nativeKeyEvent =
static_cast<WidgetKeyboardEvent*>(nativeEvent);
if (nativeKeyEvent) {

View File

@ -478,7 +478,7 @@ nsXULPopupManager::InitTriggerEvent(nsIDOMEvent* aEvent, nsIContent* aPopup,
// get the event coordinates relative to the root frame of the document
// containing the popup.
NS_ASSERTION(aPopup, "Expected a popup node");
nsEvent* event = aEvent->GetInternalNSEvent();
WidgetEvent* event = aEvent->GetInternalNSEvent();
if (event) {
if (event->eventStructType == NS_MOUSE_EVENT ||
event->eventStructType == NS_KEY_EVENT) {
@ -1768,7 +1768,7 @@ nsXULPopupManager::CancelMenuTimer(nsMenuParent* aMenuParent)
static WidgetGUIEvent*
DOMKeyEventToGUIEvent(nsIDOMEvent* aEvent)
{
nsEvent* evt = aEvent ? aEvent->GetInternalNSEvent() : nullptr;
WidgetEvent* evt = aEvent ? aEvent->GetInternalNSEvent() : nullptr;
return evt && evt->eventStructType == NS_KEY_EVENT ?
static_cast<WidgetGUIEvent*>(evt) : nullptr;
}

View File

@ -8,6 +8,8 @@
#include "nsIPresShell.h"
#include "mozilla/BasicEvents.h"
using namespace mozilla;
nsHtml5SVGLoadDispatcher::nsHtml5SVGLoadDispatcher(nsIContent* aElement)
: mElement(aElement)
, mDocument(mElement->OwnerDoc())
@ -18,7 +20,7 @@ nsHtml5SVGLoadDispatcher::nsHtml5SVGLoadDispatcher(nsIContent* aElement)
NS_IMETHODIMP
nsHtml5SVGLoadDispatcher::Run()
{
nsEvent event(true, NS_SVG_LOAD);
WidgetEvent event(true, NS_SVG_LOAD);
event.mFlags.mBubbles = false;
// Do we care about forcing presshell creation if it hasn't happened yet?
// That is, should this code flush or something? Does it really matter?

View File

@ -1022,7 +1022,4 @@ public:
} // namespace mozilla
// TODO: Remove following typedefs
typedef mozilla::WidgetEvent nsEvent;
#endif // mozilla_BasicEvents_h__

View File

@ -195,7 +195,7 @@ public:
InternalTransitionEvent(bool aIsTrusted, uint32_t aMessage,
const nsAString& aPropertyName, float aElapsedTime,
const nsAString& aPseudoElement) :
nsEvent(aIsTrusted, aMessage, NS_TRANSITION_EVENT),
WidgetEvent(aIsTrusted, aMessage, NS_TRANSITION_EVENT),
propertyName(aPropertyName), elapsedTime(aElapsedTime),
pseudoElement(aPseudoElement)
{

View File

@ -103,7 +103,6 @@ class InternalMutationEvent;
} // namespace mozilla
// TODO: Remove following typedefs
typedef mozilla::WidgetEvent nsEvent;
typedef mozilla::WidgetMouseEvent nsMouseEvent;
namespace mozilla {

View File

@ -257,7 +257,7 @@ GetNativeKeyEventType(NSEvent* aNativeEvent)
}
static const char*
GetGeckoKeyEventType(const nsEvent &aEvent)
GetGeckoKeyEventType(const WidgetEvent& aEvent)
{
switch (aEvent.message) {
case NS_KEY_DOWN: return "NS_KEY_DOWN";

View File

@ -39,9 +39,9 @@ struct ParamTraits<mozilla::BaseEventFlags>
};
template<>
struct ParamTraits<nsEvent>
struct ParamTraits<mozilla::WidgetEvent>
{
typedef nsEvent paramType;
typedef mozilla::WidgetEvent paramType;
static void Write(Message* aMsg, const paramType& aParam)
{
@ -72,12 +72,12 @@ struct ParamTraits<mozilla::WidgetGUIEvent>
static void Write(Message* aMsg, const paramType& aParam)
{
WriteParam(aMsg, static_cast<nsEvent>(aParam));
WriteParam(aMsg, static_cast<mozilla::WidgetEvent>(aParam));
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
{
return ReadParam(aMsg, aIter, static_cast<nsEvent*>(aResult));
return ReadParam(aMsg, aIter, static_cast<mozilla::WidgetEvent*>(aResult));
}
};

View File

@ -51,7 +51,7 @@ class DrawTarget;
/**
* Callback function that processes events.
*
* The argument is actually a subtype (subclass) of nsEvent which carries
* The argument is actually a subtype (subclass) of WidgetEvent which carries
* platform specific information about the event. Platform specific code
* knows how to deal with it.
*