Bug 895274 part.1 Rename WidgetEvent::message to WidgetEvent::mMessage r=smaug

This commit is contained in:
Masayuki Nakano 2015-08-22 10:34:51 +09:00
parent cf90c2e5d8
commit 451161e458
93 changed files with 531 additions and 520 deletions

View File

@ -2850,9 +2850,9 @@ Element::CheckHandleEventForLinksPrecondition(EventChainVisitor& aVisitor,
{
if (aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
(!aVisitor.mEvent->mFlags.mIsTrusted &&
(aVisitor.mEvent->message != NS_MOUSE_CLICK) &&
(aVisitor.mEvent->message != NS_KEY_PRESS) &&
(aVisitor.mEvent->message != NS_UI_ACTIVATE)) ||
(aVisitor.mEvent->mMessage != NS_MOUSE_CLICK) &&
(aVisitor.mEvent->mMessage != NS_KEY_PRESS) &&
(aVisitor.mEvent->mMessage != NS_UI_ACTIVATE)) ||
!aVisitor.mPresContext ||
aVisitor.mEvent->mFlags.mMultipleActionsPrevented) {
return false;
@ -2867,7 +2867,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
{
// Optimisation: return early if this event doesn't interest us.
// IMPORTANT: this switch and the switch below it must be kept in sync!
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_OVER:
case NS_FOCUS_CONTENT:
case NS_MOUSE_OUT:
@ -2887,7 +2887,7 @@ Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
// We do the status bar updates in PreHandleEvent so that the status bar gets
// updated even if the event is consumed before we have a chance to set it.
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
// Set the status bar similarly for mouseover and focus
case NS_MOUSE_OVER:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
@ -2928,7 +2928,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
{
// Optimisation: return early if this event doesn't interest us.
// IMPORTANT: this switch and the switch below it must be kept in sync!
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_CLICK:
case NS_UI_ACTIVATE:
@ -2946,7 +2946,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
nsresult rv = NS_OK;
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
{
if (aVisitor.mEvent->AsMouseEvent()->button ==

View File

@ -677,10 +677,10 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
// Don't propagate mouseover and mouseout events when mouse is moving
// inside chrome access only content.
bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree();
if ((aVisitor.mEvent->message == NS_MOUSE_OVER ||
aVisitor.mEvent->message == NS_MOUSE_OUT ||
aVisitor.mEvent->message == NS_POINTER_OVER ||
aVisitor.mEvent->message == NS_POINTER_OUT) &&
if ((aVisitor.mEvent->mMessage == NS_MOUSE_OVER ||
aVisitor.mEvent->mMessage == NS_MOUSE_OUT ||
aVisitor.mEvent->mMessage == NS_POINTER_OVER ||
aVisitor.mEvent->mMessage == NS_POINTER_OUT) &&
// Check if we should stop event propagation when event has just been
// dispatched or when we're about to propagate from
// chrome access only subtree or if we are about to propagate out of
@ -739,7 +739,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
printf("Stopping %s propagation:"
"\n\toriginalTarget=%s \n\tcurrentTarget=%s %s"
"\n\trelatedTarget=%s %s \n%s",
(aVisitor.mEvent->message == NS_MOUSE_OVER)
(aVisitor.mEvent->mMessage == NS_MOUSE_OVER)
? "mouseover" : "mouseout",
NS_ConvertUTF16toUTF8(ot).get(),
NS_ConvertUTF16toUTF8(ct).get(),
@ -805,7 +805,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
// scroll
// selectstart
bool stopEvent = false;
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_IMAGE_ABORT:
case NS_LOAD_ERROR:
case NS_FORM_SELECTED:
@ -841,7 +841,7 @@ nsIContent::PreHandleEvent(EventChainPreVisitor& aVisitor)
// The load event is special in that we don't ever propagate it
// to chrome.
nsCOMPtr<nsPIDOMWindow> win = OwnerDoc()->GetWindow();
EventTarget* parentTarget = win && aVisitor.mEvent->message != NS_LOAD
EventTarget* parentTarget = win && aVisitor.mEvent->mMessage != NS_LOAD
? win->GetParentTarget() : nullptr;
aVisitor.mParentTarget = parentTarget;

View File

@ -248,10 +248,10 @@ TextInputProcessor::IsValidEventTypeForComposition(
const WidgetKeyboardEvent& aKeyboardEvent) const
{
// The key event type of composition methods must be "" or "keydown".
if (aKeyboardEvent.message == NS_KEY_DOWN) {
if (aKeyboardEvent.mMessage == NS_KEY_DOWN) {
return true;
}
if (aKeyboardEvent.message == NS_USER_DEFINED_EVENT &&
if (aKeyboardEvent.mMessage == NS_USER_DEFINED_EVENT &&
aKeyboardEvent.userType &&
nsDependentAtomString(aKeyboardEvent.userType).EqualsLiteral("on")) {
return true;
@ -306,9 +306,9 @@ TextInputProcessor::MaybeDispatchKeyupForComposition(
return result;
}
// If the message is NS_KEY_DOWN, the caller doesn't want TIP to dispatch
// If the mMessage is NS_KEY_DOWN, the caller doesn't want TIP to dispatch
// keyup event.
if (aKeyboardEvent->message == NS_KEY_DOWN) {
if (aKeyboardEvent->mMessage == NS_KEY_DOWN) {
return result;
}

View File

@ -5446,8 +5446,8 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
// For draggesture and dragstart events, the data transfer object is
// created before the event fires, so it should already be set. For other
// drag events, get the object from the drag session.
NS_ASSERTION(aDragEvent->message != NS_DRAGDROP_GESTURE &&
aDragEvent->message != NS_DRAGDROP_START,
NS_ASSERTION(aDragEvent->mMessage != NS_DRAGDROP_GESTURE &&
aDragEvent->mMessage != NS_DRAGDROP_START,
"draggesture event created without a dataTransfer");
nsCOMPtr<nsIDragSession> dragSession = GetDragSession();
@ -5466,20 +5466,22 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
// means, for instance calling the drag service directly, or a drag
// from another application. In either case, a new dataTransfer should
// be created that reflects the data.
initialDataTransfer = new DataTransfer(aDragEvent->target, aDragEvent->message, true, -1);
initialDataTransfer =
new DataTransfer(aDragEvent->target, aDragEvent->mMessage, true, -1);
// now set it in the drag session so we don't need to create it again
dragSession->SetDataTransfer(initialDataTransfer);
}
bool isCrossDomainSubFrameDrop = false;
if (aDragEvent->message == NS_DRAGDROP_DROP ||
aDragEvent->message == NS_DRAGDROP_DRAGDROP) {
if (aDragEvent->mMessage == NS_DRAGDROP_DROP ||
aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP) {
isCrossDomainSubFrameDrop = CheckForSubFrameDrop(dragSession, aDragEvent);
}
// each event should use a clone of the original dataTransfer.
initialDataTransfer->Clone(aDragEvent->target, aDragEvent->message, aDragEvent->userCancelled,
initialDataTransfer->Clone(aDragEvent->target, aDragEvent->mMessage,
aDragEvent->userCancelled,
isCrossDomainSubFrameDrop,
getter_AddRefs(aDragEvent->dataTransfer));
NS_ENSURE_TRUE(aDragEvent->dataTransfer, NS_ERROR_OUT_OF_MEMORY);
@ -5487,16 +5489,16 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
// for the dragenter and dragover events, initialize the drop effect
// from the drop action, which platform specific widget code sets before
// the event is fired based on the keyboard state.
if (aDragEvent->message == NS_DRAGDROP_ENTER ||
aDragEvent->message == NS_DRAGDROP_OVER) {
if (aDragEvent->mMessage == NS_DRAGDROP_ENTER ||
aDragEvent->mMessage == NS_DRAGDROP_OVER) {
uint32_t action, effectAllowed;
dragSession->GetDragAction(&action);
aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed);
aDragEvent->dataTransfer->SetDropEffectInt(FilterDropEffect(action, effectAllowed));
}
else if (aDragEvent->message == NS_DRAGDROP_DROP ||
aDragEvent->message == NS_DRAGDROP_DRAGDROP ||
aDragEvent->message == NS_DRAGDROP_END) {
else if (aDragEvent->mMessage == NS_DRAGDROP_DROP ||
aDragEvent->mMessage == NS_DRAGDROP_DRAGDROP ||
aDragEvent->mMessage == NS_DRAGDROP_END) {
// For the drop and dragend events, set the drop effect based on the
// last value that the dropEffect had. This will have been set in
// EventStateManager::PostHandleEvent for the last dragenter or

View File

@ -8113,7 +8113,7 @@ nsDocument::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mForceContentDispatch = true;
// Load events must not propagate to |window| object, see bug 335251.
if (aVisitor.mEvent->message != NS_LOAD) {
if (aVisitor.mEvent->mMessage != NS_LOAD) {
nsGlobalWindow* window = static_cast<nsGlobalWindow*>(GetWindow());
aVisitor.mParentTarget =
window ? window->GetTargetForEventTargetChain() : nullptr;

View File

@ -49,8 +49,8 @@ public:
virtual nsresult PreHandleEvent(EventChainPreVisitor& aVisitor) override
{
MOZ_ASSERT(IsInNativeAnonymousSubtree());
if (aVisitor.mEvent->message == NS_LOAD ||
aVisitor.mEvent->message == NS_LOAD_ERROR) {
if (aVisitor.mEvent->mMessage == NS_LOAD ||
aVisitor.mEvent->mMessage == NS_LOAD_ERROR) {
// Don't propagate the events to the parent.
return NS_OK;
}

View File

@ -3044,7 +3044,7 @@ nsGlobalWindow::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
NS_PRECONDITION(IsInnerWindow(), "PreHandleEvent is used on outer window!?");
static uint32_t count = 0;
uint32_t msg = aVisitor.mEvent->message;
uint32_t msg = aVisitor.mEvent->mMessage;
aVisitor.mCanHandle = true;
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
@ -3252,7 +3252,7 @@ nsGlobalWindow::PostHandleEvent(EventChainPostVisitor& aVisitor)
NS_PRECONDITION(IsInnerWindow(), "PostHandleEvent is used on outer window!?");
// Return early if there is nothing to do.
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_RESIZE_EVENT:
case NS_PAGE_UNLOAD:
case NS_LOAD:
@ -3267,9 +3267,9 @@ nsGlobalWindow::PostHandleEvent(EventChainPostVisitor& aVisitor)
nsCOMPtr<nsIDOMEventTarget> kungFuDeathGrip1(mChromeEventHandler);
nsCOMPtr<nsIScriptContext> kungFuDeathGrip2(GetContextInternal());
if (aVisitor.mEvent->message == NS_RESIZE_EVENT) {
if (aVisitor.mEvent->mMessage == NS_RESIZE_EVENT) {
mIsHandlingResizeEvent = false;
} else if (aVisitor.mEvent->message == NS_PAGE_UNLOAD &&
} else if (aVisitor.mEvent->mMessage == NS_PAGE_UNLOAD &&
aVisitor.mEvent->mFlags.mIsTrusted) {
// Execute bindingdetached handlers before we tear ourselves
// down.
@ -3277,7 +3277,7 @@ nsGlobalWindow::PostHandleEvent(EventChainPostVisitor& aVisitor)
mDoc->BindingManager()->ExecuteDetachedHandlers();
}
mIsDocumentLoaded = false;
} else if (aVisitor.mEvent->message == NS_LOAD &&
} else if (aVisitor.mEvent->mMessage == NS_LOAD &&
aVisitor.mEvent->mFlags.mIsTrusted) {
// This is page load event since load events don't propagate to |window|.
// @see nsDocument::PreHandleEvent.

View File

@ -159,7 +159,7 @@ void
nsQueryContentEventResult::SetEventResult(nsIWidget* aWidget,
const WidgetQueryContentEvent &aEvent)
{
mEventID = aEvent.message;
mEventID = aEvent.mMessage;
mSucceeded = aEvent.mSucceeded;
mReversed = aEvent.mReply.mReversed;
mRect = aEvent.mReply.mRect;

View File

@ -108,8 +108,8 @@ ClipboardEvent::GetClipboardData()
new DataTransfer(ToSupports(this), NS_COPY, false, -1);
} else {
event->clipboardData =
new DataTransfer(ToSupports(this), event->message,
event->message == NS_PASTE,
new DataTransfer(ToSupports(this), event->mMessage,
event->mMessage == NS_PASTE,
nsIClipboard::kGlobalClipboard);
}
}

View File

@ -255,7 +255,7 @@ protected:
nsCOMPtr<nsISupports> mParent;
// the event type this data transfer is for. This will correspond to an
// event->message value.
// event->mMessage value.
uint32_t mEventType;
// the drop effect and effect allowed

View File

@ -265,12 +265,12 @@ Event::GetType(nsAString& aType)
aType = mEvent->typeString;
return NS_OK;
}
const char* name = GetEventName(mEvent->message);
const char* name = GetEventName(mEvent->mMessage);
if (name) {
CopyASCIItoUTF16(name, aType);
return NS_OK;
} else if (mEvent->message == NS_USER_DEFINED_EVENT && mEvent->userType) {
} else if (mEvent->mMessage == NS_USER_DEFINED_EVENT && mEvent->userType) {
aType = Substring(nsDependentAtomString(mEvent->userType), 2); // Remove "on"
mEvent->typeString = aType;
return NS_OK;
@ -564,10 +564,10 @@ Event::SetEventType(const nsAString& aEventTypeArg)
mEvent->typeString.Truncate();
mEvent->userType =
nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->mClass,
&(mEvent->message));
&(mEvent->mMessage));
} else {
mEvent->userType = nullptr;
mEvent->message = NS_USER_DEFINED_EVENT;
mEvent->mMessage = NS_USER_DEFINED_EVENT;
mEvent->typeString = aEventTypeArg;
}
}
@ -715,7 +715,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
// triggered while handling user input. See
// nsPresShell::HandleEventInternal() for details.
if (EventStateManager::IsHandlingUserInput()) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_FORM_SELECTED :
if (PopupAllowedForEvent("select")) {
abuse = openControlled;
@ -734,7 +734,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
// while handling user input. See
// nsPresShell::HandleEventInternal() for details.
if (EventStateManager::IsHandlingUserInput()) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_EDITOR_INPUT:
if (PopupAllowedForEvent("input")) {
abuse = openControlled;
@ -748,7 +748,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
// while handling user input. See
// nsPresShell::HandleEventInternal() for details.
if (EventStateManager::IsHandlingUserInput()) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_FORM_CHANGE :
if (PopupAllowedForEvent("change")) {
abuse = openControlled;
@ -763,7 +763,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
case eKeyboardEventClass:
if (aEvent->mFlags.mIsTrusted) {
uint32_t key = aEvent->AsKeyboardEvent()->keyCode;
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_KEY_PRESS :
// return key on focused button. see note at NS_MOUSE_CLICK.
if (key == nsIDOMKeyEvent::DOM_VK_RETURN) {
@ -790,7 +790,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
break;
case eTouchEventClass:
if (aEvent->mFlags.mIsTrusted) {
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START :
if (PopupAllowedForEvent("touchstart")) {
abuse = openControlled;
@ -807,7 +807,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
case eMouseEventClass:
if (aEvent->mFlags.mIsTrusted &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_MOUSE_BUTTON_UP :
if (PopupAllowedForEvent("mouseup")) {
abuse = openControlled;
@ -840,7 +840,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
// triggered while handling user input. See
// nsPresShell::HandleEventInternal() for details.
if (EventStateManager::IsHandlingUserInput()) {
switch(aEvent->message) {
switch(aEvent->mMessage) {
case NS_FORM_SUBMIT :
if (PopupAllowedForEvent("submit")) {
abuse = openControlled;

View File

@ -270,7 +270,7 @@ protected:
bool mPrivateDataDuplicated;
bool mIsMainThreadEvent;
// True when popup control check should rely on event.type, not
// WidgetEvent.message.
// WidgetEvent.mMessage.
bool mWantsPopupControlCheck;
};

View File

@ -420,12 +420,12 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
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!");
NS_ASSERTION(!aTargets || !aEvent->mMessage, "Wrong parameters!");
// If we're dispatching an already created DOMEvent object, make
// sure it is initialized!
// If aTargets is non-null, the event isn't going to be dispatched.
NS_ENSURE_TRUE(aEvent->message || !aDOMEvent || aTargets,
NS_ENSURE_TRUE(aEvent->mMessage || !aDOMEvent || aTargets,
NS_ERROR_DOM_INVALID_STATE_ERR);
#ifdef MOZ_TASK_TRACER
@ -493,7 +493,8 @@ EventDispatcher::Dispatch(nsISupports* aTarget,
}
#ifdef DEBUG
if (aEvent->message != NS_EVENT_NULL && !nsContentUtils::IsSafeToRunScript()) {
if (aEvent->mMessage != NS_EVENT_NULL &&
!nsContentUtils::IsSafeToRunScript()) {
nsresult rv = NS_ERROR_FAILURE;
if (target->GetContextForEventHandlers(&rv) ||
NS_FAILED(rv)) {

View File

@ -246,7 +246,7 @@ public:
* Neither aTarget nor aEvent is allowed to be nullptr.
*
* If aTargets is non-null, event target chain will be created, but
* event won't be handled. In this case aEvent->message should be
* event won't be handled. In this case aEvent->mMessage should be
* NS_EVENT_NULL.
* @note Use this method when dispatching a WidgetEvent.
*/

View File

@ -558,20 +558,20 @@ EventListenerManager::ListenerCanHandle(Listener* aListener,
WidgetEvent* aEvent)
{
// This is slightly different from EVENT_TYPE_EQUALS in that it returns
// true even when aEvent->message == NS_USER_DEFINED_EVENT and
// true even when aEvent->mMessage == NS_USER_DEFINED_EVENT and
// aListener=>mEventType != NS_USER_DEFINED_EVENT as long as the atoms are
// the same
if (aListener->mAllEvents) {
return true;
}
if (aEvent->message == NS_USER_DEFINED_EVENT) {
if (aEvent->mMessage == NS_USER_DEFINED_EVENT) {
if (mIsMainThreadELM) {
return aListener->mTypeAtom == aEvent->userType;
}
return aListener->mTypeString.Equals(aEvent->typeString);
}
MOZ_ASSERT(mIsMainThreadELM);
return aListener->mEventType == aEvent->message;
return aListener->mEventType == aEvent->mMessage;
}
void
@ -1163,7 +1163,7 @@ EventListenerManager::HandleEventInternal(nsPresContext* aPresContext,
aEvent->currentTarget = nullptr;
if (mIsMainThreadELM && !hasListener) {
mNoListenerForEvent = aEvent->message;
mNoListenerForEvent = aEvent->mMessage;
mNoListenerForEventAtom = aEvent->userType;
}

View File

@ -321,7 +321,7 @@ public:
}
// Check if we already know that there is no event listener for the event.
if (mNoListenerForEvent == aEvent->message &&
if (mNoListenerForEvent == aEvent->mMessage &&
(mNoListenerForEvent != NS_USER_DEFINED_EVENT ||
mNoListenerForEventAtom == aEvent->userType)) {
return;

View File

@ -499,8 +499,8 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (aEvent->mFlags.mIsTrusted &&
((mouseEvent && mouseEvent->IsReal() &&
mouseEvent->message != NS_MOUSE_ENTER_WIDGET &&
mouseEvent->message != NS_MOUSE_EXIT_WIDGET) ||
mouseEvent->mMessage != NS_MOUSE_ENTER_WIDGET &&
mouseEvent->mMessage != NS_MOUSE_EXIT_WIDGET) ||
aEvent->mClass == eWheelEventClass ||
aEvent->mClass == eKeyboardEventClass)) {
if (gMouseOrKeyboardEventCounter == 0) {
@ -542,7 +542,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
*aStatus = nsEventStatus_eIgnore;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_CONTEXTMENU:
if (sIsPointerLocked) {
return NS_ERROR_DOM_INVALID_STATE_ERR;
@ -615,7 +615,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
// Treat it as a synthetic move so we don't generate spurious
// "exit" or "move" events. Any necessary "out" or "over" events
// will be generated by GenerateMouseEnterExit
mouseEvent->message = NS_MOUSE_MOVE;
mouseEvent->mMessage = NS_MOUSE_MOVE;
mouseEvent->reason = WidgetMouseEvent::eSynthesized;
// then fall through...
} else {
@ -625,7 +625,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
}
GenerateMouseEnterExit(mouseEvent);
//This is a window level mouse exit event and should stop here
aEvent->message = 0;
aEvent->mMessage = 0;
break;
}
case NS_MOUSE_MOVE:
@ -717,7 +717,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
mCurrentTargetContent = content;
}
if (aEvent->message != NS_WHEEL_WHEEL) {
if (aEvent->mMessage != NS_WHEEL_WHEEL) {
break;
}
@ -1167,7 +1167,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
case eWheelEventClass:
return true;
case eMouseEventClass:
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_MOVE:
@ -1179,7 +1179,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
return false;
}
case eTouchEventClass:
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_TOUCH_START:
case NS_TOUCH_MOVE:
case NS_TOUCH_END:
@ -1189,7 +1189,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
return false;
}
case eDragEventClass:
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_DRAGDROP_OVER:
case NS_DRAGDROP_EXIT:
case NS_DRAGDROP_DROP:
@ -1215,7 +1215,7 @@ EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent,
// NB: the elements of |targets| must be unique, for correctness.
nsAutoTArray<nsCOMPtr<nsIContent>, 1> targets;
if (aEvent->mClass != eTouchEventClass ||
aEvent->message == NS_TOUCH_START) {
aEvent->mMessage == NS_TOUCH_START) {
// If this event only has one target, and it's remote, add it to
// the array.
nsIFrame* frame = GetEventTarget();
@ -2588,7 +2588,7 @@ EventStateManager::DecideGestureEvent(WidgetGestureNotifyEvent* aEvent,
nsIFrame* targetFrame)
{
NS_ASSERTION(aEvent->message == NS_GESTURENOTIFY_EVENT_START,
NS_ASSERTION(aEvent->mMessage == NS_GESTURENOTIFY_EVENT_START,
"DecideGestureEvent called with a non-gesture event");
/* Check the ancestor tree to decide if any frame is willing* to receive
@ -2791,8 +2791,8 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// Most of the events we handle below require a frame.
// Add special cases here.
if (!mCurrentTarget && aEvent->message != NS_MOUSE_BUTTON_UP &&
aEvent->message != NS_MOUSE_BUTTON_DOWN) {
if (!mCurrentTarget && aEvent->mMessage != NS_MOUSE_BUTTON_UP &&
aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
return NS_OK;
}
@ -2800,7 +2800,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
nsRefPtr<nsPresContext> presContext = aPresContext;
nsresult ret = NS_OK;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
{
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
@ -3073,7 +3073,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
ScrollbarsForWheel::PrepareToScrollText(this, aTargetFrame, wheelEvent);
if (aEvent->message != NS_WHEEL_WHEEL ||
if (aEvent->mMessage != NS_WHEEL_WHEEL ||
(!wheelEvent->deltaX && !wheelEvent->deltaY)) {
break;
}
@ -3237,13 +3237,13 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// For now, do this only for dragover.
//XXXsmaug dragenter needs some more work.
if (aEvent->message == NS_DRAGDROP_OVER && !isChromeDoc) {
if (aEvent->mMessage == NS_DRAGDROP_OVER && !isChromeDoc) {
// Someone has called preventDefault(), check whether is was on
// content or chrome.
dragSession->SetOnlyChromeDrop(
!dragEvent->mDefaultPreventedOnContent);
}
} else if (aEvent->message == NS_DRAGDROP_OVER && !isChromeDoc) {
} else if (aEvent->mMessage == NS_DRAGDROP_OVER && !isChromeDoc) {
// No one called preventDefault(), so handle drop only in chrome.
dragSession->SetOnlyChromeDrop(true);
}
@ -4058,7 +4058,7 @@ void
EventStateManager::GeneratePointerEnterExit(uint32_t aMessage, WidgetMouseEvent* aEvent)
{
WidgetPointerEvent pointerEvent(*aEvent);
pointerEvent.message = aMessage;
pointerEvent.mMessage = aMessage;
GenerateMouseEnterExit(&pointerEvent);
}
@ -4072,7 +4072,7 @@ EventStateManager::GenerateMouseEnterExit(WidgetMouseEvent* aMouseEvent)
// Hold onto old target content through the event and reset after.
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
switch(aMouseEvent->message) {
switch(aMouseEvent->mMessage) {
case NS_MOUSE_MOVE:
{
// Mouse movement is reported on the MouseEvent.movement{X,Y} fields.
@ -4268,7 +4268,7 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
//Hold onto old target content through the event and reset after.
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
switch(aDragEvent->message) {
switch(aDragEvent->mMessage) {
case NS_DRAGDROP_OVER:
{
// when dragging from one frame to another, events are fired in the
@ -4420,10 +4420,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
switch (aEvent->button) {
case WidgetMouseEvent::eLeftButton:
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mLastLeftMouseDownContent = mouseContent;
mLastLeftMouseDownContentParent = mouseContentParent;
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
if (mLastLeftMouseDownContent == mouseContent ||
mLastLeftMouseDownContentParent == mouseContent ||
mLastLeftMouseDownContent == mouseContentParent) {
@ -4438,10 +4438,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
break;
case WidgetMouseEvent::eMiddleButton:
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mLastMiddleMouseDownContent = mouseContent;
mLastMiddleMouseDownContentParent = mouseContentParent;
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
if (mLastMiddleMouseDownContent == mouseContent ||
mLastMiddleMouseDownContentParent == mouseContent ||
mLastMiddleMouseDownContent == mouseContentParent) {
@ -4456,10 +4456,10 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
break;
case WidgetMouseEvent::eRightButton:
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mLastRightMouseDownContent = mouseContent;
mLastRightMouseDownContentParent = mouseContentParent;
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
if (mLastRightMouseDownContent == mouseContent ||
mLastRightMouseDownContentParent == mouseContent ||
mLastRightMouseDownContent == mouseContentParent) {
@ -4573,8 +4573,8 @@ already_AddRefed<nsIContent>
EventStateManager::GetEventTargetContent(WidgetEvent* aEvent)
{
if (aEvent &&
(aEvent->message == NS_FOCUS_CONTENT ||
aEvent->message == NS_BLUR_CONTENT)) {
(aEvent->mMessage == NS_FOCUS_CONTENT ||
aEvent->mMessage == NS_BLUR_CONTENT)) {
nsCOMPtr<nsIContent> content = GetFocusedContent();
return content.forget();
}
@ -4942,7 +4942,7 @@ EventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
bool
EventStateManager::EventStatusOK(WidgetGUIEvent* aEvent)
{
return !(aEvent->message == NS_MOUSE_BUTTON_DOWN &&
return !(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
!sNormalLMouseEventInProcess);
}
@ -5038,7 +5038,7 @@ EventStateManager::DoContentCommandEvent(WidgetContentCommandEvent* aEvent)
nsCOMPtr<nsPIWindowRoot> root = window->GetTopWindowRoot();
NS_ENSURE_TRUE(root, NS_ERROR_FAILURE);
const char* cmd;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_CONTENT_COMMAND_CUT:
cmd = "cmd_cut";
break;
@ -5076,7 +5076,7 @@ EventStateManager::DoContentCommandEvent(WidgetContentCommandEvent* aEvent)
NS_ENSURE_SUCCESS(rv, rv);
aEvent->mIsEnabled = canDoIt;
if (canDoIt && !aEvent->mOnlyEnabledCheck) {
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_CONTENT_COMMAND_PASTE_TRANSFERABLE: {
nsCOMPtr<nsICommandController> commandController = do_QueryInterface(controller);
NS_ENSURE_STATE(commandController);
@ -5730,7 +5730,7 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
WidgetEvent* aEvent,
nsIDocument* aDocument) :
mIsHandlingUserInput(aIsHandlingUserInput),
mIsMouseDown(aEvent && aEvent->message == NS_MOUSE_BUTTON_DOWN),
mIsMouseDown(aEvent && aEvent->mMessage == NS_MOUSE_BUTTON_DOWN),
mResetFMMouseButtonHandlingState(false)
{
if (!aIsHandlingUserInput) {
@ -5744,8 +5744,9 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
if (!aDocument || !aEvent || !aEvent->mFlags.mIsTrusted) {
return;
}
mResetFMMouseButtonHandlingState = (aEvent->message == NS_MOUSE_BUTTON_DOWN ||
aEvent->message == NS_MOUSE_BUTTON_UP);
mResetFMMouseButtonHandlingState =
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP);
if (mResetFMMouseButtonHandlingState) {
nsFocusManager* fm = nsFocusManager::GetFocusManager();
NS_ENSURE_TRUE_VOID(fm);

View File

@ -957,7 +957,7 @@ private:
// has no frame. This is required for Web compatibility.
#define NS_EVENT_NEEDS_FRAME(event) \
(!(event)->HasPluginActivationEventMessage() && \
(event)->message != NS_MOUSE_CLICK && \
(event)->message != NS_MOUSE_DOUBLECLICK)
(event)->mMessage != NS_MOUSE_CLICK && \
(event)->mMessage != NS_MOUSE_DOUBLECLICK)
#endif // mozilla_EventStateManager_h_

View File

@ -456,7 +456,7 @@ IMEContentObserver::OnMouseButtonEvent(nsPresContext* aPresContext,
return false;
}
// Now, we need to notify only mouse down and mouse up event.
switch (aMouseEvent->message) {
switch (aMouseEvent->mMessage) {
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_BUTTON_DOWN:
break;
@ -501,7 +501,7 @@ IMEContentObserver::OnMouseButtonEvent(nsPresContext* aPresContext,
}
IMENotification notification(NOTIFY_IME_OF_MOUSE_BUTTON_EVENT);
notification.mMouseButtonEventData.mEventMessage = aMouseEvent->message;
notification.mMouseButtonEventData.mEventMessage = aMouseEvent->mMessage;
notification.mMouseButtonEventData.mOffset = charAtPt.mReply.mOffset;
notification.mMouseButtonEventData.mCursorPos.Set(
LayoutDeviceIntPoint::ToUntyped(charAtPt.refPoint));

View File

@ -1137,7 +1137,7 @@ IMEStateManager::DispatchCompositionEvent(
"mFlags={ mIsTrusted=%s, mPropagationStopped=%s } }, "
"aIsSynthesized=%s), tabParent=%p",
aEventTargetNode, aPresContext,
GetEventMessageName(aCompositionEvent->message),
GetEventMessageName(aCompositionEvent->mMessage),
GetBoolName(aCompositionEvent->mFlags.mIsTrusted),
GetBoolName(aCompositionEvent->mFlags.mPropagationStopped),
GetBoolName(aIsSynthesized), tabParent.get()));
@ -1147,7 +1147,7 @@ IMEStateManager::DispatchCompositionEvent(
return;
}
MOZ_ASSERT(aCompositionEvent->message != NS_COMPOSITION_UPDATE,
MOZ_ASSERT(aCompositionEvent->mMessage != NS_COMPOSITION_UPDATE,
"compositionupdate event shouldn't be dispatched manually");
EnsureTextCompositionArray();
@ -1163,7 +1163,7 @@ IMEStateManager::DispatchCompositionEvent(
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::DispatchCompositionEvent(), "
"adding new TextComposition to the array"));
MOZ_ASSERT(aCompositionEvent->message == NS_COMPOSITION_START);
MOZ_ASSERT(aCompositionEvent->mMessage == NS_COMPOSITION_START);
composition =
new TextComposition(aPresContext, aEventTargetNode, tabParent,
aCompositionEvent);
@ -1171,7 +1171,7 @@ IMEStateManager::DispatchCompositionEvent(
}
#ifdef DEBUG
else {
MOZ_ASSERT(aCompositionEvent->message != NS_COMPOSITION_START);
MOZ_ASSERT(aCompositionEvent->mMessage != NS_COMPOSITION_START);
}
#endif // #ifdef DEBUG
@ -1232,10 +1232,10 @@ IMEStateManager::HandleSelectionEvent(nsPresContext* aPresContext,
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::HandleSelectionEvent(aPresContext=0x%p, "
"aEventTargetContent=0x%p, aSelectionEvent={ message=%s, "
"aEventTargetContent=0x%p, aSelectionEvent={ mMessage=%s, "
"mFlags={ mIsTrusted=%s } }), tabParent=%p",
aPresContext, aEventTargetContent,
GetEventMessageName(aSelectionEvent->message),
GetEventMessageName(aSelectionEvent->mMessage),
GetBoolName(aSelectionEvent->mFlags.mIsTrusted),
tabParent.get()));
@ -1267,8 +1267,8 @@ IMEStateManager::OnCompositionEventDiscarded(
MOZ_LOG(sISMLog, LogLevel::Info,
("ISM: IMEStateManager::OnCompositionEventDiscarded(aCompositionEvent={ "
"message=%s, mFlags={ mIsTrusted=%s } })",
GetEventMessageName(aCompositionEvent->message),
"mMessage=%s, mFlags={ mIsTrusted=%s } })",
GetEventMessageName(aCompositionEvent->mMessage),
GetBoolName(aCompositionEvent->mFlags.mIsTrusted)));
if (!aCompositionEvent->mFlags.mIsTrusted) {
@ -1277,7 +1277,7 @@ IMEStateManager::OnCompositionEventDiscarded(
// Ignore compositionstart for now because sTextCompositions may not have
// been created yet.
if (aCompositionEvent->message == NS_COMPOSITION_START) {
if (aCompositionEvent->mMessage == NS_COMPOSITION_START) {
return;
}

View File

@ -30,7 +30,7 @@ public:
{
MOZ_ASSERT(mClass == eMutationEventClass,
"Duplicate() must be overridden by sub class");
InternalMutationEvent* result = new InternalMutationEvent(false, message);
InternalMutationEvent* result = new InternalMutationEvent(false, mMessage);
result->AssignMutationEventData(*this, true);
result->mFlags = mFlags;
return result;

View File

@ -151,7 +151,7 @@ KeyboardEvent::CharCode()
return mEvent->AsKeyboardEvent()->charCode;
}
switch (mEvent->message) {
switch (mEvent->mMessage) {
case NS_KEY_BEFORE_DOWN:
case NS_KEY_DOWN:
case NS_KEY_AFTER_DOWN:
@ -195,7 +195,7 @@ KeyboardEvent::Which()
return mInitializedWhichValue;
}
switch (mEvent->message) {
switch (mEvent->mMessage) {
case NS_KEY_BEFORE_DOWN:
case NS_KEY_DOWN:
case NS_KEY_AFTER_DOWN:

View File

@ -23,7 +23,7 @@ NotifyPaintEvent::NotifyPaintEvent(EventTarget* aOwner,
: Event(aOwner, aPresContext, aEvent)
{
if (mEvent) {
mEvent->message = aEventType;
mEvent->mMessage = aEventType;
}
if (aInvalidateRequests) {
mInvalidateRequests.AppendElements(Move(aInvalidateRequests->mRequests));

View File

@ -233,7 +233,7 @@ TextComposition::DispatchCompositionEvent(
RemoveControlCharactersFrom(aCompositionEvent->mData,
aCompositionEvent->mRanges);
}
if (aCompositionEvent->message == NS_COMPOSITION_COMMIT_AS_IS) {
if (aCompositionEvent->mMessage == NS_COMPOSITION_COMMIT_AS_IS) {
NS_ASSERTION(!aCompositionEvent->mRanges,
"mRanges of NS_COMPOSITION_COMMIT_AS_IS should be null");
aCompositionEvent->mRanges = nullptr;
@ -247,7 +247,7 @@ TextComposition::DispatchCompositionEvent(
} else {
aCompositionEvent->mData = mLastData;
}
} else if (aCompositionEvent->message == NS_COMPOSITION_COMMIT) {
} else if (aCompositionEvent->mMessage == NS_COMPOSITION_COMMIT) {
NS_ASSERTION(!aCompositionEvent->mRanges,
"mRanges of NS_COMPOSITION_COMMIT should be null");
aCompositionEvent->mRanges = nullptr;
@ -282,7 +282,7 @@ TextComposition::DispatchCompositionEvent(
// 2. non-empty string is committed at requesting cancel.
if (!aIsSynthesized && (mIsRequestingCommit || mIsRequestingCancel)) {
nsString* committingData = nullptr;
switch (aCompositionEvent->message) {
switch (aCompositionEvent->mMessage) {
case NS_COMPOSITION_END:
case NS_COMPOSITION_CHANGE:
case NS_COMPOSITION_COMMIT_AS_IS:
@ -312,7 +312,7 @@ TextComposition::DispatchCompositionEvent(
// composition string empty or didn't have clause information), we don't
// need to dispatch redundant DOM text event.
if (dispatchDOMTextEvent &&
aCompositionEvent->message != NS_COMPOSITION_CHANGE &&
aCompositionEvent->mMessage != NS_COMPOSITION_CHANGE &&
!mIsComposing && mLastData == aCompositionEvent->mData) {
dispatchEvent = dispatchDOMTextEvent = false;
}
@ -321,7 +321,7 @@ TextComposition::DispatchCompositionEvent(
// which modifies neither composition string, clauses nor caret
// position. In such case, we shouldn't dispatch DOM events.
if (dispatchDOMTextEvent &&
aCompositionEvent->message == NS_COMPOSITION_CHANGE &&
aCompositionEvent->mMessage == NS_COMPOSITION_CHANGE &&
mLastData == aCompositionEvent->mData &&
mRanges && aCompositionEvent->mRanges &&
mRanges->Equals(*aCompositionEvent->mRanges)) {
@ -340,7 +340,7 @@ TextComposition::DispatchCompositionEvent(
// the limitation of mapping between event messages and DOM event types,
// we cannot map multiple event messages to a DOM event type.
if (dispatchDOMTextEvent &&
aCompositionEvent->message != NS_COMPOSITION_CHANGE) {
aCompositionEvent->mMessage != NS_COMPOSITION_CHANGE) {
aCompositionEvent->mFlags =
CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_CHANGE,
aStatus, aCallBack);
@ -365,7 +365,7 @@ TextComposition::DispatchCompositionEvent(
if (aCompositionEvent->CausesDOMCompositionEndEvent()) {
// Dispatch a compositionend event if it's necessary.
if (aCompositionEvent->message != NS_COMPOSITION_END) {
if (aCompositionEvent->mMessage != NS_COMPOSITION_END) {
CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_END);
}
MOZ_ASSERT(!mIsComposing, "Why is the editor still composing?");
@ -411,7 +411,7 @@ TextComposition::NotityUpdateComposition(
// When compositon start, notify the rect of first offset character.
// When not compositon start, notify the rect of selected composition
// string if compositionchange event.
if (aCompositionEvent->message == NS_COMPOSITION_START) {
if (aCompositionEvent->mMessage == NS_COMPOSITION_START) {
nsCOMPtr<nsIWidget> widget = mPresContext->GetRootWidget();
// Update composition start offset
WidgetQueryContentEvent selectedTextEvent(true,

View File

@ -121,7 +121,8 @@ TouchEvent::Touches()
{
if (!mTouches) {
WidgetTouchEvent* touchEvent = mEvent->AsTouchEvent();
if (mEvent->message == NS_TOUCH_END || mEvent->message == NS_TOUCH_CANCEL) {
if (mEvent->mMessage == NS_TOUCH_END ||
mEvent->mMessage == NS_TOUCH_CANCEL) {
// for touchend events, remove any changed touches from the touches array
WidgetTouchEvent::AutoTouchArray unchangedTouches;
const WidgetTouchEvent::TouchArray& touches = touchEvent->touches;
@ -148,8 +149,8 @@ TouchEvent::TargetTouches()
for (uint32_t i = 0; i < touches.Length(); ++i) {
// for touchend/cancel events, don't append to the target list if this is a
// touch that is ending
if ((mEvent->message != NS_TOUCH_END &&
mEvent->message != NS_TOUCH_CANCEL) || !touches[i]->mChanged) {
if ((mEvent->mMessage != NS_TOUCH_END &&
mEvent->mMessage != NS_TOUCH_CANCEL) || !touches[i]->mChanged) {
if (touches[i]->mTarget == mEvent->originalTarget) {
targetTouches.AppendElement(touches[i]);
}

View File

@ -94,7 +94,7 @@ WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame,
WidgetWheelEvent* aEvent)
{
NS_ASSERTION(!sTargetFrame, "previous transaction is not finished!");
MOZ_ASSERT(aEvent->message == NS_WHEEL_WHEEL,
MOZ_ASSERT(aEvent->mMessage == NS_WHEEL_WHEEL,
"Transaction must be started with a wheel event");
ScrollbarsForWheel::OwnWheelTransaction(false);
sTargetFrame = aTargetFrame;
@ -175,7 +175,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent)
return;
}
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_WHEEL_WHEEL:
if (sMouseMoved != 0 &&
OutOfTime(sMouseMoved, GetIgnoreMoveDelayTime())) {
@ -413,7 +413,7 @@ ScrollbarsForWheel::PrepareToScrollText(EventStateManager* aESM,
nsIFrame* aTargetFrame,
WidgetWheelEvent* aEvent)
{
if (aEvent->message == NS_WHEEL_START) {
if (aEvent->mMessage == NS_WHEEL_START) {
WheelTransaction::OwnScrollbars(false);
if (!IsActive()) {
TemporarilyActivateAllPossibleScrollTargets(aESM, aTargetFrame, aEvent);

View File

@ -211,7 +211,7 @@ nsresult
HTMLButtonElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}
@ -222,7 +222,7 @@ HTMLButtonElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
bool outerActivateEvent =
((mouseEvent && mouseEvent->IsLeftClickEvent()) ||
(aVisitor.mEvent->message == NS_UI_ACTIVATE &&
(aVisitor.mEvent->mMessage == NS_UI_ACTIVATE &&
!mInInternalActivate));
if (outerActivateEvent) {
@ -282,7 +282,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_KEY_PRESS:
case NS_KEY_UP:
{
@ -290,9 +290,9 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// (bug 25300)
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
if ((keyEvent->keyCode == NS_VK_RETURN &&
NS_KEY_PRESS == aVisitor.mEvent->message) ||
NS_KEY_PRESS == aVisitor.mEvent->mMessage) ||
(keyEvent->keyCode == NS_VK_SPACE &&
NS_KEY_UP == aVisitor.mEvent->message)) {
NS_KEY_UP == aVisitor.mEvent->mMessage)) {
nsEventStatus status = nsEventStatus_eIgnore;
WidgetMouseEvent event(aVisitor.mEvent->mFlags.mIsTrusted,
@ -383,7 +383,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
//
// Using presShell to dispatch the event. It makes sure that
// event is not handled if the window is being destroyed.
if (presShell && (event.message != NS_FORM_SUBMIT ||
if (presShell && (event.mMessage != NS_FORM_SUBMIT ||
mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
// We know the element is a submit control, if this check is moved,
// make sure formnovalidate is used only if it's a submit control.

View File

@ -74,7 +74,7 @@ HTMLFieldSetElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
// Do not process any DOM events if the element is disabled.
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}

View File

@ -492,7 +492,7 @@ HTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
aVisitor.mWantsWillHandleEvent = true;
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
uint32_t msg = aVisitor.mEvent->message;
uint32_t msg = aVisitor.mEvent->mMessage;
if (msg == NS_FORM_SUBMIT) {
if (mGeneratingSubmit) {
aVisitor.mCanHandle = false;
@ -522,8 +522,8 @@ HTMLFormElement::WillHandleEvent(EventChainPostVisitor& aVisitor)
// If this is the bubble stage and there is a nested form below us which
// received a submit event we do *not* want to handle the submit event
// for this form too.
if ((aVisitor.mEvent->message == NS_FORM_SUBMIT ||
aVisitor.mEvent->message == NS_FORM_RESET) &&
if ((aVisitor.mEvent->mMessage == NS_FORM_SUBMIT ||
aVisitor.mEvent->mMessage == NS_FORM_RESET) &&
aVisitor.mEvent->mFlags.mInBubblingPhase &&
aVisitor.mEvent->originalTarget != static_cast<nsIContent*>(this)) {
aVisitor.mEvent->mFlags.mPropagationStopped = true;
@ -535,7 +535,7 @@ nsresult
HTMLFormElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
if (aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this)) {
uint32_t msg = aVisitor.mEvent->message;
uint32_t msg = aVisitor.mEvent->mMessage;
if (msg == NS_FORM_SUBMIT) {
// let the form know not to defer subsequent submissions
mDeferSubmission = false;

View File

@ -3025,7 +3025,7 @@ HTMLInputElement::NeedToInitializeEditorForEvent(
return false;
}
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_MOVE:
case NS_MOUSE_ENTER_WIDGET:
case NS_MOUSE_EXIT_WIDGET:
@ -3050,7 +3050,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
// Do not process any DOM events if the element is disabled
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}
@ -3088,7 +3088,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
bool outerActivateEvent =
((mouseEvent && mouseEvent->IsLeftClickEvent()) ||
(aVisitor.mEvent->message == NS_UI_ACTIVATE && !mInInternalActivate));
(aVisitor.mEvent->mMessage == NS_UI_ACTIVATE && !mInInternalActivate));
if (outerActivateEvent) {
aVisitor.mItemFlags |= NS_OUTER_ACTIVATE_EVENT;
@ -3153,7 +3153,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
}
if (IsSingleLineTextControl(false) &&
aVisitor.mEvent->message == NS_MOUSE_CLICK &&
aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
aVisitor.mEvent->AsMouseEvent()->button ==
WidgetMouseEvent::eMiddleButton) {
aVisitor.mEvent->mFlags.mNoContentDispatch = false;
@ -3163,7 +3163,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mItemFlags |= mType;
// Fire onchange (if necessary), before we do the blur, bug 357684.
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
// Experimental mobile types rely on the system UI to prevent users to not
// set invalid values but we have to be extra-careful. Especially if the
// option has been enabled on desktop.
@ -3178,8 +3178,8 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
}
if (mType == NS_FORM_INPUT_RANGE &&
(aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
aVisitor.mEvent->message == NS_BLUR_CONTENT)) {
(aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT)) {
// Just as nsGenericHTMLFormElementWithState::PreHandleEvent calls
// nsIFormControlFrame::SetFocus, we handle focus here.
nsIFrame* frame = GetPrimaryFrame();
@ -3197,7 +3197,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
// we want to end the spin. We do this here (rather than in
// PostHandleEvent) because we don't want to let content preventDefault()
// the end of the spin.
if (aVisitor.mEvent->message == NS_MOUSE_MOVE) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_MOVE) {
// Be aggressive about stopping the spin:
bool stopSpin = true;
nsNumberControlFrame* numberControlFrame =
@ -3228,13 +3228,13 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
if (stopSpin) {
StopNumberControlSpinnerSpin();
}
} else if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
StopNumberControlSpinnerSpin();
}
}
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
// Tell our frame it's getting focus so that it can make sure focus
// is moved to our anonymous text control.
nsNumberControlFrame* numberControlFrame =
@ -3254,7 +3254,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
// that).
frame->InvalidateFrame();
}
} else if (aVisitor.mEvent->message == NS_KEY_UP) {
} else if (aVisitor.mEvent->mMessage == NS_KEY_UP) {
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
if ((keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN) &&
!(keyEvent->IsShift() || keyEvent->IsControl() ||
@ -3286,7 +3286,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
textControl = numberControlFrame->GetAnonTextControl();
}
if (textControl && aVisitor.mEvent->originalTarget == textControl) {
if (aVisitor.mEvent->message == NS_EDITOR_INPUT) {
if (aVisitor.mEvent->mMessage == NS_EDITOR_INPUT) {
// Propogate the anon text control's new value to our HTMLInputElement:
nsAutoString value;
numberControlFrame->GetValueOfAnonTextControl(value);
@ -3300,7 +3300,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
numberControlFrame->HandlingInputEvent(false);
}
}
else if (aVisitor.mEvent->message == NS_FORM_CHANGE) {
else if (aVisitor.mEvent->mMessage == NS_FORM_CHANGE) {
// We cancel the DOM 'change' event that is fired for any change to our
// anonymous text control since we fire our own 'change' events and
// content shouldn't be seeing two 'change' events. Besides that we
@ -3588,15 +3588,15 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
return MaybeInitPickers(aVisitor);
}
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT &&
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT &&
MayFireChangeOnBlur() &&
!mIsDraggingRange) { // StartRangeThumbDrag already set mFocusedValue
GetValue(mFocusedValue);
}
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
if (mIsDraggingRange) {
FinishRangeThumbDrag();
} else if (mNumberControlSpinnerIsSpinning) {
@ -3604,7 +3604,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
}
UpdateValidityUIBits(aVisitor.mEvent->message == NS_FOCUS_CONTENT);
UpdateValidityUIBits(aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT);
UpdateState(true);
}
@ -3721,7 +3721,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
if (NS_SUCCEEDED(rv)) {
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
if (mType == NS_FORM_INPUT_NUMBER &&
keyEvent && keyEvent->message == NS_KEY_PRESS &&
keyEvent && keyEvent->mMessage == NS_KEY_PRESS &&
aVisitor.mEvent->mFlags.mIsTrusted &&
(keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN) &&
!(keyEvent->IsShift() || keyEvent->IsControl() ||
@ -3744,7 +3744,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
}
} else if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_FOCUS_CONTENT:
{
@ -3779,9 +3779,9 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// For backwards compat, trigger checks/radios/buttons with
// space or enter (bug 25300)
WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
if ((aVisitor.mEvent->message == NS_KEY_PRESS &&
if ((aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
keyEvent->keyCode == NS_VK_RETURN) ||
(aVisitor.mEvent->message == NS_KEY_UP &&
(aVisitor.mEvent->mMessage == NS_KEY_UP &&
keyEvent->keyCode == NS_VK_SPACE)) {
switch(mType) {
case NS_FORM_INPUT_CHECKBOX:
@ -3814,7 +3814,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
} // case
} // switch
}
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
if (aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
mType == NS_FORM_INPUT_RADIO && !keyEvent->IsAlt() &&
!keyEvent->IsControl() && !keyEvent->IsMeta()) {
bool isMovingBack = false;
@ -3866,7 +3866,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
* not submit, period.
*/
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
if (aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
keyEvent->keyCode == NS_VK_RETURN &&
(IsSingleLineTextControl(false, mType) ||
mType == NS_FORM_INPUT_NUMBER ||
@ -3876,7 +3876,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
NS_ENSURE_SUCCESS(rv, rv);
}
if (aVisitor.mEvent->message == NS_KEY_PRESS &&
if (aVisitor.mEvent->mMessage == NS_KEY_PRESS &&
mType == NS_FORM_INPUT_RANGE && !keyEvent->IsAlt() &&
!keyEvent->IsControl() && !keyEvent->IsMeta() &&
(keyEvent->keyCode == NS_VK_LEFT ||
@ -3966,7 +3966,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
nsNumberControlFrame* numberControlFrame =
do_QueryFrame(GetPrimaryFrame());
if (numberControlFrame) {
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN &&
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
IsMutable()) {
switch (numberControlFrame->GetSpinButtonForPointerEvent(
aVisitor.mEvent->AsMouseEvent())) {
@ -4028,7 +4028,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// pres shell. See bug 125624.
// TODO: removing this code and have the submit event sent by the
// form, see bug 592124.
if (presShell && (event.message != NS_FORM_SUBMIT ||
if (presShell && (event.mMessage != NS_FORM_SUBMIT ||
mForm->HasAttr(kNameSpaceID_None, nsGkAtoms::novalidate) ||
// We know the element is a submit control, if this check is moved,
// make sure formnovalidate is used only if it's a submit control.
@ -4083,7 +4083,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
return;
}
switch (aVisitor.mEvent->message)
switch (aVisitor.mEvent->mMessage)
{
case NS_MOUSE_BUTTON_DOWN:
case NS_TOUCH_START: {
@ -4100,7 +4100,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
inputEvent->IsOS()) {
break; // ignore
}
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aVisitor.mEvent->AsMouseEvent()->buttons ==
WidgetMouseEvent::eLeftButtonFlag) {
StartRangeThumbDrag(inputEvent);

View File

@ -104,7 +104,7 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mHandlingEvent ||
(!(mouseEvent && mouseEvent->IsLeftClickEvent()) &&
aVisitor.mEvent->message != NS_MOUSE_BUTTON_DOWN) ||
aVisitor.mEvent->mMessage != NS_MOUSE_BUTTON_DOWN) ||
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
!aVisitor.mPresContext ||
// Don't handle the event if it's already been handled by another label
@ -122,7 +122,7 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
if (content) {
mHandlingEvent = true;
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {
// We reset the mouse-down point on every event because there is

View File

@ -254,7 +254,7 @@ HTMLMenuItemElement::SetChecked(bool aChecked)
nsresult
HTMLMenuItemElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
if (aVisitor.mEvent->message == NS_MOUSE_CLICK) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK) {
bool originalCheckedValue = false;
switch (mType) {
@ -290,7 +290,7 @@ nsresult
HTMLMenuItemElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
// Check to see if the event was cancelled.
if (aVisitor.mEvent->message == NS_MOUSE_CLICK &&
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
aVisitor.mItemFlags & NS_CHECKED_IS_TOGGLED &&
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault) {
bool originalCheckedValue =

View File

@ -215,7 +215,7 @@ HTMLObjectElement::HandleFocusBlurPlugin(Element* aElement,
if (!aEvent->mFlags.mIsTrusted) {
return;
}
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_FOCUS_CONTENT: {
OnFocusBlurPlugin(aElement, true);
break;

View File

@ -1501,7 +1501,7 @@ nsresult
HTMLSelectElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}
@ -1511,7 +1511,7 @@ HTMLSelectElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
nsresult
HTMLSelectElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
// If the invalid UI is shown, we should show it while focused and
// update the invalid/valid UI.
mCanShowInvalidUI = !IsValid() && ShouldShowValidityUI();
@ -1522,7 +1522,7 @@ HTMLSelectElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// We don't have to update NS_EVENT_STATE_MOZ_UI_INVALID nor
// NS_EVENT_STATE_MOZ_UI_VALID given that the states should not change.
} else if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
} else if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
mCanShowInvalidUI = true;
mCanShowValidUI = true;

View File

@ -480,13 +480,13 @@ nsresult
HTMLTextAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
aVisitor.mCanHandle = false;
if (IsDisabledForEvents(aVisitor.mEvent->message)) {
if (IsDisabledForEvents(aVisitor.mEvent->mMessage)) {
return NS_OK;
}
// Don't dispatch a second select event if we are already handling
// one.
if (aVisitor.mEvent->message == NS_FORM_SELECTED) {
if (aVisitor.mEvent->mMessage == NS_FORM_SELECTED) {
if (mHandlingSelect) {
return NS_OK;
}
@ -499,14 +499,14 @@ HTMLTextAreaElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
if (aVisitor.mEvent->mFlags.mNoContentDispatch) {
aVisitor.mItemFlags |= NS_NO_CONTENT_DISPATCH;
}
if (aVisitor.mEvent->message == NS_MOUSE_CLICK &&
if (aVisitor.mEvent->mMessage == NS_MOUSE_CLICK &&
aVisitor.mEvent->AsMouseEvent()->button ==
WidgetMouseEvent::eMiddleButton) {
aVisitor.mEvent->mFlags.mNoContentDispatch = false;
}
// Fire onchange (if necessary), before we do the blur, bug 370521.
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
FireChangeEventIfNeeded();
}
@ -534,13 +534,13 @@ HTMLTextAreaElement::FireChangeEventIfNeeded()
nsresult
HTMLTextAreaElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
{
if (aVisitor.mEvent->message == NS_FORM_SELECTED) {
if (aVisitor.mEvent->mMessage == NS_FORM_SELECTED) {
mHandlingSelect = false;
}
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT ||
aVisitor.mEvent->message == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->message == NS_FOCUS_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
// If the invalid UI is shown, we should show it while focusing (and
// update). Otherwise, we should not.
GetValueInternal(mFocusedValue, true);

View File

@ -2250,7 +2250,7 @@ nsresult
nsGenericHTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
if (aVisitor.mEvent->mFlags.mIsTrusted) {
switch (aVisitor.mEvent->message) {
switch (aVisitor.mEvent->mMessage) {
case NS_FOCUS_CONTENT:
{
// Check to see if focus has bubbled up from a form control's

View File

@ -904,7 +904,7 @@ nsTextInputListener::HandleEvent(nsIDOMEvent* aEvent)
return NS_ERROR_UNEXPECTED;
}
if (keyEvent->message != NS_KEY_PRESS) {
if (keyEvent->mMessage != NS_KEY_PRESS) {
return NS_OK;
}

View File

@ -1929,7 +1929,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus)
}
bool currentlyTrackingTouch = (mActivePointerId >= 0);
if (aEvent.message == NS_TOUCH_START) {
if (aEvent.mMessage == NS_TOUCH_START) {
if (currentlyTrackingTouch || aEvent.touches.Length() > 1) {
// We're tracking a possible tap for another point, or we saw a
// touchstart for a later pointer after we canceled tracking of
@ -1969,7 +1969,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus)
LayoutDevicePoint currentPoint = LayoutDevicePoint(trackedTouch->mRefPoint.x, trackedTouch->mRefPoint.y);
int64_t time = aEvent.time;
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_TOUCH_MOVE:
if (std::abs(currentPoint.x - mGestureDownPoint.x) > sDragThreshold.width ||
std::abs(currentPoint.y - mGestureDownPoint.y) > sDragThreshold.height) {
@ -2046,7 +2046,7 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
const uint64_t& aInputBlockId,
const nsEventStatus& aApzResponse)
{
TABC_LOG("Receiving touch event of type %d\n", aEvent.message);
TABC_LOG("Receiving touch event of type %d\n", aEvent.mMessage);
WidgetTouchEvent localEvent(aEvent);
localEvent.widget = mPuppetWidget;
@ -2054,7 +2054,7 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
mPuppetWidget->GetDefaultScale());
if (localEvent.message == NS_TOUCH_START && AsyncPanZoomEnabled()) {
if (localEvent.mMessage == NS_TOUCH_START && AsyncPanZoomEnabled()) {
if (gfxPrefs::TouchActionEnabled()) {
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(mPuppetWidget,
localEvent, aInputBlockId, mSetAllowedTouchBehaviorCallback);
@ -2103,13 +2103,13 @@ TabChild::RecvRealDragEvent(const WidgetDragEvent& aEvent,
}
}
if (aEvent.message == NS_DRAGDROP_DROP) {
if (aEvent.mMessage == NS_DRAGDROP_DROP) {
bool canDrop = true;
if (!dragSession || NS_FAILED(dragSession->GetCanDrop(&canDrop)) ||
!canDrop) {
localEvent.message = NS_DRAGDROP_EXIT;
localEvent.mMessage = NS_DRAGDROP_EXIT;
}
} else if (aEvent.message == NS_DRAGDROP_OVER) {
} else if (aEvent.mMessage == NS_DRAGDROP_OVER) {
nsCOMPtr<nsIDragService> dragService =
do_GetService("@mozilla.org/widget/dragservice;1");
if (dragService) {
@ -2156,7 +2156,7 @@ TabChild::RecvRealKeyEvent(const WidgetKeyboardEvent& event,
{
AutoCacheNativeKeyCommands autoCache(mPuppetWidget);
if (event.message == NS_KEY_PRESS) {
if (event.mMessage == NS_KEY_PRESS) {
// If content code called preventDefault() on a keydown event, then we don't
// want to process any following keypress events.
if (mIgnoreKeyPressEvent) {
@ -2176,7 +2176,7 @@ TabChild::RecvRealKeyEvent(const WidgetKeyboardEvent& event,
localEvent.widget = mPuppetWidget;
nsEventStatus status = APZCCallbackHelper::DispatchWidgetEvent(localEvent);
if (event.message == NS_KEY_DOWN) {
if (event.mMessage == NS_KEY_DOWN) {
mIgnoreKeyPressEvent = status == nsEventStatus_eConsumeNoDefault;
}
@ -2210,7 +2210,7 @@ TabChild::RecvCompositionEvent(const WidgetCompositionEvent& event)
WidgetCompositionEvent localEvent(event);
localEvent.widget = mPuppetWidget;
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
unused << SendOnEventNeedingAckHandled(event.message);
unused << SendOnEventNeedingAckHandled(event.mMessage);
return true;
}
@ -2220,7 +2220,7 @@ TabChild::RecvSelectionEvent(const WidgetSelectionEvent& event)
WidgetSelectionEvent localEvent(event);
localEvent.widget = mPuppetWidget;
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
unused << SendOnEventNeedingAckHandled(event.message);
unused << SendOnEventNeedingAckHandled(event.mMessage);
return true;
}

View File

@ -1368,19 +1368,19 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
if (widget) {
// When we mouseenter the tab, the tab's cursor should
// become the current cursor. When we mouseexit, we stop.
if (NS_MOUSE_ENTER_WIDGET == event.message) {
if (NS_MOUSE_ENTER_WIDGET == event.mMessage) {
mTabSetsCursor = true;
if (mCustomCursor) {
widget->SetCursor(mCustomCursor, mCustomCursorHotspotX, mCustomCursorHotspotY);
} else if (mCursor != nsCursor(-1)) {
widget->SetCursor(mCursor);
}
} else if (NS_MOUSE_EXIT_WIDGET == event.message) {
} else if (NS_MOUSE_EXIT_WIDGET == event.mMessage) {
mTabSetsCursor = false;
}
}
if (NS_MOUSE_MOVE == event.message) {
if (NS_MOUSE_MOVE == event.mMessage) {
return SendRealMouseMoveEvent(event);
}
return SendRealMouseButtonEvent(event);
@ -1722,7 +1722,7 @@ bool TabParent::SendRealKeyEvent(WidgetKeyboardEvent& event)
MaybeNativeKeyBinding bindings;
bindings = void_t();
if (event.message == NS_KEY_PRESS) {
if (event.mMessage == NS_KEY_PRESS) {
nsCOMPtr<nsIWidget> widget = GetWidget();
AutoInfallibleTArray<mozilla::CommandInt, 4> singleLine;
@ -1754,7 +1754,7 @@ bool TabParent::SendRealTouchEvent(WidgetTouchEvent& event)
// confuses remote content and the panning and zooming logic into thinking
// that the added touches are part of the touchend/cancel, when actually
// they're not.
if (event.message == NS_TOUCH_END || event.message == NS_TOUCH_CANCEL) {
if (event.mMessage == NS_TOUCH_END || event.mMessage == NS_TOUCH_CANCEL) {
for (int i = event.touches.Length() - 1; i >= 0; i--) {
if (!event.touches[i]->mChanged) {
event.touches.RemoveElementAt(i);
@ -1776,7 +1776,7 @@ bool TabParent::SendRealTouchEvent(WidgetTouchEvent& event)
event.touches[i]->mRefPoint += offset;
}
return (event.message == NS_TOUCH_MOVE) ?
return (event.mMessage == NS_TOUCH_MOVE) ?
PBrowserParent::SendRealTouchMoveEvent(event, guid, blockId, apzResponse) :
PBrowserParent::SendRealTouchEvent(event, guid, blockId, apzResponse);
}
@ -2263,7 +2263,7 @@ TabParent::RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& aEvent)
if (mFrameElement &&
PresShell::BeforeAfterKeyboardEventEnabled() &&
localEvent.message != NS_KEY_PRESS) {
localEvent.mMessage != NS_KEY_PRESS) {
presShell->DispatchAfterKeyboardEvent(mFrameElement, localEvent,
aEvent.mFlags.mDefaultPrevented);
}
@ -2282,7 +2282,7 @@ TabParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent)
NS_WARN_IF(!aEvent.mSucceeded)) {
return true;
}
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_QUERY_TEXT_RECT:
case NS_QUERY_CARET_RECT:
case NS_QUERY_EDITOR_RECT:

View File

@ -1574,7 +1574,7 @@ nsresult nsPluginInstanceOwner::DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent)
WidgetEvent* theEvent = aFocusEvent->GetInternalNSEvent();
if (theEvent) {
WidgetGUIEvent focusEvent(theEvent->mFlags.mIsTrusted, theEvent->message,
WidgetGUIEvent focusEvent(theEvent->mFlags.mIsTrusted, theEvent->mMessage,
nullptr);
nsEventStatus rv = ProcessEvent(focusEvent);
if (nsEventStatus_eConsumeNoDefault == rv) {
@ -1683,7 +1683,7 @@ nsresult nsPluginInstanceOwner::DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent,
aMouseEvent->StopPropagation();
}
}
if (mouseEvent->message == NS_MOUSE_BUTTON_UP) {
if (mouseEvent->mMessage == NS_MOUSE_BUTTON_UP) {
mLastMouseDownButtonType = -1;
}
}
@ -1748,8 +1748,9 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
nsCOMPtr<nsIDOMDragEvent> dragEvent(do_QueryInterface(aEvent));
if (dragEvent && mInstance) {
WidgetEvent* ievent = aEvent->GetInternalNSEvent();
if ((ievent && ievent->mFlags.mIsTrusted) &&
ievent->message != NS_DRAGDROP_ENTER && ievent->message != NS_DRAGDROP_OVER) {
if (ievent && ievent->mFlags.mIsTrusted &&
ievent->mMessage != NS_DRAGDROP_ENTER &&
ievent->mMessage != NS_DRAGDROP_OVER) {
aEvent->PreventDefault();
}
@ -1806,7 +1807,7 @@ CocoaEventTypeForEvent(const WidgetGUIEvent& anEvent, nsIFrame* aObjectFrame)
return event->type;
}
switch (anEvent.message) {
switch (anEvent.mMessage) {
case NS_MOUSE_OVER:
return NPCocoaEventMouseEntered;
case NS_MOUSE_OUT:
@ -1847,12 +1848,12 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
InitializeNPCocoaEvent(&cocoaEvent);
cocoaEvent.type = CocoaEventTypeForEvent(*anEvent, aObjectFrame);
if (anEvent->message == NS_MOUSE_MOVE ||
anEvent->message == NS_MOUSE_BUTTON_DOWN ||
anEvent->message == NS_MOUSE_BUTTON_UP ||
anEvent->message == NS_MOUSE_SCROLL ||
anEvent->message == NS_MOUSE_OVER ||
anEvent->message == NS_MOUSE_OUT)
if (anEvent->mMessage == NS_MOUSE_MOVE ||
anEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
anEvent->mMessage == NS_MOUSE_BUTTON_UP ||
anEvent->mMessage == NS_MOUSE_SCROLL ||
anEvent->mMessage == NS_MOUSE_OVER ||
anEvent->mMessage == NS_MOUSE_OUT)
{
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(anEvent, aObjectFrame) -
aObjectFrame->GetContentRectRelativeToSelf().TopLeft();
@ -1868,7 +1869,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
cocoaEvent.data.mouse.pluginY = double(ptPx.y);
}
switch (anEvent->message) {
switch (anEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
{
@ -1911,7 +1912,8 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
// That keyEvent->mPluginTextEventString is non-empty is a signal that we should
// create a text event for the plugin, instead of a key event.
if ((anEvent->message == NS_KEY_DOWN) && !keyEvent->mPluginTextEventString.IsEmpty()) {
if (anEvent->mMessage == NS_KEY_DOWN &&
!keyEvent->mPluginTextEventString.IsEmpty()) {
cocoaEvent.type = NPCocoaEventTextInput;
const char16_t* pluginTextEventString = keyEvent->mPluginTextEventString.get();
cocoaEvent.data.text.text = (NPNSString*)
@ -1937,7 +1939,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
}
case NS_FOCUS_CONTENT:
case NS_BLUR_CONTENT:
cocoaEvent.data.focus.hasFocus = (anEvent->message == NS_FOCUS_CONTENT);
cocoaEvent.data.focus.hasFocus = (anEvent->mMessage == NS_FOCUS_CONTENT);
break;
default:
break;
@ -1975,7 +1977,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// focus unless it lost focus within the window. For example, ignore a blur
// event if it's coming due to the plugin's window deactivating.
nsCOMPtr<nsIContent> content = do_QueryReferent(mContent);
if (anEvent.message == NS_BLUR_CONTENT &&
if (anEvent.mMessage == NS_BLUR_CONTENT &&
ContentIsFocusedWithinWindow(content)) {
mShouldBlurOnActivate = true;
return nsEventStatus_eIgnore;
@ -1985,7 +1987,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// it focus. This might happen if it has focus, its window is blurred, then the
// window is made active again. The plugin never lost in-window focus, so it
// shouldn't get a focus event again.
if (anEvent.message == NS_FOCUS_CONTENT &&
if (anEvent.mMessage == NS_FOCUS_CONTENT &&
mLastContentFocused == true) {
mShouldBlurOnActivate = false;
return nsEventStatus_eIgnore;
@ -1994,9 +1996,9 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// Now, if we're going to send a focus event, update mLastContentFocused and
// tell any plugins in our window that we have taken focus, so they should
// perform any delayed blurs.
if (anEvent.message == NS_FOCUS_CONTENT ||
anEvent.message == NS_BLUR_CONTENT) {
mLastContentFocused = (anEvent.message == NS_FOCUS_CONTENT);
if (anEvent.mMessage == NS_FOCUS_CONTENT ||
anEvent.mMessage == NS_BLUR_CONTENT) {
mLastContentFocused = (anEvent.mMessage == NS_FOCUS_CONTENT);
mShouldBlurOnActivate = false;
PerformDelayedBlurs();
}
@ -2040,7 +2042,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
}
bool handled = (response == kNPEventHandled || response == kNPEventStartIME);
bool leftMouseButtonDown = (anEvent.message == NS_MOUSE_BUTTON_DOWN) &&
bool leftMouseButtonDown = (anEvent.mMessage == NS_MOUSE_BUTTON_DOWN) &&
(anEvent.AsMouseEvent()->button == WidgetMouseEvent::eLeftButton);
if (handled && !(leftMouseButtonDown && !mContentFocused)) {
rv = nsEventStatus_eConsumeNoDefault;
@ -2059,7 +2061,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// types
pluginEvent.event = 0;
const WidgetMouseEvent* mouseEvent = anEvent.AsMouseEvent();
switch (anEvent.message) {
switch (anEvent.mMessage) {
case NS_MOUSE_MOVE:
pluginEvent.event = WM_MOUSEMOVE;
break;
@ -2104,12 +2106,12 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// not the widget they were received on.
// See use of NPEvent in widget/windows/nsWindow.cpp
// for why this assert should be safe
NS_ASSERTION(anEvent.message == NS_MOUSE_BUTTON_DOWN ||
anEvent.message == NS_MOUSE_BUTTON_UP ||
anEvent.message == NS_MOUSE_DOUBLECLICK ||
anEvent.message == NS_MOUSE_OVER ||
anEvent.message == NS_MOUSE_OUT ||
anEvent.message == NS_MOUSE_MOVE,
NS_ASSERTION(anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ||
anEvent.mMessage == NS_MOUSE_BUTTON_UP ||
anEvent.mMessage == NS_MOUSE_DOUBLECLICK ||
anEvent.mMessage == NS_MOUSE_OVER ||
anEvent.mMessage == NS_MOUSE_OUT ||
anEvent.mMessage == NS_MOUSE_MOVE,
"Incorrect event type for coordinate translation");
nsPoint pt =
nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
@ -2122,7 +2124,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
}
}
else if (!pPluginEvent) {
switch (anEvent.message) {
switch (anEvent.mMessage) {
case NS_FOCUS_CONTENT:
pluginEvent.event = WM_SETFOCUS;
pluginEvent.wParam = 0;
@ -2163,7 +2165,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
switch(anEvent.mClass) {
case eMouseEventClass:
{
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_MOUSE_CLICK:
case NS_MOUSE_DOUBLECLICK:
@ -2191,13 +2193,13 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
Window root = None; // Could XQueryTree, but this is not important.
#endif
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_MOUSE_OVER:
case NS_MOUSE_OUT:
{
XCrossingEvent& event = pluginEvent.xcrossing;
event.type = anEvent.message == NS_MOUSE_OVER ?
event.type = anEvent.mMessage == NS_MOUSE_OVER ?
EnterNotify : LeaveNotify;
event.root = root;
event.time = anEvent.time;
@ -2235,7 +2237,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
case NS_MOUSE_BUTTON_UP:
{
XButtonEvent& event = pluginEvent.xbutton;
event.type = anEvent.message == NS_MOUSE_BUTTON_DOWN ?
event.type = anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ?
ButtonPress : ButtonRelease;
event.root = root;
event.time = anEvent.time;
@ -2278,7 +2280,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
static_cast<const GdkEventKey*>(anEvent.mPluginEvent);
event.keycode = gdkEvent->hardware_keycode;
event.state = gdkEvent->state;
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_KEY_DOWN:
// Handle NS_KEY_DOWN for modifier key presses
@ -2315,14 +2317,14 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
break;
default:
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_FOCUS_CONTENT:
case NS_BLUR_CONTENT:
{
XFocusChangeEvent &event = pluginEvent.xfocus;
event.type =
anEvent.message == NS_FOCUS_CONTENT ? FocusIn : FocusOut;
anEvent.mMessage == NS_FOCUS_CONTENT ? FocusIn : FocusOut;
// information lost:
event.mode = -1;
event.detail = NotifyDetailNone;
@ -2363,7 +2365,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
switch(anEvent.mClass) {
case eMouseEventClass:
{
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_MOUSE_CLICK:
case NS_MOUSE_DOUBLECLICK:
@ -2379,7 +2381,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
nsIntPoint pluginPoint(presContext->AppUnitsToDevPixels(appPoint.x),
presContext->AppUnitsToDevPixels(appPoint.y));
switch (anEvent.message)
switch (anEvent.mMessage)
{
case NS_MOUSE_MOVE:
{

View File

@ -590,7 +590,7 @@ SVGSVGElement::IsAttributeMapped(const nsIAtom* name) const
nsresult
SVGSVGElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
{
if (aVisitor.mEvent->message == NS_SVG_LOAD) {
if (aVisitor.mEvent->mMessage == NS_SVG_LOAD) {
if (mTimedDocumentRoot) {
mTimedDocumentRoot->Begin();
// Set 'resample needed' flag, so that if any script calls a DOM method

View File

@ -1265,18 +1265,18 @@ nsXULElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
if (IsRootOfNativeAnonymousSubtree() &&
(IsAnyOfXULElements(nsGkAtoms::scrollbar, nsGkAtoms::scrollcorner)) &&
(aVisitor.mEvent->message == NS_MOUSE_CLICK ||
aVisitor.mEvent->message == NS_MOUSE_DOUBLECLICK ||
aVisitor.mEvent->message == NS_XUL_COMMAND ||
aVisitor.mEvent->message == NS_CONTEXTMENU ||
aVisitor.mEvent->message == NS_DRAGDROP_START ||
aVisitor.mEvent->message == NS_DRAGDROP_GESTURE)) {
(aVisitor.mEvent->mMessage == NS_MOUSE_CLICK ||
aVisitor.mEvent->mMessage == NS_MOUSE_DOUBLECLICK ||
aVisitor.mEvent->mMessage == NS_XUL_COMMAND ||
aVisitor.mEvent->mMessage == NS_CONTEXTMENU ||
aVisitor.mEvent->mMessage == NS_DRAGDROP_START ||
aVisitor.mEvent->mMessage == NS_DRAGDROP_GESTURE)) {
// Don't propagate these events from native anonymous scrollbar.
aVisitor.mCanHandle = true;
aVisitor.mParentTarget = nullptr;
return NS_OK;
}
if (aVisitor.mEvent->message == NS_XUL_COMMAND &&
if (aVisitor.mEvent->mMessage == NS_XUL_COMMAND &&
aVisitor.mEvent->mClass == eInputEventClass &&
aVisitor.mEvent->originalTarget == static_cast<nsIContent*>(this) &&
!IsXULElement(nsGkAtoms::command)) {

View File

@ -4695,7 +4695,7 @@ nsEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
WidgetKeyboardEvent* nativeKeyEvent =
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
NS_ASSERTION(nativeKeyEvent->message == NS_KEY_PRESS,
NS_ASSERTION(nativeKeyEvent->mMessage == NS_KEY_PRESS,
"HandleKeyPressEvent gets non-keypress event");
// if we are readonly or disabled, then do nothing.
@ -5151,7 +5151,7 @@ nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent)
// strange event order.
bool needsWidget = false;
WidgetGUIEvent* widgetGUIEvent = nullptr;
switch (widgetEvent->message) {
switch (widgetEvent->mMessage) {
case NS_USER_DEFINED_EVENT:
// If events are not created with proper event interface, their message
// are initialized with NS_USER_DEFINED_EVENT. Let's ignore such event.

View File

@ -369,7 +369,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
// calling it, this queries the specific interface. If it would fail,
// each event handler would just ignore the event. So, in this method,
// you don't need to check if the QI succeeded before each call.
switch (internalEvent->message) {
switch (internalEvent->mMessage) {
// dragenter
case NS_DRAGDROP_ENTER: {
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);

View File

@ -594,7 +594,7 @@ nsHTMLEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
WidgetKeyboardEvent* nativeKeyEvent =
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
NS_ASSERTION(nativeKeyEvent->message == NS_KEY_PRESS,
NS_ASSERTION(nativeKeyEvent->mMessage == NS_KEY_PRESS,
"HandleKeyPressEvent gets non-keypress event");
switch (nativeKeyEvent->keyCode) {

View File

@ -362,7 +362,7 @@ nsPlaintextEditor::HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent)
WidgetKeyboardEvent* nativeKeyEvent =
aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent();
NS_ENSURE_TRUE(nativeKeyEvent, NS_ERROR_UNEXPECTED);
NS_ASSERTION(nativeKeyEvent->message == NS_KEY_PRESS,
NS_ASSERTION(nativeKeyEvent->mMessage == NS_KEY_PRESS,
"HandleKeyPressEvent gets non-keypress event");
switch (nativeKeyEvent->keyCode) {
@ -845,7 +845,7 @@ nsPlaintextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
WidgetCompositionEvent* compositionChangeEvent =
aDOMTextEvent->GetInternalNSEvent()->AsCompositionEvent();
NS_ENSURE_TRUE(compositionChangeEvent, NS_ERROR_INVALID_ARG);
MOZ_ASSERT(compositionChangeEvent->message == NS_COMPOSITION_CHANGE,
MOZ_ASSERT(compositionChangeEvent->mMessage == NS_COMPOSITION_CHANGE,
"The internal event should be NS_COMPOSITION_CHANGE");
EnsureComposition(compositionChangeEvent);

View File

@ -854,7 +854,7 @@ APZCTreeManager::UpdateWheelTransaction(WidgetInputEvent& aEvent)
return;
}
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_MOUSE_MOVE:
case NS_DRAGDROP_OVER: {
WidgetMouseEvent* mouseEvent = aEvent.AsMouseEvent();

View File

@ -251,14 +251,14 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
uint64_t aInputBlockId,
nsEventStatus aApzResponse)
{
if (aEvent.message == NS_TOUCH_START && aEvent.touches.Length() > 0) {
if (aEvent.mMessage == NS_TOUCH_START && aEvent.touches.Length() > 0) {
mActiveElementManager->SetTargetElement(aEvent.touches[0]->GetTarget());
}
bool isTouchPrevented = TouchManager::gPreventMouseEvents ||
aEvent.mFlags.mMultipleActionsPrevented;
bool sentContentResponse = false;
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_TOUCH_START: {
mTouchEndCancelled = false;
if (mPendingTouchPreventedResponse) {
@ -305,8 +305,8 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
aApzResponse == nsEventStatus_eConsumeDoDefault &&
gfxPrefs::PointerEventsEnabled()) {
WidgetTouchEvent cancelEvent(aEvent);
cancelEvent.message = NS_TOUCH_CANCEL;
cancelEvent.mFlags.mCancelable = false; // message != NS_TOUCH_CANCEL;
cancelEvent.mMessage = NS_TOUCH_CANCEL;
cancelEvent.mFlags.mCancelable = false; // mMessage != NS_TOUCH_CANCEL;
for (uint32_t i = 0; i < cancelEvent.touches.Length(); ++i) {
if (mozilla::dom::Touch* touch = cancelEvent.touches[i]) {
touch->convertToPointer = true;

View File

@ -500,7 +500,7 @@ AccessibleCaretEventHub::HandleMouseEvent(WidgetMouseEvent* aEvent)
kDefaultTouchId : mActiveTouchId);
nsPoint point = GetMouseEventPosition(aEvent);
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
AC_LOGV("Before NS_MOUSE_BUTTON_DOWN, state: %s", mState->Name());
rv = mState->OnPress(this, point, id);
@ -538,7 +538,7 @@ AccessibleCaretEventHub::HandleMouseEvent(WidgetMouseEvent* aEvent)
nsEventStatus
AccessibleCaretEventHub::HandleWheelEvent(WidgetWheelEvent* aEvent)
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_WHEEL_WHEEL:
AC_LOGV("NS_WHEEL_WHEEL, isMomentum %d, state: %s", aEvent->isMomentum,
mState->Name());
@ -573,7 +573,7 @@ AccessibleCaretEventHub::HandleTouchEvent(WidgetTouchEvent* aEvent)
aEvent->touches[0]->Identifier() : mActiveTouchId);
nsPoint point = GetTouchEventPosition(aEvent, id);
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START:
AC_LOGV("Before NS_TOUCH_START, state: %s", mState->Name());
rv = mState->OnPress(this, point, id);
@ -609,7 +609,7 @@ AccessibleCaretEventHub::HandleTouchEvent(WidgetTouchEvent* aEvent)
nsEventStatus
AccessibleCaretEventHub::HandleKeyboardEvent(WidgetKeyboardEvent* aEvent)
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_KEY_UP:
case NS_KEY_DOWN:
case NS_KEY_PRESS:

View File

@ -204,11 +204,11 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
nsPoint ptInRoot =
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, movePoint, rootFrame);
if (aEvent->message == NS_TOUCH_START ||
(aEvent->message == NS_MOUSE_BUTTON_DOWN &&
if (aEvent->mMessage == NS_TOUCH_START ||
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
mouseEvent->button == WidgetMouseEvent::eLeftButton)) {
// If having a active touch, ignore other touch down event
if (aEvent->message == NS_TOUCH_START && mActiveTouchId >= 0) {
if (aEvent->mMessage == NS_TOUCH_START && mActiveTouchId >= 0) {
return nsEventStatus_eConsumeNoDefault;
}
@ -231,9 +231,9 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
mActiveTouchId = -1;
LaunchLongTapDetector();
}
} else if (aEvent->message == NS_TOUCH_END ||
aEvent->message == NS_TOUCH_CANCEL ||
aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == NS_TOUCH_END ||
aEvent->mMessage == NS_TOUCH_CANCEL ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
CancelLongTapDetector();
if (mDragMode != NONE) {
// Only care about same id
@ -244,8 +244,8 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
}
return nsEventStatus_eConsumeNoDefault;
}
} else if (aEvent->message == NS_TOUCH_MOVE ||
aEvent->message == NS_MOUSE_MOVE) {
} else if (aEvent->mMessage == NS_TOUCH_MOVE ||
aEvent->mMessage == NS_MOUSE_MOVE) {
if (mDragMode == START_FRAME || mDragMode == END_FRAME) {
if (mActiveTouchId == nowTouchId) {
ptInRoot.y += mCaretCenterToDownPointOffsetY;
@ -271,7 +271,7 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
CancelLongTapDetector();
}
} else if (aEvent->message == NS_MOUSE_MOZLONGTAP) {
} else if (aEvent->mMessage == NS_MOUSE_MOZLONGTAP) {
if (!mVisible || !sSelectionCaretDetectsLongTap) {
SELECTIONCARETS_LOG("SelectWord from NS_MOUSE_MOZLONGTAP");

View File

@ -759,7 +759,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent)
nsEventStatus status = nsEventStatus_eIgnore;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START:
status = HandleTouchDownEvent(aEvent->AsTouchEvent());
break;
@ -790,7 +790,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent)
case NS_WHEEL_START:
case NS_WHEEL_STOP:
// Disable touch caret while key/wheel event is received.
TOUCHCARET_LOG("Receive key/wheel event %d", aEvent->message);
TOUCHCARET_LOG("Receive key/wheel event %d", aEvent->mMessage);
SetVisibility(false);
break;
case NS_MOUSE_MOZLONGTAP:

View File

@ -101,7 +101,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
bool& aIsHandlingUserInput,
nsCOMPtr<nsIContent>& aCurrentEventContent)
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START: {
aIsHandlingUserInput = true;
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
@ -123,7 +123,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
// If it is not already in the queue, it is a new touch
touch->mChanged = true;
}
touch->mMessage = aEvent->message;
touch->mMessage = aEvent->mMessage;
gCaptureTouchList->Put(id, touch);
}
break;
@ -140,7 +140,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
continue;
}
int32_t id = touch->Identifier();
touch->mMessage = aEvent->message;
touch->mMessage = aEvent->mMessage;
nsRefPtr<dom::Touch> oldTouch = gCaptureTouchList->GetWeak(id);
if (!oldTouch) {
@ -203,7 +203,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent,
if (!touch) {
continue;
}
touch->mMessage = aEvent->message;
touch->mMessage = aEvent->mMessage;
touch->mChanged = true;
int32_t id = touch->Identifier();

View File

@ -467,15 +467,15 @@ public:
virtual void HandleEvent(EventChainPostVisitor& aVisitor) override
{
if (aVisitor.mPresContext && aVisitor.mEvent->mClass != eBasicEventClass) {
if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN ||
aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
// Mouse-up and mouse-down events call nsFrame::HandlePress/Release
// which call GetContentOffsetsFromPoint which requires up-to-date layout.
// Bring layout up-to-date now so that GetCurrentEventFrame() below
// will return a real frame and we don't have to worry about
// destroying it by flushing later.
mPresShell->FlushPendingNotifications(Flush_Layout);
} else if (aVisitor.mEvent->message == NS_WHEEL_WHEEL &&
} else if (aVisitor.mEvent->mMessage == NS_WHEEL_WHEEL &&
aVisitor.mEventStatus != nsEventStatus_eConsumeNoDefault) {
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
if (frame) {
@ -492,8 +492,8 @@ public:
}
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
if (!frame &&
(aVisitor.mEvent->message == NS_MOUSE_BUTTON_UP ||
aVisitor.mEvent->message == NS_TOUCH_END)) {
(aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP ||
aVisitor.mEvent->mMessage == NS_TOUCH_END)) {
// Redirect BUTTON_UP and TOUCH_END events to the root frame to ensure
// that capturing is released.
frame = mPresShell->GetRootFrame();
@ -6342,7 +6342,7 @@ nsIPresShell::GetPointerInfo(uint32_t aPointerId, bool& aActiveState)
void
PresShell::UpdateActivePointerState(WidgetGUIEvent* aEvent)
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_ENTER_WIDGET:
// In this case we have to know information about available mouse pointers
if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
@ -6562,11 +6562,11 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
return;
}
if ((aEvent->message == NS_MOUSE_MOVE &&
if ((aEvent->mMessage == NS_MOUSE_MOVE &&
aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal) ||
aEvent->message == NS_MOUSE_ENTER_WIDGET ||
aEvent->message == NS_MOUSE_BUTTON_DOWN ||
aEvent->message == NS_MOUSE_BUTTON_UP) {
aEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
nsIFrame* rootFrame = GetRootFrame();
if (!rootFrame) {
nsView* rootView = mViewManager->GetRootView();
@ -6577,15 +6577,17 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
}
#ifdef DEBUG_MOUSE_LOCATION
if (aEvent->message == NS_MOUSE_ENTER_WIDGET)
if (aEvent->mMessage == NS_MOUSE_ENTER_WIDGET) {
printf("[ps=%p]got mouse enter for %p\n",
this, aEvent->widget);
}
printf("[ps=%p]setting mouse location to (%d,%d)\n",
this, mMouseLocation.x, mMouseLocation.y);
#endif
if (aEvent->message == NS_MOUSE_ENTER_WIDGET)
if (aEvent->mMessage == NS_MOUSE_ENTER_WIDGET) {
SynthesizeMouseMove(false);
} else if (aEvent->message == NS_MOUSE_EXIT_WIDGET) {
}
} else if (aEvent->mMessage == NS_MOUSE_EXIT_WIDGET) {
// Although we only care about the mouse moving into an area for which this
// pres shell doesn't receive mouse move events, we don't check which widget
// the mouse exit was for since this seems to vary by platform. Hopefully
@ -6662,7 +6664,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
return NS_OK;
}
int16_t button = mouseEvent->button;
switch (mouseEvent->message) {
switch (mouseEvent->mMessage) {
case NS_MOUSE_MOVE:
if (mouseEvent->buttons == 0) {
button = -1;
@ -6680,7 +6682,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
}
WidgetPointerEvent event(*mouseEvent);
event.message = pointerMessage;
event.mMessage = pointerMessage;
event.button = button;
event.pressure = event.buttons ?
mouseEvent->pressure ? mouseEvent->pressure : 0.5f :
@ -6691,7 +6693,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
// loop over all touches and dispatch pointer events on each touch
// copy the event
switch (touchEvent->message) {
switch (touchEvent->mMessage) {
case NS_TOUCH_MOVE:
pointerMessage = NS_POINTER_MOVE;
break;
@ -6840,7 +6842,7 @@ PresShell::DispatchBeforeKeyboardEventInternal(const nsTArray<nsCOMPtr<Element>
}
uint32_t message =
(aEvent.message == NS_KEY_DOWN) ? NS_KEY_BEFORE_DOWN : NS_KEY_BEFORE_UP;
(aEvent.mMessage == NS_KEY_DOWN) ? NS_KEY_BEFORE_DOWN : NS_KEY_BEFORE_UP;
nsCOMPtr<EventTarget> eventTarget;
// Dispatch before events from the outermost element.
for (int32_t i = length - 1; i >= 0; i--) {
@ -6874,7 +6876,7 @@ PresShell::DispatchAfterKeyboardEventInternal(const nsTArray<nsCOMPtr<Element> >
}
uint32_t message =
(aEvent.message == NS_KEY_DOWN) ? NS_KEY_AFTER_DOWN : NS_KEY_AFTER_UP;
(aEvent.mMessage == NS_KEY_DOWN) ? NS_KEY_AFTER_DOWN : NS_KEY_AFTER_UP;
bool embeddedCancelled = aEmbeddedCancelled;
nsCOMPtr<EventTarget> eventTarget;
// Dispatch after events from the innermost element.
@ -6901,8 +6903,8 @@ PresShell::DispatchAfterKeyboardEvent(nsINode* aTarget,
MOZ_ASSERT(aTarget);
MOZ_ASSERT(BeforeAfterKeyboardEventEnabled());
if (NS_WARN_IF(aEvent.message != NS_KEY_DOWN &&
aEvent.message != NS_KEY_UP)) {
if (NS_WARN_IF(aEvent.mMessage != NS_KEY_DOWN &&
aEvent.mMessage != NS_KEY_UP)) {
return;
}
@ -6931,7 +6933,7 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget,
nsEventStatus* aStatus,
EventDispatchingCallback* aEventCB)
{
if (aEvent.message == NS_KEY_PRESS ||
if (aEvent.mMessage == NS_KEY_PRESS ||
!BeforeAfterKeyboardEventEnabled()) {
EventDispatcher::Dispatch(aTarget, mPresContext,
&aEvent, nullptr, aStatus, aEventCB);
@ -6939,7 +6941,7 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget,
}
MOZ_ASSERT(aTarget);
MOZ_ASSERT(aEvent.message == NS_KEY_DOWN || aEvent.message == NS_KEY_UP);
MOZ_ASSERT(aEvent.mMessage == NS_KEY_DOWN || aEvent.mMessage == NS_KEY_UP);
// Build up a target chain. Each item in the chain will receive a before event.
nsAutoTArray<nsCOMPtr<Element>, 5> chain;
@ -7120,7 +7122,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
}
#ifdef DEBUG
if (aEvent->IsIMERelatedEvent()) {
nsPrintfCString warning("%d event is discarded", aEvent->message);
nsPrintfCString warning("%d event is discarded", aEvent->mMessage);
NS_WARNING(warning.get());
}
#endif
@ -7175,7 +7177,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
if (presShell != this) {
nsIFrame* frame = presShell->GetRootFrame();
if (!frame) {
if (aEvent->message == NS_QUERY_TEXT_CONTENT ||
if (aEvent->mMessage == NS_QUERY_TEXT_CONTENT ||
aEvent->IsContentCommandEvent()) {
return NS_OK;
}
@ -7194,7 +7196,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
if (aEvent->mClass == eKeyboardEventClass &&
mDocument && mDocument->EventHandlingSuppressed()) {
if (aEvent->message == NS_KEY_DOWN) {
if (aEvent->mMessage == NS_KEY_DOWN) {
mNoDelayedKeyEvents = true;
} else if (!mNoDelayedKeyEvents) {
DelayedEvent* event = new DelayedKeyEvent(aEvent->AsKeyboardEvent());
@ -7302,12 +7304,12 @@ PresShell::HandleEvent(nsIFrame* aFrame,
// all touch events except for touchstart use a captured target
if (aEvent->mClass == eTouchEventClass &&
aEvent->message != NS_TOUCH_START) {
aEvent->mMessage != NS_TOUCH_START) {
captureRetarget = true;
}
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
bool isWindowLevelMouseExit = (aEvent->message == NS_MOUSE_EXIT_WIDGET) &&
bool isWindowLevelMouseExit = (aEvent->mMessage == NS_MOUSE_EXIT_WIDGET) &&
(mouseEvent && mouseEvent->exit == WidgetMouseEvent::eTopLevel);
// Get the frame at the event point. However, don't do this if we're
@ -7318,7 +7320,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
if (!captureRetarget && !isWindowLevelMouseExit) {
nsPoint eventPoint;
uint32_t flags = 0;
if (aEvent->message == NS_TOUCH_START) {
if (aEvent->mMessage == NS_TOUCH_START) {
flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
// if this is a continuing session, ensure that all these events are
@ -7446,7 +7448,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
}
if (aEvent->mClass == ePointerEventClass &&
aEvent->message != NS_POINTER_DOWN) {
aEvent->mMessage != NS_POINTER_DOWN) {
if (WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent()) {
uint32_t pointerId = pointerEvent->pointerId;
nsIContent* pointerCapturingContent = GetPointerCapturingContent(pointerId);
@ -7461,8 +7463,8 @@ PresShell::HandleEvent(nsIFrame* aFrame,
frame = capturingFrame;
}
if (pointerEvent->message == NS_POINTER_UP ||
pointerEvent->message == NS_POINTER_CANCEL) {
if (pointerEvent->mMessage == NS_POINTER_UP ||
pointerEvent->mMessage == NS_POINTER_CANCEL) {
// Implicitly releasing capture for given pointer.
// LOST_POINTER_CAPTURE should be send after NS_POINTER_UP or NS_POINTER_CANCEL.
releasePointerCaptureCaller.SetTarget(pointerId, pointerCapturingContent);
@ -7475,9 +7477,10 @@ PresShell::HandleEvent(nsIFrame* aFrame,
// a document which needs events suppressed
if (aEvent->mClass == eMouseEventClass &&
frame->PresContext()->Document()->EventHandlingSuppressed()) {
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mNoDelayedMouseEvents = true;
} else if (!mNoDelayedMouseEvents && aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (!mNoDelayedMouseEvents &&
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
DelayedEvent* event = new DelayedMouseEvent(aEvent->AsMouseEvent());
if (!mDelayedEvents.AppendElement(event)) {
delete event;
@ -7493,7 +7496,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
PresShell* shell =
static_cast<PresShell*>(frame->PresContext()->PresShell());
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_MOVE:
case NS_TOUCH_CANCEL:
case NS_TOUCH_END: {
@ -7623,11 +7626,12 @@ PresShell::HandleEvent(nsIFrame* aFrame,
}
}
if (aEvent->message == NS_KEY_DOWN) {
if (aEvent->mMessage == NS_KEY_DOWN) {
NS_IF_RELEASE(gKeyDownTarget);
NS_IF_ADDREF(gKeyDownTarget = eventTarget);
}
else if ((aEvent->message == NS_KEY_PRESS || aEvent->message == NS_KEY_UP) &&
else if ((aEvent->mMessage == NS_KEY_PRESS ||
aEvent->mMessage == NS_KEY_UP) &&
gKeyDownTarget) {
// If a different element is now focused for the keypress/keyup event
// than what was focused during the keydown event, check if the new
@ -7643,7 +7647,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
}
}
if (aEvent->message == NS_KEY_UP) {
if (aEvent->mMessage == NS_KEY_UP) {
NS_RELEASE(gKeyDownTarget);
}
}
@ -7831,7 +7835,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
// XXX How about IME events and input events for plugins?
if (aEvent->mFlags.mIsTrusted) {
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_KEY_PRESS:
case NS_KEY_DOWN:
case NS_KEY_UP: {
@ -7851,7 +7855,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
// The event listeners in chrome can prevent this ESC behavior by
// calling prevent default on the preceding keydown/press events.
if (!mIsLastChromeOnlyEscapeKeyConsumed &&
aEvent->message == NS_KEY_UP) {
aEvent->mMessage == NS_KEY_UP) {
// ESC key released while in DOM fullscreen mode.
// Fully exit all browser windows and documents from
// fullscreen mode.
@ -7863,7 +7867,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
if (!mIsLastChromeOnlyEscapeKeyConsumed && pointerLockedDoc) {
aEvent->mFlags.mDefaultPrevented = true;
aEvent->mFlags.mOnlyChromeDispatch = true;
if (aEvent->message == NS_KEY_UP) {
if (aEvent->mMessage == NS_KEY_UP) {
nsIDocument::UnlockPointer();
}
}
@ -7902,7 +7906,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
}
}
if (aEvent->message == NS_CONTEXTMENU) {
if (aEvent->mMessage == NS_CONTEXTMENU) {
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (mouseEvent->context == WidgetMouseEvent::eContextMenuKey &&
!AdjustContextMenuKeyEvent(mouseEvent)) {
@ -7917,7 +7921,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
AutoHandlingUserInputStatePusher userInpStatePusher(isHandlingUserInput,
aEvent, mDocument);
if (aEvent->mFlags.mIsTrusted && aEvent->message == NS_MOUSE_MOVE) {
if (aEvent->mFlags.mIsTrusted && aEvent->mMessage == NS_MOUSE_MOVE) {
nsIPresShell::AllowMouseCapture(
EventStateManager::GetActiveEventStateManager() == manager);
}
@ -7962,12 +7966,12 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
}
}
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_KEY_PRESS:
case NS_KEY_DOWN:
case NS_KEY_UP: {
if (aEvent->AsKeyboardEvent()->keyCode == NS_VK_ESCAPE) {
if (aEvent->message == NS_KEY_UP) {
if (aEvent->mMessage == NS_KEY_UP) {
// Reset this flag after key up is handled.
mIsLastChromeOnlyEscapeKeyConsumed = false;
} else {
@ -8069,9 +8073,9 @@ PresShell::DispatchTouchEventToDOM(WidgetEvent* aEvent,
// calling preventDefault on touchstart or the first touchmove for a
// point prevents mouse events. calling it on the touchend should
// prevent click dispatching.
bool canPrevent = (aEvent->message == NS_TOUCH_START) ||
(aEvent->message == NS_TOUCH_MOVE && aTouchIsNew) ||
(aEvent->message == NS_TOUCH_END);
bool canPrevent = (aEvent->mMessage == NS_TOUCH_START) ||
(aEvent->mMessage == NS_TOUCH_MOVE && aTouchIsNew) ||
(aEvent->mMessage == NS_TOUCH_END);
bool preventDefault = false;
nsEventStatus tmpStatus = nsEventStatus_eIgnore;
WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
@ -8099,7 +8103,7 @@ PresShell::DispatchTouchEventToDOM(WidgetEvent* aEvent,
}
// copy the event
WidgetTouchEvent newEvent(touchEvent->mFlags.mIsTrusted,
touchEvent->message, touchEvent->widget);
touchEvent->mMessage, touchEvent->widget);
newEvent.AssignTouchEventData(*touchEvent, false);
newEvent.target = targetPtr;
@ -9536,7 +9540,7 @@ PresShell::DelayedMouseEvent::DelayedMouseEvent(WidgetMouseEvent* aEvent) :
{
WidgetMouseEvent* mouseEvent =
new WidgetMouseEvent(aEvent->mFlags.mIsTrusted,
aEvent->message,
aEvent->mMessage,
aEvent->widget,
aEvent->reason,
aEvent->context);
@ -9549,7 +9553,7 @@ PresShell::DelayedKeyEvent::DelayedKeyEvent(WidgetKeyboardEvent* aEvent) :
{
WidgetKeyboardEvent* keyEvent =
new WidgetKeyboardEvent(aEvent->mFlags.mIsTrusted,
aEvent->message,
aEvent->mMessage,
aEvent->widget);
keyEvent->AssignKeyEventData(*aEvent, false);
keyEvent->mFlags.mIsSynthesizedForTests = aEvent->mFlags.mIsSynthesizedForTests;

View File

@ -1133,7 +1133,7 @@ nsComboboxControlFrame::HandleEvent(nsPresContext* aPresContext,
}
#if COMBOBOX_ROLLUP_CONSUME_EVENT == 0
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
nsIWidget* widget = GetNearestWidget();
if (widget && GetContent() == widget->GetLastRollup()) {
// This event did a Rollup on this control - prevent it from opening

View File

@ -162,7 +162,7 @@ nsImageControlFrame::HandleEvent(nsPresContext* aPresContext,
*aEventStatus = nsEventStatus_eIgnore;
if (aEvent->message == NS_MOUSE_BUTTON_UP &&
if (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
// Store click point for HTMLInputElement::SubmitNamesValues
// Do this on MouseUp because the specs don't say and that's what IE does

View File

@ -898,11 +898,11 @@ nsListControlFrame::HandleEvent(nsPresContext* aPresContext,
"NS_MOUSE_LEFT_CLICK",
"NS_MOUSE_MIDDLE_CLICK",
"NS_MOUSE_RIGHT_CLICK"};
int inx = aEvent->message-NS_MOUSE_MESSAGE_START;
int inx = aEvent->mMessage-NS_MOUSE_MESSAGE_START;
if (inx >= 0 && inx <= (NS_MOUSE_RIGHT_CLICK-NS_MOUSE_MESSAGE_START)) {
printf("Mouse in ListFrame %s [%d]\n", desc[inx], aEvent->message);
printf("Mouse in ListFrame %s [%d]\n", desc[inx], aEvent->mMessage);
} else {
printf("Mouse in ListFrame <UNKNOWN> [%d]\n", aEvent->message);
printf("Mouse in ListFrame <UNKNOWN> [%d]\n", aEvent->mMessage);
}*/
if (nsEventStatus_eConsumeNoDefault == *aEventStatus)

View File

@ -2558,7 +2558,7 @@ nsFrame::HandleEvent(nsPresContext* aPresContext,
nsEventStatus* aEventStatus)
{
if (aEvent->message == NS_MOUSE_MOVE) {
if (aEvent->mMessage == NS_MOUSE_MOVE) {
// XXX If the second argument of HandleDrag() is WidgetMouseEvent,
// the implementation becomes simpler.
return HandleDrag(aPresContext, aEvent, aEventStatus);
@ -2567,9 +2567,11 @@ nsFrame::HandleEvent(nsPresContext* aPresContext,
if ((aEvent->mClass == eMouseEventClass &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
aEvent->mClass == eTouchEventClass) {
if (aEvent->message == NS_MOUSE_BUTTON_DOWN || aEvent->message == NS_TOUCH_START) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_TOUCH_START) {
HandlePress(aPresContext, aEvent, aEventStatus);
} else if (aEvent->message == NS_MOUSE_BUTTON_UP || aEvent->message == NS_TOUCH_END) {
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP ||
aEvent->mMessage == NS_TOUCH_END) {
HandleRelease(aPresContext, aEvent, aEventStatus);
}
}
@ -2602,8 +2604,8 @@ nsFrame::GetDataForTableSelection(const nsFrameSelection* aFrameSelection,
// (Mouse down does normal selection unless Ctrl/Cmd is pressed)
bool doTableSelection =
displaySelection == nsISelectionDisplay::DISPLAY_ALL && selectingTableCells &&
(aMouseEvent->message == NS_MOUSE_MOVE ||
(aMouseEvent->message == NS_MOUSE_BUTTON_UP &&
(aMouseEvent->mMessage == NS_MOUSE_MOVE ||
(aMouseEvent->mMessage == NS_MOUSE_BUTTON_UP &&
aMouseEvent->button == WidgetMouseEvent::eLeftButton) ||
aMouseEvent->IsShift());

View File

@ -651,7 +651,7 @@ nsresult nsHTMLFramesetFrame::HandleEvent(nsPresContext* aPresContext,
NS_ENSURE_ARG_POINTER(aEventStatus);
if (mDragger) {
// the nsFramesetBorderFrame has captured NS_MOUSE_DOWN
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_MOVE:
MouseDrag(aPresContext, aEvent);
break;
@ -1537,7 +1537,7 @@ nsHTMLFramesetBorderFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
if (aEvent->message == NS_MOUSE_BUTTON_DOWN &&
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
nsHTMLFramesetFrame* parentFrame = do_QueryFrame(GetParent());
if (parentFrame) {

View File

@ -2010,9 +2010,9 @@ nsImageFrame::HandleEvent(nsPresContext* aPresContext,
{
NS_ENSURE_ARG_POINTER(aEventStatus);
if ((aEvent->message == NS_MOUSE_BUTTON_UP &&
if ((aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
aEvent->message == NS_MOUSE_MOVE) {
aEvent->mMessage == NS_MOUSE_MOVE) {
nsImageMap* map = GetImageMap();
bool isServerMap = IsServerImageMap();
if ((nullptr != map) || isServerMap) {
@ -2050,7 +2050,7 @@ nsImageFrame::HandleEvent(nsPresContext* aPresContext,
uri->SetSpec(spec);
bool clicked = false;
if (aEvent->message == NS_MOUSE_BUTTON_UP) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
*aEventStatus = nsEventStatus_eConsumeDoDefault;
clicked = true;
}

View File

@ -1761,13 +1761,13 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
mInstanceOwner->ConsiderNewEventloopNestingLevel();
if (anEvent->message == NS_PLUGIN_ACTIVATE) {
if (anEvent->mMessage == NS_PLUGIN_ACTIVATE) {
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(GetContent());
if (fm && elem)
return fm->SetFocus(elem, 0);
}
else if (anEvent->message == NS_PLUGIN_FOCUS) {
else if (anEvent->mMessage == NS_PLUGIN_FOCUS) {
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm)
return fm->FocusPlugin(GetContent());
@ -1788,8 +1788,8 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
#ifdef XP_MACOSX
// we want to process some native mouse events in the cocoa event model
if ((anEvent->message == NS_MOUSE_ENTER_WIDGET ||
anEvent->message == NS_WHEEL_WHEEL) &&
if ((anEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
anEvent->mMessage == NS_WHEEL_WHEEL) &&
mInstanceOwner->GetEventModel() == NPEventModelCocoa) {
*anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
// Due to plugin code reentering Gecko, this frame may be dead at this
@ -1801,7 +1801,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
// and mouse-up) are needed to make the routing of mouse events while
// dragging conform to standard OS X practice, and to the Cocoa NPAPI spec.
// See bug 525078 and bug 909678.
if (anEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (anEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED);
}
#endif
@ -1812,7 +1812,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
// nsPluginFrameSuper::HandleEvent() might have killed us.
#ifdef XP_MACOSX
if (anEvent->message == NS_MOUSE_BUTTON_UP) {
if (anEvent->mMessage == NS_MOUSE_BUTTON_UP) {
nsIPresShell::SetCapturingContent(nullptr, 0);
}
#endif

View File

@ -118,7 +118,7 @@ GetActionForEvent(nsIDOMEvent* aEvent)
}
if (keyEvent->mFlags.mInSystemGroup) {
NS_ASSERTION(keyEvent->message == NS_KEY_DOWN,
NS_ASSERTION(keyEvent->mMessage == NS_KEY_DOWN,
"Assuming we're listening only keydown event in system group");
return eEventAction_StopPropagation;
}
@ -126,8 +126,8 @@ GetActionForEvent(nsIDOMEvent* aEvent)
if (keyEvent->IsAlt() || keyEvent->IsControl() || keyEvent->IsMeta()) {
// Don't consume keydown event because following keypress event may be
// handled as access key or shortcut key.
return (keyEvent->message == NS_KEY_DOWN) ? eEventAction_StopPropagation :
eEventAction_Suppress;
return (keyEvent->mMessage == NS_KEY_DOWN) ? eEventAction_StopPropagation :
eEventAction_Suppress;
}
static const uint32_t kOKKeyCodes[] = {

View File

@ -44,7 +44,8 @@ struct AnimationEventInfo {
// InternalAnimationEvent doesn't support copy-construction, so we need
// to ourselves in order to work with nsTArray
AnimationEventInfo(const AnimationEventInfo &aOther)
: mElement(aOther.mElement), mEvent(true, aOther.mEvent.message)
: mElement(aOther.mElement)
, mEvent(true, aOther.mEvent.mMessage)
{
mEvent.AssignAnimationEventData(aOther.mEvent, false);
}

View File

@ -110,7 +110,7 @@ nsButtonBoxFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_KEY_DOWN: {
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
if (!keyEvent) {

View File

@ -394,7 +394,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
bool onmenu = IsOnMenu();
if (aEvent->message == NS_KEY_PRESS && !IsDisabled()) {
if (aEvent->mMessage == NS_KEY_PRESS && !IsDisabled()) {
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
uint32_t keyCode = keyEvent->keyCode;
#ifdef XP_MACOSX
@ -413,7 +413,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
}
#endif
}
else if (aEvent->message == NS_MOUSE_BUTTON_DOWN &&
else if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
!IsDisabled() && IsMenu()) {
// The menu item was selected. Bring up the menu.
@ -431,10 +431,10 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
}
else if (
#ifndef NSCONTEXTMENUISMOUSEUP
(aEvent->message == NS_MOUSE_BUTTON_UP &&
(aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eRightButton) &&
#else
aEvent->message == NS_CONTEXTMENU &&
aEvent->mMessage == NS_CONTEXTMENU &&
#endif
onmenu && !IsMenu() && !IsDisabled()) {
// if this menu is a context menu it accepts right-clicks...fire away!
@ -452,14 +452,14 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
Execute(aEvent);
}
}
else if (aEvent->message == NS_MOUSE_BUTTON_UP &&
else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
!IsMenu() && !IsDisabled()) {
// Execute the execute event handler.
*aEventStatus = nsEventStatus_eConsumeNoDefault;
Execute(aEvent);
}
else if (aEvent->message == NS_MOUSE_OUT) {
else if (aEvent->mMessage == NS_MOUSE_OUT) {
// Kill our timer if one is active.
if (mOpenTimer) {
mOpenTimer->Cancel();
@ -479,7 +479,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
}
}
}
else if (aEvent->message == NS_MOUSE_MOVE &&
else if (aEvent->mMessage == NS_MOUSE_MOVE &&
(onmenu || (menuParent && menuParent->IsMenuBar()))) {
if (gEatMouseMove) {
gEatMouseMove = false;

View File

@ -61,7 +61,7 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
nsWeakFrame weakFrame(this);
bool doDefault = true;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START:
case NS_MOUSE_BUTTON_DOWN: {
if (aEvent->mClass == eTouchEventClass ||

View File

@ -205,7 +205,7 @@ nsRootBoxFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
if (aEvent->message == NS_MOUSE_BUTTON_UP) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}

View File

@ -83,8 +83,7 @@ nsAutoRepeatBoxFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
switch(aEvent->message)
{
switch(aEvent->mMessage) {
// repeat mode may be "hover" for repeating while the mouse is hovering
// over the element, otherwise repetition is done while the element is
// active (pressed).

View File

@ -52,7 +52,7 @@ nsScrollbarButtonFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
mCursorOnThis = true;
// if we didn't handle the press ourselves, pass it on to the superclass

View File

@ -477,7 +477,7 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
if (isDraggingThumb())
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_MOVE:
case NS_MOUSE_MOVE: {
nsPoint eventPoint;
@ -596,9 +596,9 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eRightButton) {
// HandlePress and HandleRelease are usually called via
// nsFrame::HandleEvent, but only for the left mouse button.
if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
HandlePress(aPresContext, aEvent, aEventStatus);
} else if (aEvent->message == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
HandleRelease(aPresContext, aEvent, aEventStatus);
}
@ -607,10 +607,13 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
#endif
// XXX hack until handle release is actually called in nsframe.
// if (aEvent->message == NS_MOUSE_OUT || aEvent->message == NS_MOUSE_RIGHT_BUTTON_UP || aEvent->message == NS_MOUSE_LEFT_BUTTON_UP)
// HandleRelease(aPresContext, aEvent, aEventStatus);
// if (aEvent->mMessage == NS_MOUSE_OUT ||
// aEvent->mMessage == NS_MOUSE_RIGHT_BUTTON_UP ||
// aEvent->mMessage == NS_MOUSE_LEFT_BUTTON_UP) {
// HandleRelease(aPresContext, aEvent, aEventStatus);
// }
if (aEvent->message == NS_MOUSE_OUT && mChange)
if (aEvent->mMessage == NS_MOUSE_OUT && mChange)
HandleRelease(aPresContext, aEvent, aEventStatus);
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
@ -1042,7 +1045,7 @@ nsSliderFrame::RemoveListener()
bool
nsSliderFrame::ShouldScrollForEvent(WidgetGUIEvent* aEvent)
{
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_TOUCH_START:
case NS_TOUCH_END:
return true;
@ -1070,11 +1073,11 @@ nsSliderFrame::ShouldScrollToClickForEvent(WidgetGUIEvent* aEvent)
return false;
}
if (aEvent->message == NS_TOUCH_START) {
if (aEvent->mMessage == NS_TOUCH_START) {
return GetScrollToClick();
}
if (aEvent->message != NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
return false;
}

View File

@ -388,7 +388,7 @@ nsSplitterFrame::HandleEvent(nsPresContext* aPresContext,
nsWeakFrame weakFrame(this);
nsRefPtr<nsSplitterFrameInner> kungFuDeathGrip(mInner);
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_MOVE:
mInner->MouseDrag(aPresContext, aEvent);
break;

View File

@ -66,7 +66,7 @@ nsTitleBarFrame::HandleEvent(nsPresContext* aPresContext,
bool doDefault = true;
switch (aEvent->message) {
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN: {
if (aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {

View File

@ -2563,7 +2563,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus)
{
if (aEvent->message == NS_MOUSE_OVER || aEvent->message == NS_MOUSE_MOVE) {
if (aEvent->mMessage == NS_MOUSE_OVER || aEvent->mMessage == NS_MOUSE_MOVE) {
nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
int32_t xTwips = pt.x - mInnerBox.x;
int32_t yTwips = pt.y - mInnerBox.y;
@ -2576,14 +2576,12 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
if (mMouseOverRow != -1)
InvalidateRow(mMouseOverRow);
}
}
else if (aEvent->message == NS_MOUSE_OUT) {
} else if (aEvent->mMessage == NS_MOUSE_OUT) {
if (mMouseOverRow != -1) {
InvalidateRow(mMouseOverRow);
mMouseOverRow = -1;
}
}
else if (aEvent->message == NS_DRAGDROP_ENTER) {
} else if (aEvent->mMessage == NS_DRAGDROP_ENTER) {
if (!mSlots)
mSlots = new Slots();
@ -2600,8 +2598,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
mSlots->mDropRow = -1;
mSlots->mDropOrient = -1;
mSlots->mDragAction = GetDropEffect(aEvent);
}
else if (aEvent->message == NS_DRAGDROP_OVER) {
} else if (aEvent->mMessage == NS_DRAGDROP_OVER) {
// The mouse is hovering over this tree. If we determine things are
// different from the last time, invalidate the drop feedback at the old
// position, query the view to see if the current location is droppable,
@ -2710,8 +2707,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
// Indicate that the drop is allowed by preventing the default behaviour.
if (mSlots->mDropAllowed)
*aEventStatus = nsEventStatus_eConsumeNoDefault;
}
else if (aEvent->message == NS_DRAGDROP_DROP) {
} else if (aEvent->mMessage == NS_DRAGDROP_DROP) {
// this event was meant for another frame, so ignore it
if (!mSlots)
return NS_OK;
@ -2735,8 +2731,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
mSlots->mDropOrient = -1;
mSlots->mIsDragging = false;
*aEventStatus = nsEventStatus_eConsumeNoDefault; // already handled the drop
}
else if (aEvent->message == NS_DRAGDROP_EXIT) {
} else if (aEvent->mMessage == NS_DRAGDROP_EXIT) {
// this event was meant for another frame, so ignore it
if (!mSlots)
return NS_OK;

View File

@ -753,11 +753,11 @@ nsViewManager::DispatchEvent(WidgetGUIEvent *aEvent,
// Ignore mouse exit and enter (we'll get moves if the user
// is really moving the mouse) since we get them when we
// create and destroy widgets.
mouseEvent->message != NS_MOUSE_EXIT_WIDGET &&
mouseEvent->message != NS_MOUSE_ENTER_WIDGET) ||
mouseEvent->mMessage != NS_MOUSE_EXIT_WIDGET &&
mouseEvent->mMessage != NS_MOUSE_ENTER_WIDGET) ||
aEvent->HasKeyEventMessage() ||
aEvent->HasIMEEventMessage() ||
aEvent->message == NS_PLUGIN_INPUT_EVENT) {
aEvent->mMessage == NS_PLUGIN_INPUT_EVENT) {
gLastUserEventTime = PR_IntervalToMicroseconds(PR_IntervalNow());
}

View File

@ -599,7 +599,7 @@ class WidgetEvent
protected:
WidgetEvent(bool aIsTrusted, uint32_t aMessage, EventClassID aEventClassID)
: mClass(aEventClassID)
, message(aMessage)
, mMessage(aMessage)
, refPoint(0, 0)
, lastRefPoint(0, 0)
, time(0)
@ -621,7 +621,7 @@ protected:
public:
WidgetEvent(bool aIsTrusted, uint32_t aMessage)
: mClass(eBasicEventClass)
, message(aMessage)
, mMessage(aMessage)
, refPoint(0, 0)
, lastRefPoint(0, 0)
, time(0)
@ -650,7 +650,7 @@ public:
{
MOZ_ASSERT(mClass == eBasicEventClass,
"Duplicate() must be overridden by sub class");
WidgetEvent* result = new WidgetEvent(false, message);
WidgetEvent* result = new WidgetEvent(false, mMessage);
result->AssignEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -658,7 +658,7 @@ public:
EventClassID mClass;
// See GUI MESSAGES,
uint32_t message;
uint32_t mMessage;
// Relative to the widget of the event, or if there is no widget then it is
// in screen coordinates. Not modified by layout code.
LayoutDeviceIntPoint refPoint;
@ -686,7 +686,7 @@ public:
void AssignEventData(const WidgetEvent& aEvent, bool aCopyTargets)
{
// mClass should be initialized with the constructor.
// message should be initialized with the constructor.
// mMessage should be initialized with the constructor.
refPoint = aEvent.refPoint;
// lastRefPoint doesn't need to be copied.
time = aEvent.time;
@ -735,24 +735,24 @@ public:
bool IsNativeEventDelivererForPlugin() const;
/**
* Returns true if the event message is one of mouse events.
* Returns true if the event mMessage is one of mouse events.
*/
bool HasMouseEventMessage() const;
/**
* Returns true if the event message is one of drag events.
* Returns true if the event mMessage is one of drag events.
*/
bool HasDragEventMessage() const;
/**
* Returns true if the event message is one of key events.
* Returns true if the event mMessage is one of key events.
*/
bool HasKeyEventMessage() const;
/**
* Returns true if the event message is one of composition events or text
* Returns true if the event mMessage is one of composition events or text
* event.
*/
bool HasIMEEventMessage() const;
/**
* Returns true if the event message is one of plugin activation events.
* Returns true if the event mMessage is one of plugin activation events.
*/
bool HasPluginActivationEventMessage() const;
@ -842,7 +842,7 @@ public:
MOZ_ASSERT(mClass == eGUIEventClass,
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetGUIEvent* result = new WidgetGUIEvent(false, message, nullptr);
WidgetGUIEvent* result = new WidgetGUIEvent(false, mMessage, nullptr);
result->AssignGUIEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -1006,7 +1006,7 @@ public:
MOZ_ASSERT(mClass == eInputEventClass,
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetInputEvent* result = new WidgetInputEvent(false, message, nullptr);
WidgetInputEvent* result = new WidgetInputEvent(false, mMessage, nullptr);
result->AssignInputEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -1175,7 +1175,7 @@ public:
{
MOZ_ASSERT(mClass == eUIEventClass,
"Duplicate() must be overridden by sub class");
InternalUIEvent* result = new InternalUIEvent(false, message);
InternalUIEvent* result = new InternalUIEvent(false, mMessage);
result->AssignUIEventData(*this, true);
result->mFlags = mFlags;
return result;

View File

@ -515,11 +515,11 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
aEvent.mSucceeded = false;
aEvent.mReply.mFocusedWidget = aWidget;
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_QUERY_SELECTED_TEXT:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
"aEvent={ message=NS_QUERY_SELECTED_TEXT }, aWidget=0x%p)",
"aEvent={ mMessage=NS_QUERY_SELECTED_TEXT }, aWidget=0x%p)",
this, aWidget));
if (NS_WARN_IF(!IsSelectionValid())) {
// If content cache hasn't been initialized properly, make the query
@ -560,7 +560,7 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
case NS_QUERY_TEXT_CONTENT: {
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
"aEvent={ message=NS_QUERY_TEXT_CONTENT, mInput={ mOffset=%u, "
"aEvent={ mMessage=NS_QUERY_TEXT_CONTENT, mInput={ mOffset=%u, "
"mLength=%u } }, aWidget=0x%p), mText.Length()=%u",
this, aEvent.mInput.mOffset,
aEvent.mInput.mLength, aWidget, mText.Length()));
@ -586,7 +586,7 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
case NS_QUERY_TEXT_RECT:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
"aEvent={ message=NS_QUERY_TEXT_RECT, mInput={ mOffset=%u, "
"aEvent={ mMessage=NS_QUERY_TEXT_RECT, mInput={ mOffset=%u, "
"mLength=%u } }, aWidget=0x%p), mText.Length()=%u",
this, aEvent.mInput.mOffset, aEvent.mInput.mLength, aWidget,
mText.Length()));
@ -641,7 +641,7 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
case NS_QUERY_CARET_RECT:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
"aEvent={ message=NS_QUERY_CARET_RECT, mInput={ mOffset=%u } }, "
"aEvent={ mMessage=NS_QUERY_CARET_RECT, mInput={ mOffset=%u } }, "
"aWidget=0x%p), mText.Length()=%u",
this, aEvent.mInput.mOffset, aWidget, mText.Length()));
if (NS_WARN_IF(!IsSelectionValid())) {
@ -668,7 +668,7 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent,
case NS_QUERY_EDITOR_RECT:
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("ContentCacheInParent: 0x%p HandleQueryContentEvent("
"aEvent={ message=NS_QUERY_EDITOR_RECT }, aWidget=0x%p)",
"aEvent={ mMessage=NS_QUERY_EDITOR_RECT }, aWidget=0x%p)",
this, aWidget));
aEvent.mReply.mRect = mEditorRect;
MOZ_LOG(sContentCacheLog, LogLevel::Info,
@ -846,17 +846,17 @@ ContentCacheInParent::OnCompositionEvent(const WidgetCompositionEvent& aEvent)
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("ContentCacheInParent: 0x%p OnCompositionEvent(aEvent={ "
"message=%s, mData=\"%s\" (Length()=%u), mRanges->Length()=%u }), "
"mMessage=%s, mData=\"%s\" (Length()=%u), mRanges->Length()=%u }), "
"mPendingEventsNeedingAck=%u, mIsComposing=%s, "
"mRequestedToCommitOrCancelComposition=%s",
this, GetEventMessageName(aEvent.message),
this, GetEventMessageName(aEvent.mMessage),
NS_ConvertUTF16toUTF8(aEvent.mData).get(), aEvent.mData.Length(),
aEvent.mRanges ? aEvent.mRanges->Length() : 0, mPendingEventsNeedingAck,
GetBoolName(mIsComposing),
GetBoolName(mRequestedToCommitOrCancelComposition)));
if (!aEvent.CausesDOMTextEvent()) {
MOZ_ASSERT(aEvent.message == NS_COMPOSITION_START);
MOZ_ASSERT(aEvent.mMessage == NS_COMPOSITION_START);
mIsComposing = !aEvent.CausesDOMCompositionEndEvent();
mCompositionStart = mSelection.StartOffset();
// XXX What's this case??
@ -900,10 +900,10 @@ ContentCacheInParent::OnSelectionEvent(
{
MOZ_LOG(sContentCacheLog, LogLevel::Info,
("ContentCacheInParent: 0x%p OnSelectionEvent(aEvent={ "
"message=%s, mOffset=%u, mLength=%u, mReversed=%s, "
"mMessage=%s, mOffset=%u, mLength=%u, mReversed=%s, "
"mExpandToClusterBoundary=%s, mUseNativeLineBreak=%s }), "
"mPendingEventsNeedingAck=%u, mIsComposing=%s",
this, GetEventMessageName(aSelectionEvent.message),
this, GetEventMessageName(aSelectionEvent.mMessage),
aSelectionEvent.mOffset, aSelectionEvent.mLength,
GetBoolName(aSelectionEvent.mReversed),
GetBoolName(aSelectionEvent.mExpandToClusterBoundary),

View File

@ -51,7 +51,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
InternalScrollPortEvent* result =
new InternalScrollPortEvent(false, message, nullptr);
new InternalScrollPortEvent(false, mMessage, nullptr);
result->AssignScrollPortEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -92,7 +92,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
InternalScrollAreaEvent* result =
new InternalScrollAreaEvent(false, message, nullptr);
new InternalScrollAreaEvent(false, mMessage, nullptr);
result->AssignScrollAreaEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -131,7 +131,7 @@ public:
{
MOZ_ASSERT(mClass == eFormEventClass,
"Duplicate() must be overridden by sub class");
InternalFormEvent* result = new InternalFormEvent(false, message);
InternalFormEvent* result = new InternalFormEvent(false, mMessage);
result->AssignFormEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -168,7 +168,8 @@ public:
{
MOZ_ASSERT(mClass == eClipboardEventClass,
"Duplicate() must be overridden by sub class");
InternalClipboardEvent* result = new InternalClipboardEvent(false, message);
InternalClipboardEvent* result =
new InternalClipboardEvent(false, mMessage);
result->AssignClipboardEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -205,7 +206,7 @@ public:
{
MOZ_ASSERT(mClass == eFocusEventClass,
"Duplicate() must be overridden by sub class");
InternalFocusEvent* result = new InternalFocusEvent(false, message);
InternalFocusEvent* result = new InternalFocusEvent(false, mMessage);
result->AssignFocusEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -251,7 +252,7 @@ public:
MOZ_ASSERT(mClass == eTransitionEventClass,
"Duplicate() must be overridden by sub class");
InternalTransitionEvent* result =
new InternalTransitionEvent(false, message);
new InternalTransitionEvent(false, mMessage);
result->AssignTransitionEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -295,7 +296,8 @@ public:
{
MOZ_ASSERT(mClass == eAnimationEventClass,
"Duplicate() must be overridden by sub class");
InternalAnimationEvent* result = new InternalAnimationEvent(false, message);
InternalAnimationEvent* result =
new InternalAnimationEvent(false, mMessage);
result->AssignAnimationEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -336,7 +338,7 @@ public:
MOZ_ASSERT(mClass == eSVGZoomEventClass,
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
InternalSVGZoomEvent* result = new InternalSVGZoomEvent(false, message);
InternalSVGZoomEvent* result = new InternalSVGZoomEvent(false, mMessage);
result->AssignSVGZoomEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -372,7 +374,7 @@ public:
{
MOZ_ASSERT(mClass == eSMILTimeEventClass,
"Duplicate() must be overridden by sub class");
InternalSMILTimeEvent* result = new InternalSMILTimeEvent(false, message);
InternalSMILTimeEvent* result = new InternalSMILTimeEvent(false, mMessage);
result->AssignSMILTimeEventData(*this, true);
result->mFlags = mFlags;
return result;

View File

@ -35,7 +35,7 @@ MultiTouchInput::MultiTouchInput(const WidgetTouchEvent& aTouchEvent)
MOZ_ASSERT(NS_IsMainThread(),
"Can only copy from WidgetTouchEvent on main thread");
switch (aTouchEvent.message) {
switch (aTouchEvent.mMessage) {
case NS_TOUCH_START:
mType = MULTITOUCH_START;
break;
@ -181,7 +181,7 @@ MultiTouchInput::MultiTouchInput(const WidgetMouseEvent& aMouseEvent)
{
MOZ_ASSERT(NS_IsMainThread(),
"Can only copy from WidgetMouseEvent on main thread");
switch (aMouseEvent.message) {
switch (aMouseEvent.mMessage) {
case NS_MOUSE_BUTTON_DOWN:
mType = MULTITOUCH_START;
break;

View File

@ -158,7 +158,7 @@ public:
MOZ_ASSERT(mClass == ePluginEventClass,
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetPluginEvent* result = new WidgetPluginEvent(false, message, nullptr);
WidgetPluginEvent* result = new WidgetPluginEvent(false, mMessage, nullptr);
result->AssignPluginEventData(*this, true);
result->mFlags = mFlags;
return result;

View File

@ -155,7 +155,7 @@ public:
*/
bool IsLeftClickEvent() const
{
return message == NS_MOUSE_CLICK && button == eLeftButton;
return mMessage == NS_MOUSE_CLICK && button == eLeftButton;
}
};
@ -240,7 +240,7 @@ public:
#ifdef DEBUG
virtual ~WidgetMouseEvent()
{
NS_WARN_IF_FALSE(message != NS_CONTEXTMENU ||
NS_WARN_IF_FALSE(mMessage != NS_CONTEXTMENU ||
button ==
((context == eNormal) ? eRightButton : eLeftButton),
"Wrong button set to NS_CONTEXTMENU event?");
@ -253,7 +253,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetMouseEvent* result =
new WidgetMouseEvent(false, message, nullptr, reason, context);
new WidgetMouseEvent(false, mMessage, nullptr, reason, context);
result->AssignMouseEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -287,7 +287,7 @@ public:
*/
bool IsContextMenuKeyEvent() const
{
return message == NS_CONTEXTMENU && context == eContextMenuKey;
return mMessage == NS_CONTEXTMENU && context == eContextMenuKey;
}
/**
@ -332,7 +332,7 @@ public:
MOZ_ASSERT(mClass == eDragEventClass,
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetDragEvent* result = new WidgetDragEvent(false, message, nullptr);
WidgetDragEvent* result = new WidgetDragEvent(false, mMessage, nullptr);
result->AssignDragEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -394,7 +394,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetMouseScrollEvent* result =
new WidgetMouseScrollEvent(false, message, nullptr);
new WidgetMouseScrollEvent(false, mMessage, nullptr);
result->AssignMouseScrollEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -462,7 +462,7 @@ public:
MOZ_ASSERT(mClass == eWheelEventClass,
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetWheelEvent* result = new WidgetWheelEvent(false, message, nullptr);
WidgetWheelEvent* result = new WidgetWheelEvent(false, mMessage, nullptr);
result->AssignWheelEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -608,7 +608,7 @@ public:
void UpdateFlags()
{
switch (message) {
switch (mMessage) {
case NS_POINTER_ENTER:
case NS_POINTER_LEAVE:
mFlags.mBubbles = false;
@ -630,7 +630,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetPointerEvent* result =
new WidgetPointerEvent(false, message, nullptr);
new WidgetPointerEvent(false, mMessage, nullptr);
result->AssignPointerEventData(*this, true);
result->mFlags = mFlags;
return result;

View File

@ -113,7 +113,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetKeyboardEvent* result =
new WidgetKeyboardEvent(false, message, nullptr);
new WidgetKeyboardEvent(false, mMessage, nullptr);
result->AssignKeyEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -281,10 +281,10 @@ private:
* This is extended from WidgetKeyboardEvent and is mapped to DOM event
* "BeforeAfterKeyboardEvent".
*
* Event message: NS_KEY_BEFORE_DOWN
* NS_KEY_BEFORE_UP
* NS_KEY_AFTER_DOWN
* NS_KEY_AFTER_UP
* Event mMessage: NS_KEY_BEFORE_DOWN
* NS_KEY_BEFORE_UP
* NS_KEY_AFTER_DOWN
* NS_KEY_AFTER_UP
******************************************************************************/
class InternalBeforeAfterKeyboardEvent : public WidgetKeyboardEvent
{
@ -318,7 +318,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
InternalBeforeAfterKeyboardEvent* result =
new InternalBeforeAfterKeyboardEvent(false, message, nullptr);
new InternalBeforeAfterKeyboardEvent(false, mMessage, nullptr);
result->AssignBeforeAfterKeyEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -376,7 +376,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetCompositionEvent* result =
new WidgetCompositionEvent(false, message, nullptr);
new WidgetCompositionEvent(false, mMessage, nullptr);
result->AssignCompositionEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -426,16 +426,16 @@ public:
bool CausesDOMTextEvent() const
{
return message == NS_COMPOSITION_CHANGE ||
message == NS_COMPOSITION_COMMIT ||
message == NS_COMPOSITION_COMMIT_AS_IS;
return mMessage == NS_COMPOSITION_CHANGE ||
mMessage == NS_COMPOSITION_COMMIT ||
mMessage == NS_COMPOSITION_COMMIT_AS_IS;
}
bool CausesDOMCompositionEndEvent() const
{
return message == NS_COMPOSITION_END ||
message == NS_COMPOSITION_COMMIT ||
message == NS_COMPOSITION_COMMIT_AS_IS;
return mMessage == NS_COMPOSITION_END ||
mMessage == NS_COMPOSITION_COMMIT ||
mMessage == NS_COMPOSITION_COMMIT_AS_IS;
}
};
@ -481,7 +481,7 @@ public:
void InitForQueryTextContent(uint32_t aOffset, uint32_t aLength,
bool aUseNativeLineBreak = true)
{
NS_ASSERTION(message == NS_QUERY_TEXT_CONTENT,
NS_ASSERTION(mMessage == NS_QUERY_TEXT_CONTENT,
"wrong initializer is called");
mInput.mOffset = aOffset;
mInput.mLength = aLength;
@ -491,7 +491,7 @@ public:
void InitForQueryCaretRect(uint32_t aOffset,
bool aUseNativeLineBreak = true)
{
NS_ASSERTION(message == NS_QUERY_CARET_RECT,
NS_ASSERTION(mMessage == NS_QUERY_CARET_RECT,
"wrong initializer is called");
mInput.mOffset = aOffset;
mUseNativeLineBreak = aUseNativeLineBreak;
@ -500,7 +500,7 @@ public:
void InitForQueryTextRect(uint32_t aOffset, uint32_t aLength,
bool aUseNativeLineBreak = true)
{
NS_ASSERTION(message == NS_QUERY_TEXT_RECT,
NS_ASSERTION(mMessage == NS_QUERY_TEXT_RECT,
"wrong initializer is called");
mInput.mOffset = aOffset;
mInput.mLength = aLength;
@ -509,37 +509,37 @@ public:
void InitForQueryDOMWidgetHittest(const mozilla::LayoutDeviceIntPoint& aPoint)
{
NS_ASSERTION(message == NS_QUERY_DOM_WIDGET_HITTEST,
NS_ASSERTION(mMessage == NS_QUERY_DOM_WIDGET_HITTEST,
"wrong initializer is called");
refPoint = aPoint;
}
void RequestFontRanges()
{
NS_ASSERTION(message == NS_QUERY_TEXT_CONTENT,
NS_ASSERTION(mMessage == NS_QUERY_TEXT_CONTENT,
"not querying text content");
mWithFontRanges = true;
}
uint32_t GetSelectionStart(void) const
{
NS_ASSERTION(message == NS_QUERY_SELECTED_TEXT,
NS_ASSERTION(mMessage == NS_QUERY_SELECTED_TEXT,
"not querying selection");
return mReply.mOffset + (mReply.mReversed ? mReply.mString.Length() : 0);
}
uint32_t GetSelectionEnd(void) const
{
NS_ASSERTION(message == NS_QUERY_SELECTED_TEXT,
NS_ASSERTION(mMessage == NS_QUERY_SELECTED_TEXT,
"not querying selection");
return mReply.mOffset + (mReply.mReversed ? 0 : mReply.mString.Length());
}
mozilla::WritingMode GetWritingMode(void) const
{
NS_ASSERTION(message == NS_QUERY_SELECTED_TEXT ||
message == NS_QUERY_CARET_RECT ||
message == NS_QUERY_TEXT_RECT,
NS_ASSERTION(mMessage == NS_QUERY_SELECTED_TEXT ||
mMessage == NS_QUERY_CARET_RECT ||
mMessage == NS_QUERY_TEXT_RECT,
"not querying selection or text rect");
return mReply.mWritingMode;
}
@ -709,7 +709,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
InternalEditorInputEvent* result =
new InternalEditorInputEvent(false, message, nullptr);
new InternalEditorInputEvent(false, mMessage, nullptr);
result->AssignEditorInputEventData(*this, true);
result->mFlags = mFlags;
return result;

View File

@ -55,7 +55,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetGestureNotifyEvent* result =
new WidgetGestureNotifyEvent(false, message, nullptr);
new WidgetGestureNotifyEvent(false, mMessage, nullptr);
result->AssignGestureNotifyEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -106,7 +106,7 @@ public:
}
WidgetSimpleGestureEvent(const WidgetSimpleGestureEvent& aOther)
: WidgetMouseEventBase(aOther.mFlags.mIsTrusted, aOther.message,
: WidgetMouseEventBase(aOther.mFlags.mIsTrusted, aOther.mMessage,
aOther.widget, eSimpleGestureEventClass)
, allowedDirections(aOther.allowedDirections)
, direction(aOther.direction)
@ -121,7 +121,7 @@ public:
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetSimpleGestureEvent* result =
new WidgetSimpleGestureEvent(false, message, nullptr);
new WidgetSimpleGestureEvent(false, mMessage, nullptr);
result->AssignSimpleGestureEventData(*this, true);
result->mFlags = mFlags;
return result;
@ -166,14 +166,14 @@ public:
}
WidgetTouchEvent(const WidgetTouchEvent& aOther)
: WidgetInputEvent(aOther.mFlags.mIsTrusted, aOther.message, aOther.widget,
: WidgetInputEvent(aOther.mFlags.mIsTrusted, aOther.mMessage, aOther.widget,
eTouchEventClass)
{
modifiers = aOther.modifiers;
time = aOther.time;
timeStamp = aOther.timeStamp;
touches.AppendElements(aOther.touches);
mFlags.mCancelable = message != NS_TOUCH_CANCEL;
mFlags.mCancelable = mMessage != NS_TOUCH_CANCEL;
MOZ_COUNT_CTOR(WidgetTouchEvent);
}
@ -181,7 +181,7 @@ public:
: WidgetInputEvent(aIsTrusted, aMessage, aWidget, eTouchEventClass)
{
MOZ_COUNT_CTOR(WidgetTouchEvent);
mFlags.mCancelable = message != NS_TOUCH_CANCEL;
mFlags.mCancelable = mMessage != NS_TOUCH_CANCEL;
}
virtual ~WidgetTouchEvent()
@ -194,7 +194,7 @@ public:
MOZ_ASSERT(mClass == eTouchEventClass,
"Duplicate() must be overridden by sub class");
// Not copying widget, it is a weak reference.
WidgetTouchEvent* result = new WidgetTouchEvent(false, message, nullptr);
WidgetTouchEvent* result = new WidgetTouchEvent(false, mMessage, nullptr);
result->AssignTouchEventData(*this, true);
result->mFlags = mFlags;
return result;

View File

@ -77,7 +77,7 @@ WidgetEvent::IsNativeEventDelivererForPlugin() const
bool
WidgetEvent::HasMouseEventMessage() const
{
switch (message) {
switch (mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case NS_MOUSE_CLICK:
@ -98,7 +98,7 @@ WidgetEvent::HasMouseEventMessage() const
bool
WidgetEvent::HasDragEventMessage() const
{
switch (message) {
switch (mMessage) {
case NS_DRAGDROP_ENTER:
case NS_DRAGDROP_OVER:
case NS_DRAGDROP_EXIT:
@ -118,7 +118,7 @@ WidgetEvent::HasDragEventMessage() const
bool
WidgetEvent::HasKeyEventMessage() const
{
switch (message) {
switch (mMessage) {
case NS_KEY_DOWN:
case NS_KEY_PRESS:
case NS_KEY_UP:
@ -135,7 +135,7 @@ WidgetEvent::HasKeyEventMessage() const
bool
WidgetEvent::HasIMEEventMessage() const
{
switch (message) {
switch (mMessage) {
case NS_COMPOSITION_START:
case NS_COMPOSITION_END:
case NS_COMPOSITION_UPDATE:
@ -151,8 +151,8 @@ WidgetEvent::HasIMEEventMessage() const
bool
WidgetEvent::HasPluginActivationEventMessage() const
{
return message == NS_PLUGIN_ACTIVATE ||
message == NS_PLUGIN_FOCUS;
return mMessage == NS_PLUGIN_ACTIVATE ||
mMessage == NS_PLUGIN_FOCUS;
}
/******************************************************************************

View File

@ -966,7 +966,7 @@ nsWindow::OnMouseEvent(AndroidGeckoEvent *ae)
nsRefPtr<nsWindow> kungFuDeathGrip(this);
WidgetMouseEvent event = ae->MakeMouseEvent(this);
if (event.message == NS_EVENT_NULL) {
if (event.mMessage == NS_EVENT_NULL) {
// invalid event type, abort
return;
}
@ -1001,7 +1001,7 @@ nsWindow::OnContextmenuEvent(AndroidGeckoEvent *ae)
// triggering further element behaviour such as link-clicks.
if (contextMenuStatus == nsEventStatus_eConsumeNoDefault) {
WidgetTouchEvent canceltouchEvent = ae->MakeTouchEvent(this);
canceltouchEvent.message = NS_TOUCH_CANCEL;
canceltouchEvent.mMessage = NS_TOUCH_CANCEL;
DispatchEvent(&canceltouchEvent);
return true;
}
@ -1052,7 +1052,7 @@ bool nsWindow::OnMultitouchEvent(AndroidGeckoEvent *ae)
bool isDownEvent = false;
WidgetTouchEvent event = ae->MakeTouchEvent(this);
if (event.message != NS_EVENT_NULL) {
if (event.mMessage != NS_EVENT_NULL) {
nsEventStatus status;
DispatchEvent(&event, status);
// We check mMultipleActionsPrevented because that's what <input type=range>
@ -1061,7 +1061,7 @@ bool nsWindow::OnMultitouchEvent(AndroidGeckoEvent *ae)
// from running.
preventDefaultActions = (status == nsEventStatus_eConsumeNoDefault ||
event.mFlags.mMultipleActionsPrevented);
isDownEvent = (event.message == NS_TOUCH_START);
isDownEvent = (event.mMessage == NS_TOUCH_START);
}
if (isDownEvent && event.touches.Length() == 1) {
@ -1461,7 +1461,7 @@ nsWindow::InitKeyEvent(WidgetKeyboardEvent& event, AndroidGeckoEvent& key,
event.mCodeNameIndex = ConvertAndroidScanCodeToCodeNameIndex(key);
uint32_t domKeyCode = ConvertAndroidKeyCodeToDOMKeyCode(key.KeyCode());
if (event.message == NS_KEY_PRESS) {
if (event.mMessage == NS_KEY_PRESS) {
// Android gives us \n, so filter out some control characters.
int charCode = key.UnicodeChar();
if (!charCode) {
@ -1473,13 +1473,13 @@ nsWindow::InitKeyEvent(WidgetKeyboardEvent& event, AndroidGeckoEvent& key,
event.mPluginEvent.Clear();
} else {
#ifdef DEBUG
if (event.message != NS_KEY_DOWN && event.message != NS_KEY_UP) {
ALOG("InitKeyEvent: unexpected event.message %d", event.message);
if (event.mMessage != NS_KEY_DOWN && event.mMessage != NS_KEY_UP) {
ALOG("InitKeyEvent: unexpected event.mMessage %d", event.mMessage);
}
#endif // DEBUG
// Flash will want a pluginEvent for keydown and keyup events.
ANPKeyActions action = event.message == NS_KEY_DOWN
ANPKeyActions action = event.mMessage == NS_KEY_DOWN
? kDown_ANPKeyAction
: kUp_ANPKeyAction;
InitPluginEvent(pluginEvent, action, key);
@ -1500,13 +1500,13 @@ nsWindow::InitKeyEvent(WidgetKeyboardEvent& event, AndroidGeckoEvent& key,
// Note that on Android 4.x, Alt modifier isn't set when the key input
// causes text input even while right Alt key is pressed. However, this
// is necessary for Android 2.3 compatibility.
if (event.message == NS_KEY_PRESS &&
if (event.mMessage == NS_KEY_PRESS &&
key.UnicodeChar() && key.UnicodeChar() != key.BaseUnicodeChar()) {
event.modifiers &= ~(MODIFIER_ALT | MODIFIER_CONTROL | MODIFIER_META);
}
event.mIsRepeat =
(event.message == NS_KEY_DOWN || event.message == NS_KEY_PRESS) &&
(event.mMessage == NS_KEY_DOWN || event.mMessage == NS_KEY_PRESS) &&
(!!(key.Flags() & AKEY_EVENT_FLAG_LONG_PRESS) || !!key.RepeatCount());
event.location =
WidgetKeyboardEvent::ComputeLocationFromCodeValue(event.mCodeNameIndex);

View File

@ -225,7 +225,7 @@ GetNativeKeyEventType(NSEvent* aNativeEvent)
static const char*
GetGeckoKeyEventType(const WidgetEvent& aEvent)
{
switch (aEvent.message) {
switch (aEvent.mMessage) {
case NS_KEY_DOWN: return "NS_KEY_DOWN";
case NS_KEY_UP: return "NS_KEY_UP";
case NS_KEY_PRESS: return "NS_KEY_PRESS";
@ -761,7 +761,7 @@ TISInputSourceWrapper::InitKeyEvent(NSEvent *aNativeKeyEvent,
MOZ_LOG(gLog, LogLevel::Info,
("%p TISInputSourceWrapper::InitKeyEvent, aNativeKeyEvent=%p, "
"aKeyEvent.message=%s, aInsertString=%p, IsOpenedIMEMode()=%s",
"aKeyEvent.mMessage=%s, aInsertString=%p, IsOpenedIMEMode()=%s",
this, aNativeKeyEvent, GetGeckoKeyEventType(aKeyEvent), aInsertString,
TrueOrFalse(IsOpenedIMEMode())));
@ -948,7 +948,7 @@ TISInputSourceWrapper::InitKeyEvent(NSEvent *aNativeKeyEvent,
this, OnOrOff(aKeyEvent.IsShift()), OnOrOff(aKeyEvent.IsControl()),
OnOrOff(aKeyEvent.IsAlt()), OnOrOff(aKeyEvent.IsMeta())));
if (aKeyEvent.message == NS_KEY_PRESS &&
if (aKeyEvent.mMessage == NS_KEY_PRESS &&
(isPrintableKey || !insertString.IsEmpty())) {
InitKeyPressEvent(aNativeKeyEvent,
insertString.IsEmpty() ? 0 : insertString[0],
@ -1038,7 +1038,7 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent,
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
NS_ASSERTION(aKeyEvent.message == NS_KEY_PRESS,
NS_ASSERTION(aKeyEvent.mMessage == NS_KEY_PRESS,
"aKeyEvent must be NS_KEY_PRESS event");
if (MOZ_LOG_TEST(gLog, LogLevel::Info)) {
@ -1050,7 +1050,7 @@ TISInputSourceWrapper::InitKeyPressEvent(NSEvent *aNativeKeyEvent,
MOZ_LOG(gLog, LogLevel::Info,
("%p TISInputSourceWrapper::InitKeyPressEvent, aNativeKeyEvent=%p, "
"[aNativeKeyEvent characters]=\"%s\", aInsertChar=0x%X(%s), "
"aKeyEvent.message=%s, aKbType=0x%X, IsOpenedIMEMode()=%s",
"aKeyEvent.mMessage=%s, aKbType=0x%X, IsOpenedIMEMode()=%s",
this, aNativeKeyEvent, utf8Chars.get(), aInsertChar,
utf8ExpectedChar.get(), GetGeckoKeyEventType(aKeyEvent), aKbType,
TrueOrFalse(IsOpenedIMEMode())));
@ -3777,7 +3777,7 @@ TextInputHandlerBase::OnDestroyWidget(nsChildView* aDestroyingWidget)
bool
TextInputHandlerBase::DispatchEvent(WidgetGUIEvent& aEvent)
{
if (aEvent.message == NS_KEY_PRESS) {
if (aEvent.mMessage == NS_KEY_PRESS) {
WidgetInputEvent& inputEvent = *aEvent.AsInputEvent();
if (!inputEvent.IsMeta()) {
MOZ_LOG(gLog, LogLevel::Info,
@ -3919,7 +3919,7 @@ TextInputHandlerBase::AttachNativeKeyEvent(WidgetKeyboardEvent& aKeyEvent)
aKeyEvent.modifiers));
NSEventType eventType;
if (aKeyEvent.message == NS_KEY_UP) {
if (aKeyEvent.mMessage == NS_KEY_UP) {
eventType = NSKeyUp;
} else {
eventType = NSKeyDown;

View File

@ -2201,7 +2201,7 @@ IMContextWrapper::Selection::Assign(const IMENotification& aIMENotification)
void
IMContextWrapper::Selection::Assign(const WidgetQueryContentEvent& aEvent)
{
MOZ_ASSERT(aEvent.message == NS_QUERY_SELECTED_TEXT);
MOZ_ASSERT(aEvent.mMessage == NS_QUERY_SELECTED_TEXT);
MOZ_ASSERT(aEvent.mSucceeded);
mOffset = aEvent.mReply.mOffset;
mLength = aEvent.mReply.mString.Length();

View File

@ -983,13 +983,13 @@ KeymapWrapper::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent,
aGdkKeyEvent->keyval, aGdkKeyEvent->state,
aGdkKeyEvent->hardware_keycode,
GetBoolName(aGdkKeyEvent->is_modifier),
((aKeyEvent.message == NS_KEY_DOWN) ? "NS_KEY_DOWN" :
(aKeyEvent.message == NS_KEY_PRESS) ? "NS_KEY_PRESS" :
((aKeyEvent.mMessage == NS_KEY_DOWN) ? "NS_KEY_DOWN" :
(aKeyEvent.mMessage == NS_KEY_PRESS) ? "NS_KEY_PRESS" :
"NS_KEY_UP"),
GetBoolName(aKeyEvent.IsShift()), GetBoolName(aKeyEvent.IsControl()),
GetBoolName(aKeyEvent.IsAlt()), GetBoolName(aKeyEvent.IsMeta())));
if (aKeyEvent.message == NS_KEY_PRESS) {
if (aKeyEvent.mMessage == NS_KEY_PRESS) {
keymapWrapper->InitKeypressEvent(aKeyEvent, aGdkKeyEvent);
}
@ -1323,7 +1323,7 @@ void
KeymapWrapper::InitKeypressEvent(WidgetKeyboardEvent& aKeyEvent,
GdkEventKey* aGdkKeyEvent)
{
NS_ENSURE_TRUE_VOID(aKeyEvent.message == NS_KEY_PRESS);
NS_ENSURE_TRUE_VOID(aKeyEvent.mMessage == NS_KEY_PRESS);
aKeyEvent.charCode = GetCharCodeFor(aGdkKeyEvent);
if (!aKeyEvent.charCode) {

View File

@ -992,7 +992,7 @@ nsBaseWidget::ProcessUntransformedAPZEvent(WidgetInputEvent* aEvent,
// TODO: Eventually we'll be able to move the SendSetTargetAPZCNotification
// call into APZEventState::Process*Event() as well.
if (WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent()) {
if (touchEvent->message == NS_TOUCH_START) {
if (touchEvent->mMessage == NS_TOUCH_START) {
if (gfxPrefs::TouchActionEnabled()) {
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(this, *touchEvent,
aInputBlockId, mSetAllowedTouchBehaviorCallback);
@ -2628,7 +2628,7 @@ nsBaseWidget::debug_GuiEventToString(WidgetGUIEvent* aGuiEvent)
#define _ASSIGN_eventName(_value,_name)\
case _value: eventName.AssignLiteral(_name) ; break
switch(aGuiEvent->message)
switch(aGuiEvent->mMessage)
{
_ASSIGN_eventName(NS_BLUR_CONTENT,"NS_BLUR_CONTENT");
_ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE");
@ -2670,7 +2670,7 @@ case _value: eventName.AssignLiteral(_name) ; break
{
char buf[32];
snprintf_literal(buf,"UNKNOWN: %d",aGuiEvent->message);
snprintf_literal(buf,"UNKNOWN: %d",aGuiEvent->mMessage);
CopyASCIItoUTF16(buf, eventName);
}
@ -2802,15 +2802,13 @@ nsBaseWidget::debug_DumpEvent(FILE * aFileOut,
const nsAutoCString & aWidgetName,
int32_t aWindowID)
{
if (aGuiEvent->message == NS_MOUSE_MOVE)
{
if (aGuiEvent->mMessage == NS_MOUSE_MOVE) {
if (!debug_GetCachedBoolPref("nglayout.debug.motion_event_dumping"))
return;
}
if (aGuiEvent->message == NS_MOUSE_ENTER_WIDGET ||
aGuiEvent->message == NS_MOUSE_EXIT_WIDGET)
{
if (aGuiEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
aGuiEvent->mMessage == NS_MOUSE_EXIT_WIDGET) {
if (!debug_GetCachedBoolPref("nglayout.debug.crossing_event_dumping"))
return;
}

View File

@ -48,7 +48,7 @@ struct ParamTraits<mozilla::WidgetEvent>
{
WriteParam(aMsg,
static_cast<mozilla::EventClassIDType>(aParam.mClass));
WriteParam(aMsg, aParam.message);
WriteParam(aMsg, aParam.mMessage);
WriteParam(aMsg, aParam.refPoint);
WriteParam(aMsg, aParam.time);
WriteParam(aMsg, aParam.timeStamp);
@ -59,7 +59,7 @@ struct ParamTraits<mozilla::WidgetEvent>
{
mozilla::EventClassIDType eventClassID = 0;
bool ret = ReadParam(aMsg, aIter, &eventClassID) &&
ReadParam(aMsg, aIter, &aResult->message) &&
ReadParam(aMsg, aIter, &aResult->mMessage) &&
ReadParam(aMsg, aIter, &aResult->refPoint) &&
ReadParam(aMsg, aIter, &aResult->time) &&
ReadParam(aMsg, aIter, &aResult->timeStamp) &&

View File

@ -1100,7 +1100,7 @@ InitKeyEvent(WidgetKeyboardEvent& aEvent, QKeyEvent* aQEvent)
aQEvent->modifiers() & Qt::MetaModifier);
aEvent.mIsRepeat =
(aEvent.message == NS_KEY_DOWN || aEvent.message == NS_KEY_PRESS) &&
(aEvent.mMessage == NS_KEY_DOWN || aEvent.mMessage == NS_KEY_PRESS) &&
aQEvent->isAutoRepeat();
aEvent.time = 0;

View File

@ -1143,7 +1143,7 @@ NativeKey::InitKeyEvent(WidgetKeyboardEvent& aKeyEvent,
nsIntPoint point(0, 0);
mWidget->InitEvent(aKeyEvent, &point);
switch (aKeyEvent.message) {
switch (aKeyEvent.mMessage) {
case NS_KEY_DOWN:
aKeyEvent.keyCode = mDOMKeyCode;
// Unique id for this keydown event and its associated keypress.

View File

@ -821,7 +821,7 @@ MouseScrollHandler::LastEventInfo::InitWheelEvent(
WidgetWheelEvent& aWheelEvent,
const ModifierKeyState& aModKeyState)
{
MOZ_ASSERT(aWheelEvent.message == NS_WHEEL_WHEEL);
MOZ_ASSERT(aWheelEvent.mMessage == NS_WHEEL_WHEEL);
// XXX Why don't we use lParam value? We should use lParam value because
// our internal message is always posted by original message handler.

View File

@ -334,13 +334,13 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
// The low 32 bits are the distance in pixels.
mZoomIntermediate = (float)gi.ullArguments;
evt.message = NS_SIMPLE_GESTURE_MAGNIFY_START;
evt.mMessage = NS_SIMPLE_GESTURE_MAGNIFY_START;
evt.delta = 0.0;
}
else if (gi.dwFlags & GF_END) {
// Send a zoom end event, the delta is the change
// in touch points.
evt.message = NS_SIMPLE_GESTURE_MAGNIFY;
evt.mMessage = NS_SIMPLE_GESTURE_MAGNIFY;
// (positive for a "zoom in")
evt.delta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
mZoomIntermediate = (float)gi.ullArguments;
@ -348,7 +348,7 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
else {
// Send a zoom intermediate event, the delta is the change
// in touch points.
evt.message = NS_SIMPLE_GESTURE_MAGNIFY_UPDATE;
evt.mMessage = NS_SIMPLE_GESTURE_MAGNIFY_UPDATE;
// (positive for a "zoom in")
evt.delta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
mZoomIntermediate = (float)gi.ullArguments;
@ -385,11 +385,11 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
evt.direction = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
if (gi.dwFlags & GF_BEGIN)
evt.message = NS_SIMPLE_GESTURE_ROTATE_START;
evt.mMessage = NS_SIMPLE_GESTURE_ROTATE_START;
else if (gi.dwFlags & GF_END)
evt.message = NS_SIMPLE_GESTURE_ROTATE;
evt.mMessage = NS_SIMPLE_GESTURE_ROTATE;
else
evt.message = NS_SIMPLE_GESTURE_ROTATE_UPDATE;
evt.mMessage = NS_SIMPLE_GESTURE_ROTATE_UPDATE;
}
break;
@ -397,7 +397,7 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
{
// Normally maps to "restore" from whatever you may have recently changed. A simple
// double click.
evt.message = NS_SIMPLE_GESTURE_TAP;
evt.mMessage = NS_SIMPLE_GESTURE_TAP;
evt.clickCount = 1;
}
break;
@ -405,7 +405,7 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
case GID_PRESSANDTAP:
{
// Two finger right click. Defaults to right click if it falls through.
evt.message = NS_SIMPLE_GESTURE_PRESSTAP;
evt.mMessage = NS_SIMPLE_GESTURE_PRESSTAP;
evt.clickCount = 1;
}
break;

View File

@ -4080,7 +4080,7 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam,
LONG curMsgTime = ::GetMessageTime();
if (aEventType == NS_MOUSE_DOUBLECLICK) {
event.message = NS_MOUSE_BUTTON_DOWN;
event.mMessage = NS_MOUSE_BUTTON_DOWN;
event.button = aButton;
sLastClickCount = 2;
sLastMouseDownTime = curMsgTime;