Skip to content

Commit 5dbc2a6

Browse files
Bug 920377 part.31 Get rid of nsEvent r=roc
1 parent a4221a4 commit 5dbc2a6

File tree

94 files changed

+287
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+287
-236
lines changed

content/base/public/Element.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ class Element : public FragmentOrElement
781781
*/
782782
using nsIContent::DispatchEvent;
783783
static nsresult DispatchEvent(nsPresContext* aPresContext,
784-
nsEvent* aEvent,
784+
WidgetEvent* aEvent,
785785
nsIContent* aTarget,
786786
bool aFullDispatch,
787787
nsEventStatus* aStatus);

content/base/public/nsContentUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ class nsContentUtils
13721372
* aDOMEvent->GetInternalNSEvent().
13731373
* XXX Is this necessary?
13741374
*/
1375-
static nsEvent* GetNativeEvent(nsIDOMEvent* aDOMEvent);
1375+
static mozilla::WidgetEvent* GetNativeEvent(nsIDOMEvent* aDOMEvent);
13761376

13771377
/**
13781378
* Get the candidates for accelkeys for aDOMKeyEvent.

content/base/src/Element.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ Element::IsNodeOfType(uint32_t aFlags) const
14031403
/* static */
14041404
nsresult
14051405
Element::DispatchEvent(nsPresContext* aPresContext,
1406-
nsEvent* aEvent,
1406+
WidgetEvent* aEvent,
14071407
nsIContent* aTarget,
14081408
bool aFullDispatch,
14091409
nsEventStatus* aStatus)

content/base/src/nsContentUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4554,7 +4554,7 @@ nsContentUtils::GetLocalizedEllipsis()
45544554
}
45554555

45564556
//static
4557-
nsEvent*
4557+
WidgetEvent*
45584558
nsContentUtils::GetNativeEvent(nsIDOMEvent* aDOMEvent)
45594559
{
45604560
return aDOMEvent ? aDOMEvent->GetInternalNSEvent() : nullptr;

content/base/src/nsDocument.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4626,7 +4626,7 @@ nsDocument::DispatchContentLoadedEvents()
46264626
// the ancestor document if we used the normal event
46274627
// dispatching code.
46284628

4629-
nsEvent* innerEvent = event->GetInternalNSEvent();
4629+
WidgetEvent* innerEvent = event->GetInternalNSEvent();
46304630
if (innerEvent) {
46314631
nsEventStatus status = nsEventStatus_eIgnore;
46324632

content/base/src/nsINode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ nsINode::PostHandleEvent(nsEventChainPostVisitor& /*aVisitor*/)
11471147
}
11481148

11491149
nsresult
1150-
nsINode::DispatchDOMEvent(nsEvent* aEvent,
1150+
nsINode::DispatchDOMEvent(WidgetEvent* aEvent,
11511151
nsIDOMEvent* aDOMEvent,
11521152
nsPresContext* aPresContext,
11531153
nsEventStatus* aEventStatus)

content/base/src/nsScriptElement.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "nsGkAtoms.h"
1616
#include "nsContentSink.h"
1717

18+
using namespace mozilla;
1819
using namespace mozilla::dom;
1920

2021
NS_IMETHODIMP
@@ -58,7 +59,7 @@ nsScriptElement::ScriptEvaluated(nsresult aResult,
5859

5960
nsEventStatus status = nsEventStatus_eIgnore;
6061
uint32_t type = NS_SUCCEEDED(aResult) ? NS_LOAD : NS_LOAD_ERROR;
61-
nsEvent event(true, type);
62+
WidgetEvent event(true, type);
6263
// Load event doesn't bubble.
6364
event.mFlags.mBubbles = (type != NS_LOAD);
6465

content/events/public/nsAsyncDOMEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class nsAsyncDOMEvent : public nsRunnable {
3434
: mEventNode(aEventNode), mEvent(aEvent), mDispatchChromeOnly(false)
3535
{ }
3636

37-
nsAsyncDOMEvent(nsINode *aEventNode, nsEvent &aEvent);
37+
nsAsyncDOMEvent(nsINode* aEventNode, mozilla::WidgetEvent& aEvent);
3838

3939
NS_IMETHOD Run() MOZ_OVERRIDE;
4040
nsresult PostDOMEvent();

content/events/public/nsEventDispatcher.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class EventTarget;
4646
class nsEventChainVisitor {
4747
public:
4848
nsEventChainVisitor(nsPresContext* aPresContext,
49-
nsEvent* aEvent,
49+
mozilla::WidgetEvent* aEvent,
5050
nsIDOMEvent* aDOMEvent,
5151
nsEventStatus aEventStatus = nsEventStatus_eIgnore)
5252
: mPresContext(aPresContext), mEvent(aEvent), mDOMEvent(aDOMEvent),
@@ -59,9 +59,9 @@ class nsEventChainVisitor {
5959
nsPresContext* const mPresContext;
6060

6161
/**
62-
* The nsEvent which is being dispatched. Never nullptr.
62+
* The WidgetEvent which is being dispatched. Never nullptr.
6363
*/
64-
nsEvent* const mEvent;
64+
mozilla::WidgetEvent* const mEvent;
6565

6666
/**
6767
* The DOM Event assiciated with the mEvent. Possibly nullptr if a DOM Event
@@ -101,7 +101,7 @@ class nsEventChainVisitor {
101101
class nsEventChainPreVisitor : public nsEventChainVisitor {
102102
public:
103103
nsEventChainPreVisitor(nsPresContext* aPresContext,
104-
nsEvent* aEvent,
104+
mozilla::WidgetEvent* aEvent,
105105
nsIDOMEvent* aDOMEvent,
106106
nsEventStatus aEventStatus,
107107
bool aIsInAnon)
@@ -221,11 +221,11 @@ class nsEventDispatcher
221221
* If aTargets is non-null, event target chain will be created, but
222222
* event won't be handled. In this case aEvent->message should be
223223
* NS_EVENT_NULL.
224-
* @note Use this method when dispatching an nsEvent.
224+
* @note Use this method when dispatching a WidgetEvent.
225225
*/
226226
static nsresult Dispatch(nsISupports* aTarget,
227227
nsPresContext* aPresContext,
228-
nsEvent* aEvent,
228+
mozilla::WidgetEvent* aEvent,
229229
nsIDOMEvent* aDOMEvent = nullptr,
230230
nsEventStatus* aEventStatus = nullptr,
231231
nsDispatchingCallback* aCallback = nullptr,
@@ -240,7 +240,8 @@ class nsEventDispatcher
240240
* @note Use this method when dispatching nsIDOMEvent.
241241
*/
242242
static nsresult DispatchDOMEvent(nsISupports* aTarget,
243-
nsEvent* aEvent, nsIDOMEvent* aDOMEvent,
243+
mozilla::WidgetEvent* aEvent,
244+
nsIDOMEvent* aDOMEvent,
244245
nsPresContext* aPresContext,
245246
nsEventStatus* aEventStatus);
246247

@@ -249,7 +250,7 @@ class nsEventDispatcher
249250
*/
250251
static nsresult CreateEvent(mozilla::dom::EventTarget* aOwner,
251252
nsPresContext* aPresContext,
252-
nsEvent* aEvent,
253+
mozilla::WidgetEvent* aEvent,
253254
const nsAString& aEventType,
254255
nsIDOMEvent** aDOMEvent);
255256

content/events/src/SpeechRecognitionError.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
namespace mozilla {
99
namespace dom {
1010

11-
SpeechRecognitionError::SpeechRecognitionError(mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, nsEvent* aEvent)
11+
SpeechRecognitionError::SpeechRecognitionError(
12+
mozilla::dom::EventTarget* aOwner,
13+
nsPresContext* aPresContext,
14+
WidgetEvent* aEvent)
1215
: nsDOMEvent(aOwner, aPresContext, aEvent),
1316
mError()
1417
{}

content/events/src/SpeechRecognitionError.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SpeechRecognitionError : public nsDOMEvent
1717
public:
1818
SpeechRecognitionError(mozilla::dom::EventTarget* aOwner,
1919
nsPresContext* aPresContext,
20-
nsEvent* aEvent);
20+
WidgetEvent* aEvent);
2121
virtual ~SpeechRecognitionError();
2222

2323
static already_AddRefed<SpeechRecognitionError>

content/events/src/Touch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Touch::Target() const
100100
}
101101

102102
void
103-
Touch::InitializePoints(nsPresContext* aPresContext, nsEvent* aEvent)
103+
Touch::InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent)
104104
{
105105
if (mPointsInitialized) {
106106
return;

content/events/src/Touch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Touch MOZ_FINAL : public nsISupports
4848
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
4949
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch)
5050

51-
void InitializePoints(nsPresContext* aPresContext, nsEvent* aEvent);
51+
void InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent);
5252

5353
void SetTarget(mozilla::dom::EventTarget* aTarget);
5454

content/events/src/nsAsyncDOMEvent.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
#include "mozilla/BasicEvents.h"
1212
#include "mozilla/dom/EventTarget.h"
1313

14+
using namespace mozilla;
1415
using namespace mozilla::dom;
1516

16-
nsAsyncDOMEvent::nsAsyncDOMEvent(nsINode *aEventNode, nsEvent &aEvent)
17+
nsAsyncDOMEvent::nsAsyncDOMEvent(nsINode* aEventNode, WidgetEvent& aEvent)
1718
: mEventNode(aEventNode), mDispatchChromeOnly(false)
1819
{
1920
MOZ_ASSERT(mEventNode);

content/events/src/nsDOMBeforeUnloadEvent.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
#include "nsDOMBeforeUnloadEvent.h"
77

8+
using namespace mozilla;
9+
810
NS_IMPL_ADDREF_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
911
NS_IMPL_RELEASE_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
1012

@@ -29,7 +31,7 @@ nsDOMBeforeUnloadEvent::GetReturnValue(nsAString& aReturnValue)
2931
nsresult NS_NewDOMBeforeUnloadEvent(nsIDOMEvent** aInstancePtrResult,
3032
mozilla::dom::EventTarget* aOwner,
3133
nsPresContext* aPresContext,
32-
nsEvent *aEvent)
34+
WidgetEvent* aEvent)
3335
{
3436
nsDOMBeforeUnloadEvent* it =
3537
new nsDOMBeforeUnloadEvent(aOwner, aPresContext, aEvent);

content/events/src/nsDOMBeforeUnloadEvent.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class nsDOMBeforeUnloadEvent : public nsDOMEvent,
1515
{
1616
public:
1717
nsDOMBeforeUnloadEvent(mozilla::dom::EventTarget* aOwner,
18-
nsPresContext* aPresContext, nsEvent* aEvent)
18+
nsPresContext* aPresContext,
19+
mozilla::WidgetEvent* aEvent)
1920
: nsDOMEvent(aOwner, aPresContext, aEvent)
2021
{
2122
}

content/events/src/nsDOMDataContainerEvent.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
#include "nsContentUtils.h"
88
#include "nsIXPConnect.h"
99

10+
using namespace mozilla;
11+
1012
nsDOMDataContainerEvent::nsDOMDataContainerEvent(
1113
mozilla::dom::EventTarget* aOwner,
1214
nsPresContext* aPresContext,
13-
nsEvent* aEvent)
15+
WidgetEvent* aEvent)
1416
: nsDOMEvent(aOwner, aPresContext, aEvent)
1517
{
1618
}
@@ -77,7 +79,7 @@ nsresult
7779
NS_NewDOMDataContainerEvent(nsIDOMEvent** aInstancePtrResult,
7880
mozilla::dom::EventTarget* aOwner,
7981
nsPresContext* aPresContext,
80-
nsEvent* aEvent)
82+
WidgetEvent* aEvent)
8183
{
8284
nsDOMDataContainerEvent* it =
8385
new nsDOMDataContainerEvent(aOwner, aPresContext, aEvent);

content/events/src/nsDOMDataContainerEvent.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class nsDOMDataContainerEvent : public nsDOMEvent,
1616
{
1717
public:
1818
nsDOMDataContainerEvent(mozilla::dom::EventTarget* aOwner,
19-
nsPresContext* aPresContext, nsEvent* aEvent);
19+
nsPresContext* aPresContext,
20+
mozilla::WidgetEvent* aEvent);
2021

2122
NS_DECL_ISUPPORTS_INHERITED
2223

content/events/src/nsDOMDeviceMotionEvent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ nsresult
102102
NS_NewDOMDeviceMotionEvent(nsIDOMEvent** aInstancePtrResult,
103103
mozilla::dom::EventTarget* aOwner,
104104
nsPresContext* aPresContext,
105-
nsEvent *aEvent)
105+
WidgetEvent* aEvent)
106106
{
107107
NS_ENSURE_ARG_POINTER(aInstancePtrResult);
108108

content/events/src/nsDOMDeviceMotionEvent.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class nsDOMDeviceMotionEvent MOZ_FINAL : public nsDOMEvent,
4646
public:
4747

4848
nsDOMDeviceMotionEvent(mozilla::dom::EventTarget* aOwner,
49-
nsPresContext* aPresContext, nsEvent* aEvent)
49+
nsPresContext* aPresContext,
50+
mozilla::WidgetEvent* aEvent)
5051
: nsDOMEvent(aOwner, aPresContext, aEvent)
5152
{
5253
}

0 commit comments

Comments
 (0)