Bug 895274 part.27 Rename NS_MOUSE_BUTTON_DOWN to eMouseDown r=smaug

This commit is contained in:
Masayuki Nakano 2015-08-29 08:58:30 +09:00
parent cd786809b4
commit 4d5cd63d14
45 changed files with 91 additions and 96 deletions

View File

@ -110,7 +110,7 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
presContext->AppUnitsToDevPixels(offset.y);
// XUL is just desktop, so there is no real reason for senfing touch events.
DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, cnvdX, cnvdY,
DispatchMouseEvent(eMouseDown, cnvdX, cnvdY,
tcContent, tcFrame, presShell, rootWidget);
DispatchMouseEvent(eMouseUp, cnvdX, cnvdY,

View File

@ -1835,7 +1835,8 @@ Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex)
// Simulate a touch interaction by dispatching touch events with mouse events.
nsCoreUtils::DispatchTouchEvent(NS_TOUCH_START, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(eMouseDown, x, y, aContent, frame,
presShell, widget);
nsCoreUtils::DispatchTouchEvent(NS_TOUCH_END, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(eMouseUp, x, y, aContent, frame,
presShell, widget);

View File

@ -2929,7 +2929,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->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case NS_MOUSE_CLICK:
case NS_UI_ACTIVATE:
case eKeyPress:
@ -2947,7 +2947,7 @@ Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor)
nsresult rv = NS_OK;
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
{
if (aVisitor.mEvent->AsMouseEvent()->button ==
WidgetMouseEvent::eLeftButton) {

View File

@ -7838,7 +7838,7 @@ nsContentUtils::SendMouseEvent(nsCOMPtr<nsIPresShell> aPresShell,
EventMessage msg;
bool contextMenuKey = false;
if (aType.EqualsLiteral("mousedown"))
msg = NS_MOUSE_BUTTON_DOWN;
msg = eMouseDown;
else if (aType.EqualsLiteral("mouseup"))
msg = eMouseUp;
else if (aType.EqualsLiteral("mousemove"))

View File

@ -3084,8 +3084,7 @@ nsGlobalWindow::PreHandleEvent(EventChainPreVisitor& aVisitor)
if (window) {
mIsHandlingResizeEvent = true;
}
} else if (msg == NS_MOUSE_BUTTON_DOWN &&
aVisitor.mEvent->mFlags.mIsTrusted) {
} else if (msg == eMouseDown && aVisitor.mEvent->mFlags.mIsTrusted) {
gMouseDown = true;
} else if ((msg == eMouseUp || msg == NS_DRAGDROP_END) &&
aVisitor.mEvent->mFlags.mIsTrusted) {

View File

@ -823,7 +823,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
abuse = openControlled;
}
break;
case NS_MOUSE_BUTTON_DOWN :
case eMouseDown:
if (PopupAllowedForEvent("mousedown")) {
abuse = openControlled;
}

View File

@ -267,7 +267,7 @@ EVENT(loadstart,
EventNameType_HTML,
eBasicEventClass)
EVENT(mousedown,
NS_MOUSE_BUTTON_DOWN,
eMouseDown,
EventNameType_All,
eMouseEventClass)
EVENT(mouseenter,

View File

@ -548,7 +548,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
break;
case NS_MOUSE_BUTTON_DOWN: {
case eMouseDown: {
switch (mouseEvent->button) {
case WidgetMouseEvent::eLeftButton:
BeginTrackingDragGesture(aPresContext, mouseEvent, aTargetFrame);
@ -1170,7 +1170,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
return true;
case eMouseEventClass:
switch (aEvent.mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case eMouseUp:
case eMouseMove:
case NS_CONTEXTMENU:
@ -2796,7 +2796,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// Most of the events we handle below require a frame.
// Add special cases here.
if (!mCurrentTarget && aEvent->mMessage != eMouseUp &&
aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
aEvent->mMessage != eMouseDown) {
return NS_OK;
}
@ -2805,7 +2805,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
nsresult ret = NS_OK;
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
{
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
if (mouseEvent->button == WidgetMouseEvent::eLeftButton &&
@ -4438,7 +4438,7 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
switch (aEvent->button) {
case WidgetMouseEvent::eLeftButton:
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == eMouseDown) {
mLastLeftMouseDownContent = mouseContent;
mLastLeftMouseDownContentParent = mouseContentParent;
} else if (aEvent->mMessage == eMouseUp) {
@ -4456,7 +4456,7 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
break;
case WidgetMouseEvent::eMiddleButton:
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == eMouseDown) {
mLastMiddleMouseDownContent = mouseContent;
mLastMiddleMouseDownContentParent = mouseContentParent;
} else if (aEvent->mMessage == eMouseUp) {
@ -4474,7 +4474,7 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
break;
case WidgetMouseEvent::eRightButton:
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == eMouseDown) {
mLastRightMouseDownContent = mouseContent;
mLastRightMouseDownContentParent = mouseContentParent;
} else if (aEvent->mMessage == eMouseUp) {
@ -4960,7 +4960,7 @@ EventStateManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
bool
EventStateManager::EventStatusOK(WidgetGUIEvent* aEvent)
{
return !(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
return !(aEvent->mMessage == eMouseDown &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
!sNormalLMouseEventInProcess);
}
@ -5749,7 +5749,7 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
WidgetEvent* aEvent,
nsIDocument* aDocument) :
mIsHandlingUserInput(aIsHandlingUserInput),
mIsMouseDown(aEvent && aEvent->mMessage == NS_MOUSE_BUTTON_DOWN),
mIsMouseDown(aEvent && aEvent->mMessage == eMouseDown),
mResetFMMouseButtonHandlingState(false)
{
if (!aIsHandlingUserInput) {
@ -5764,8 +5764,7 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
return;
}
mResetFMMouseButtonHandlingState =
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == eMouseUp);
(aEvent->mMessage == eMouseDown || aEvent->mMessage == eMouseUp);
if (mResetFMMouseButtonHandlingState) {
nsFocusManager* fm = nsFocusManager::GetFocusManager();
NS_ENSURE_TRUE_VOID(fm);

View File

@ -458,7 +458,7 @@ IMEContentObserver::OnMouseButtonEvent(nsPresContext* aPresContext,
// Now, we need to notify only mouse down and mouse up event.
switch (aMouseEvent->mMessage) {
case eMouseUp:
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
break;
default:
return false;

View File

@ -211,7 +211,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent)
case eKeyUp:
case eKeyDown:
case eMouseUp:
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case NS_MOUSE_DOUBLECLICK:
case NS_MOUSE_CLICK:
case NS_CONTEXTMENU:

View File

@ -306,7 +306,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
break;
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
{
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {

View File

@ -3938,7 +3938,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
} break; // eKeyPress || eKeyUp
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case eMouseUp:
case NS_MOUSE_DOUBLECLICK:
{
@ -3967,7 +3967,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
nsNumberControlFrame* numberControlFrame =
do_QueryFrame(GetPrimaryFrame());
if (numberControlFrame) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
if (aVisitor.mEvent->mMessage == eMouseDown &&
IsMutable()) {
switch (numberControlFrame->GetSpinButtonForPointerEvent(
aVisitor.mEvent->AsMouseEvent())) {
@ -4086,7 +4086,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
switch (aVisitor.mEvent->mMessage)
{
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case NS_TOUCH_START: {
if (mIsDraggingRange) {
break;
@ -4101,7 +4101,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
inputEvent->IsOS()) {
break; // ignore
}
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aVisitor.mEvent->mMessage == eMouseDown) {
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->mMessage != NS_MOUSE_BUTTON_DOWN) ||
aVisitor.mEvent->mMessage != eMouseDown) ||
aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
!aVisitor.mPresContext ||
// Don't handle the event if it's already been handled by another label
@ -123,7 +123,7 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
if (content) {
mHandlingEvent = true;
switch (aVisitor.mEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {
// We reset the mouse-down point on every event because there is
// no guarantee we will reach the NS_MOUSE_CLICK code below.

View File

@ -2057,7 +2057,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus)
APZCCallbackHelper::DispatchSynthesizedMouseEvent(
eMouseMove, time, currentPoint, 0, mPuppetWidget);
APZCCallbackHelper::DispatchSynthesizedMouseEvent(
NS_MOUSE_BUTTON_DOWN, time, currentPoint, 0, mPuppetWidget);
eMouseDown, time, currentPoint, 0, mPuppetWidget);
APZCCallbackHelper::DispatchSynthesizedMouseEvent(
eMouseUp, time, currentPoint, 0, mPuppetWidget);
}

View File

@ -1822,7 +1822,7 @@ CocoaEventTypeForEvent(const WidgetGUIEvent& anEvent, nsIFrame* aObjectFrame)
return NPCocoaEventMouseMoved;
}
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
return NPCocoaEventMouseDown;
case eMouseUp:
return NPCocoaEventMouseUp;
@ -1848,7 +1848,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
cocoaEvent.type = CocoaEventTypeForEvent(*anEvent, aObjectFrame);
if (anEvent->mMessage == eMouseMove ||
anEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
anEvent->mMessage == eMouseDown ||
anEvent->mMessage == eMouseUp ||
anEvent->mMessage == NS_MOUSE_SCROLL ||
anEvent->mMessage == NS_MOUSE_OVER ||
@ -1869,7 +1869,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
}
switch (anEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case eMouseUp: {
WidgetMouseEvent* mouseEvent = anEvent->AsMouseEvent();
if (mouseEvent) {
@ -2040,7 +2040,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
}
bool handled = (response == kNPEventHandled || response == kNPEventStartIME);
bool leftMouseButtonDown = (anEvent.mMessage == NS_MOUSE_BUTTON_DOWN) &&
bool leftMouseButtonDown = (anEvent.mMessage == eMouseDown) &&
(anEvent.AsMouseEvent()->button == WidgetMouseEvent::eLeftButton);
if (handled && !(leftMouseButtonDown && !mContentFocused)) {
rv = nsEventStatus_eConsumeNoDefault;
@ -2063,7 +2063,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
case eMouseMove:
pluginEvent.event = WM_MOUSEMOVE;
break;
case NS_MOUSE_BUTTON_DOWN: {
case eMouseDown: {
static const int downMsgs[] =
{ WM_LBUTTONDOWN, WM_MBUTTONDOWN, WM_RBUTTONDOWN };
static const int dblClickMsgs[] =
@ -2104,7 +2104,7 @@ 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.mMessage == NS_MOUSE_BUTTON_DOWN ||
NS_ASSERTION(anEvent.mMessage == eMouseDown ||
anEvent.mMessage == eMouseUp ||
anEvent.mMessage == NS_MOUSE_DOUBLECLICK ||
anEvent.mMessage == NS_MOUSE_OVER ||
@ -2235,11 +2235,11 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
event.same_screen = True;
}
break;
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case eMouseUp:
{
XButtonEvent& event = pluginEvent.xbutton;
event.type = anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ?
event.type = anEvent.mMessage == eMouseDown ?
ButtonPress : ButtonRelease;
event.root = root;
event.time = anEvent.time;
@ -2398,7 +2398,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// pluginPoint.y;
}
break;
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
{
ANPEvent event;
event.inSize = sizeof(ANPEvent);

View File

@ -1740,7 +1740,7 @@ nsXULElement::ClickWithInputSource(uint16_t aInputSource)
bool isCallerChrome = nsContentUtils::IsCallerChrome();
WidgetMouseEvent eventDown(isCallerChrome, NS_MOUSE_BUTTON_DOWN,
WidgetMouseEvent eventDown(isCallerChrome, eMouseDown,
nullptr, WidgetMouseEvent::eReal);
WidgetMouseEvent eventUp(isCallerChrome, eMouseUp,
nullptr, WidgetMouseEvent::eReal);

View File

@ -408,7 +408,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
return KeyPress(keyEvent);
}
// mousedown
case NS_MOUSE_BUTTON_DOWN: {
case eMouseDown: {
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
NS_ENSURE_TRUE(mouseEvent, NS_OK);
// nsEditorEventListener may receive (1) all mousedown, mouseup and click
@ -425,7 +425,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
case eMouseUp: {
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
NS_ENSURE_TRUE(mouseEvent, NS_OK);
// See above comment in the NS_MOUSE_BUTTON_DOWN case, first.
// See above comment in the eMouseDown case, first.
// This code assumes that case #1 is occuring. However, if case #3 may
// occurs after case #2 and the mousedown is consumed,
// mMouseDownOrUpConsumedByIME is true even though nsEditorEventListener
@ -434,7 +434,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
// this is not a matter because mMouseDownOrUpConsumedByIME is referred
// only by NS_MOUSE_CLICK case but click event is fired only in case #1.
// So, before a click event is fired, mMouseDownOrUpConsumedByIME is
// always initialized in the NS_MOUSE_BUTTON_DOWN case if it's referred.
// always initialized in the eMouseDown case if it's referred.
if (NotifyIMEOfMouseButtonEvent(mouseEvent)) {
mMouseDownOrUpConsumedByIME = true;
}

View File

@ -890,7 +890,7 @@ APZCTreeManager::UpdateWheelTransaction(WidgetInputEvent& aEvent)
case eKeyUp:
case eKeyDown:
case eMouseUp:
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case NS_MOUSE_DOUBLECLICK:
case NS_MOUSE_CLICK:
case NS_CONTEXTMENU:

View File

@ -496,7 +496,7 @@ APZCCallbackHelper::DispatchSynthesizedMouseEvent(EventMessage aMsg,
Modifiers aModifiers,
nsIWidget* aWidget)
{
MOZ_ASSERT(aMsg == eMouseMove || aMsg == NS_MOUSE_BUTTON_DOWN ||
MOZ_ASSERT(aMsg == eMouseMove || aMsg == eMouseDown ||
aMsg == eMouseUp || aMsg == NS_MOUSE_MOZLONGTAP);
WidgetMouseEvent event(true, aMsg, nullptr,
@ -547,7 +547,7 @@ APZCCallbackHelper::FireSingleTapEvent(const LayoutDevicePoint& aPoint,
Stringify(aPoint).c_str());
int time = 0;
DispatchSynthesizedMouseEvent(eMouseMove, time, aPoint, aModifiers, aWidget);
DispatchSynthesizedMouseEvent(NS_MOUSE_BUTTON_DOWN, time, aPoint, aModifiers, aWidget);
DispatchSynthesizedMouseEvent(eMouseDown, time, aPoint, aModifiers, aWidget);
DispatchSynthesizedMouseEvent(eMouseUp, time, aPoint, aModifiers, aWidget);
}

View File

@ -501,10 +501,10 @@ AccessibleCaretEventHub::HandleMouseEvent(WidgetMouseEvent* aEvent)
nsPoint point = GetMouseEventPosition(aEvent);
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
AC_LOGV("Before NS_MOUSE_BUTTON_DOWN, state: %s", mState->Name());
case eMouseDown:
AC_LOGV("Before eMouseDown, state: %s", mState->Name());
rv = mState->OnPress(this, point, id);
AC_LOGV("After NS_MOUSE_BUTTON_DOWN, state: %s, consume: %d",
AC_LOGV("After eMouseDown, state: %s, consume: %d",
mState->Name(), rv);
break;

View File

@ -205,7 +205,7 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, movePoint, rootFrame);
if (aEvent->mMessage == NS_TOUCH_START ||
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
(aEvent->mMessage == eMouseDown &&
mouseEvent->button == WidgetMouseEvent::eLeftButton)) {
// If having a active touch, ignore other touch down event
if (aEvent->mMessage == NS_TOUCH_START && mActiveTouchId >= 0) {

View File

@ -763,7 +763,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent)
case NS_TOUCH_START:
status = HandleTouchDownEvent(aEvent->AsTouchEvent());
break;
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
status = HandleMouseDownEvent(aEvent->AsMouseEvent());
break;
case NS_TOUCH_END:

View File

@ -126,7 +126,7 @@ public:
static UniquePtr<WidgetEvent> CreateMousePressEvent(nscoord aX, nscoord aY)
{
return CreateMouseEvent(NS_MOUSE_BUTTON_DOWN, aX, aY);
return CreateMouseEvent(eMouseDown, aX, aY);
}
static UniquePtr<WidgetEvent> CreateMouseMoveEvent(nscoord aX, nscoord aY)

View File

@ -467,7 +467,7 @@ public:
virtual void HandleEvent(EventChainPostVisitor& aVisitor) override
{
if (aVisitor.mPresContext && aVisitor.mEvent->mClass != eBasicEventClass) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
if (aVisitor.mEvent->mMessage == eMouseDown ||
aVisitor.mEvent->mMessage == eMouseUp) {
// Mouse-up and mouse-down events call nsFrame::HandlePress/Release
// which call GetContentOffsetsFromPoint which requires up-to-date layout.
@ -6570,7 +6570,7 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
if ((aEvent->mMessage == eMouseMove &&
aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal) ||
aEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == eMouseDown ||
aEvent->mMessage == eMouseUp) {
nsIFrame* rootFrame = GetRootFrame();
if (!rootFrame) {
@ -6679,7 +6679,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
case eMouseUp:
pointerMessage = NS_POINTER_UP;
break;
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
pointerMessage = NS_POINTER_DOWN;
break;
default:
@ -7481,7 +7481,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
// a document which needs events suppressed
if (aEvent->mClass == eMouseEventClass &&
frame->PresContext()->Document()->EventHandlingSuppressed()) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == eMouseDown) {
mNoDelayedMouseEvents = true;
} else if (!mNoDelayedMouseEvents && aEvent->mMessage == eMouseUp) {
DelayedEvent* event = new DelayedMouseEvent(aEvent->AsMouseEvent());
@ -7887,7 +7887,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
}
break;
}
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case eMouseUp:
isHandlingUserInput = true;
break;

View File

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

View File

@ -2567,7 +2567,7 @@ nsFrame::HandleEvent(nsPresContext* aPresContext,
if ((aEvent->mClass == eMouseEventClass &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
aEvent->mClass == eTouchEventClass) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
if (aEvent->mMessage == eMouseDown ||
aEvent->mMessage == NS_TOUCH_START) {
HandlePress(aPresContext, aEvent, aEventStatus);
} else if (aEvent->mMessage == eMouseUp ||

View File

@ -1539,7 +1539,7 @@ nsHTMLFramesetBorderFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
if (aEvent->mMessage == eMouseDown &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
nsHTMLFramesetFrame* parentFrame = do_QueryFrame(GetParent());
if (parentFrame) {

View File

@ -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->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (anEvent->mMessage == eMouseDown) {
nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED);
}
#endif

View File

@ -413,7 +413,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
}
#endif
}
else if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN &&
else if (aEvent->mMessage == eMouseDown &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
!IsDisabled() && IsMenu()) {
// The menu item was selected. Bring up the menu.

View File

@ -63,7 +63,7 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
switch (aEvent->mMessage) {
case NS_TOUCH_START:
case NS_MOUSE_BUTTON_DOWN: {
case eMouseDown: {
if (aEvent->mClass == eTouchEventClass ||
(aEvent->mClass == eMouseEventClass &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton)) {

View File

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

View File

@ -599,7 +599,7 @@ 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->mMessage == NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage == eMouseDown) {
HandlePress(aPresContext, aEvent, aEventStatus);
} else if (aEvent->mMessage == eMouseUp) {
HandleRelease(aPresContext, aEvent, aEventStatus);
@ -1052,7 +1052,7 @@ nsSliderFrame::ShouldScrollForEvent(WidgetGUIEvent* aEvent)
case NS_TOUCH_START:
case NS_TOUCH_END:
return true;
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case eMouseUp: {
uint16_t button = aEvent->AsMouseEvent()->button;
#ifdef MOZ_WIDGET_GTK
@ -1080,7 +1080,7 @@ nsSliderFrame::ShouldScrollToClickForEvent(WidgetGUIEvent* aEvent)
return GetScrollToClick();
}
if (aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
if (aEvent->mMessage != eMouseDown) {
return false;
}

View File

@ -68,7 +68,7 @@ nsTitleBarFrame::HandleEvent(nsPresContext* aPresContext,
switch (aEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN: {
case eMouseDown: {
if (aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
// titlebar has no effect in non-chrome shells
nsCOMPtr<nsIDocShellTreeItem> dsti = aPresContext->GetDocShell();

View File

@ -48,7 +48,7 @@ NS_EVENT_MESSAGE(eLanguageChange, eWindowEventFirst + 70)
NS_EVENT_MESSAGE(eMouseEventFirst, 300)
NS_EVENT_MESSAGE(eMouseMove, eMouseEventFirst)
NS_EVENT_MESSAGE(eMouseUp, eMouseEventFirst + 1)
NS_EVENT_MESSAGE(NS_MOUSE_BUTTON_DOWN, eMouseEventFirst + 2)
NS_EVENT_MESSAGE(eMouseDown, eMouseEventFirst + 2)
NS_EVENT_MESSAGE(NS_MOUSE_ENTER_WIDGET, eMouseEventFirst + 22)
NS_EVENT_MESSAGE(NS_MOUSE_EXIT_WIDGET, eMouseEventFirst + 23)
NS_EVENT_MESSAGE(NS_MOUSE_DOUBLECLICK, eMouseEventFirst + 24)

View File

@ -125,7 +125,7 @@ MultiTouchInput::ToWidgetMouseEvent(nsIWidget* aWidget) const
EventMessage mouseEventMessage = eVoidEvent;
switch (mType) {
case MultiTouchInput::MULTITOUCH_START:
mouseEventMessage = NS_MOUSE_BUTTON_DOWN;
mouseEventMessage = eMouseDown;
break;
case MultiTouchInput::MULTITOUCH_MOVE:
mouseEventMessage = eMouseMove;
@ -182,7 +182,7 @@ MultiTouchInput::MultiTouchInput(const WidgetMouseEvent& aMouseEvent)
MOZ_ASSERT(NS_IsMainThread(),
"Can only copy from WidgetMouseEvent on main thread");
switch (aMouseEvent.mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
mType = MULTITOUCH_START;
break;
case eMouseMove:

View File

@ -78,7 +78,7 @@ bool
WidgetEvent::HasMouseEventMessage() const
{
switch (mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
case eMouseUp:
case NS_MOUSE_CLICK:
case NS_MOUSE_DOUBLECLICK:

View File

@ -4577,7 +4577,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
NSUInteger modifierFlags = [theEvent modifierFlags];
WidgetMouseEvent geckoEvent(true, NS_MOUSE_BUTTON_DOWN, mGeckoChild,
WidgetMouseEvent geckoEvent(true, eMouseDown, mGeckoChild,
WidgetMouseEvent::eReal);
[self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
@ -4787,7 +4787,7 @@ NewCGSRegionFromRegion(const nsIntRegion& aRegion,
return;
// The right mouse went down, fire off a right mouse down event to gecko
WidgetMouseEvent geckoEvent(true, NS_MOUSE_BUTTON_DOWN, mGeckoChild,
WidgetMouseEvent geckoEvent(true, eMouseDown, mGeckoChild,
WidgetMouseEvent::eReal);
[self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
geckoEvent.button = WidgetMouseEvent::eRightButton;
@ -4850,7 +4850,7 @@ NewCGSRegionFromRegion(const nsIntRegion& aRegion,
if (!mGeckoChild)
return;
WidgetMouseEvent geckoEvent(true, NS_MOUSE_BUTTON_DOWN, mGeckoChild,
WidgetMouseEvent geckoEvent(true, eMouseDown, mGeckoChild,
WidgetMouseEvent::eReal);
[self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
geckoEvent.button = WidgetMouseEvent::eMiddleButton;

View File

@ -2753,8 +2753,7 @@ nsWindow::OnButtonPressEvent(GdkEventButton *aEvent)
gButtonState |= ButtonMaskFromGDKButton(aEvent->button);
WidgetMouseEvent event(true, NS_MOUSE_BUTTON_DOWN, this,
WidgetMouseEvent::eReal);
WidgetMouseEvent event(true, eMouseDown, this, WidgetMouseEvent::eReal);
event.button = domButton;
InitButtonEvent(event, aEvent);
event.pressure = mLastMotionPressure;

View File

@ -2649,7 +2649,7 @@ case _value: eventName.AssignLiteral(_name) ; break
_ASSIGN_eventName(eKeyUp,"eKeyUp");
_ASSIGN_eventName(NS_MOUSE_ENTER_WIDGET,"NS_MOUSE_ENTER_WIDGET");
_ASSIGN_eventName(NS_MOUSE_EXIT_WIDGET,"NS_MOUSE_EXIT_WIDGET");
_ASSIGN_eventName(NS_MOUSE_BUTTON_DOWN,"NS_MOUSE_BUTTON_DOWN");
_ASSIGN_eventName(eMouseDown,"eMouseDown");
_ASSIGN_eventName(eMouseUp,"eMouseUp");
_ASSIGN_eventName(NS_MOUSE_CLICK,"NS_MOUSE_CLICK");
_ASSIGN_eventName(NS_MOUSE_DOUBLECLICK,"NS_MOUSE_DBLCLICK");

View File

@ -999,8 +999,7 @@ nsWindow::mousePressEvent(QMouseEvent* aEvent)
return nsEventStatus_eIgnore;
}
WidgetMouseEvent event(true, NS_MOUSE_BUTTON_DOWN, this,
WidgetMouseEvent::eReal);
WidgetMouseEvent event(true, eMouseDown, this, WidgetMouseEvent::eReal);
InitMouseEvent(event, aEvent, 1);
nsEventStatus status = DispatchEvent(&event);

View File

@ -159,7 +159,7 @@ private:
ALOG("[ChildView[%p] handleTap]", self);
LayoutDeviceIntPoint lp = UIKitPointsToDevPixels([sender locationInView:self], [self contentScaleFactor]);
[self sendMouseEvent:eMouseMove point:lp widget:mGeckoChild];
[self sendMouseEvent:NS_MOUSE_BUTTON_DOWN point:lp widget:mGeckoChild];
[self sendMouseEvent:eMouseDown point:lp widget:mGeckoChild];
[self sendMouseEvent:eMouseUp point:lp widget:mGeckoChild];
}
}

View File

@ -2601,8 +2601,7 @@ IMMHandler::OnMouseButtonEvent(nsWindow* aWindow,
}
// We need to handle only mousedown event.
if (aIMENotification.mMouseButtonEventData.mEventMessage !=
NS_MOUSE_BUTTON_DOWN) {
if (aIMENotification.mMouseButtonEventData.mEventMessage != eMouseDown) {
return NS_OK;
}

View File

@ -538,8 +538,8 @@ static const char*
GetEventMessageName(uint32_t aMessage)
{
switch (aMessage) {
case NS_MOUSE_BUTTON_DOWN:
return "NS_MOUSE_BUTTON_DOWN";
case eMouseDown:
return "eMouseDown";
case eMouseUp:
return "eMouseUp";
default:

View File

@ -946,8 +946,7 @@ WinUtils::GetIsMouseFromTouch(EventMessage aEventMessage)
{
const uint32_t MOZ_T_I_SIGNATURE = TABLET_INK_TOUCH | TABLET_INK_SIGNATURE;
const uint32_t MOZ_T_I_CHECK_TCH = TABLET_INK_TOUCH | TABLET_INK_CHECK;
return ((aEventMessage == eMouseMove ||
aEventMessage == NS_MOUSE_BUTTON_DOWN ||
return ((aEventMessage == eMouseMove || aEventMessage == eMouseDown ||
aEventMessage == eMouseUp) &&
(GetMessageExtraInfo() & MOZ_T_I_SIGNATURE) == MOZ_T_I_CHECK_TCH);
}

View File

@ -4025,7 +4025,7 @@ nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
}
switch (aEventMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
CaptureMouse(true);
break;
@ -4101,7 +4101,7 @@ nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
switch (aEventMessage) {
case NS_MOUSE_DOUBLECLICK:
event.mMessage = NS_MOUSE_BUTTON_DOWN;
event.mMessage = eMouseDown;
event.button = aButton;
sLastClickCount = 2;
sLastMouseDownTime = curMsgTime;
@ -4112,7 +4112,7 @@ nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
sLastMousePoint.y = eventPoint.y;
sLastMouseButton = eventButton;
break;
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
// now look to see if we want to convert this to a double- or triple-click
if (((curMsgTime - sLastMouseDownTime) < (LONG)::GetDoubleClickTime()) &&
insideMovementThreshold &&
@ -4147,7 +4147,7 @@ nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
NPEvent pluginEvent;
switch (aEventMessage) {
case NS_MOUSE_BUTTON_DOWN:
case eMouseDown:
switch (aButton) {
case WidgetMouseEvent::eLeftButton:
pluginEvent.event = WM_LBUTTONDOWN;
@ -5142,7 +5142,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
case WM_LBUTTONDOWN:
{
result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam, lParam,
result = DispatchMouseEvent(eMouseDown, wParam, lParam,
false, WidgetMouseEvent::eLeftButton,
MOUSE_INPUT_SOURCE());
DispatchPendingEvents();
@ -5233,7 +5233,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
break;
case WM_MBUTTONDOWN:
result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam,
result = DispatchMouseEvent(eMouseDown, wParam,
lParam, false,
WidgetMouseEvent::eMiddleButton,
MOUSE_INPUT_SOURCE());
@ -5257,7 +5257,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
break;
case WM_NCMBUTTONDOWN:
result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, 0,
result = DispatchMouseEvent(eMouseDown, 0,
lParamToClient(lParam), false,
WidgetMouseEvent::eMiddleButton,
MOUSE_INPUT_SOURCE());
@ -5281,7 +5281,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
break;
case WM_RBUTTONDOWN:
result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam,
result = DispatchMouseEvent(eMouseDown, wParam,
lParam, false,
WidgetMouseEvent::eRightButton,
MOUSE_INPUT_SOURCE());
@ -5305,7 +5305,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
break;
case WM_NCRBUTTONDOWN:
result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, 0,
result = DispatchMouseEvent(eMouseDown, 0,
lParamToClient(lParam), false,
WidgetMouseEvent::eRightButton,
MOUSE_INPUT_SOURCE());