Bug 895274 part.26 Rename NS_MOUSE_BUTTON_UP to eMouseUp r=smaug

This commit is contained in:
Masayuki Nakano 2015-08-29 08:58:30 +09:00
Родитель 717c415187
Коммит 30fdd39afb
45 изменённых файлов: 92 добавлений и 95 удалений

Просмотреть файл

@ -113,7 +113,7 @@ nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, cnvdX, cnvdY,
tcContent, tcFrame, presShell, rootWidget);
DispatchMouseEvent(NS_MOUSE_BUTTON_UP, cnvdX, cnvdY,
DispatchMouseEvent(eMouseUp, cnvdX, cnvdY,
tcContent, tcFrame, presShell, rootWidget);
}

Просмотреть файл

@ -1837,7 +1837,8 @@ Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex)
nsCoreUtils::DispatchTouchEvent(NS_TOUCH_START, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchTouchEvent(NS_TOUCH_END, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_UP, x, y, aContent, frame, presShell, widget);
nsCoreUtils::DispatchMouseEvent(eMouseUp, x, y, aContent, frame,
presShell, widget);
}
void

Просмотреть файл

@ -7840,7 +7840,7 @@ nsContentUtils::SendMouseEvent(nsCOMPtr<nsIPresShell> aPresShell,
if (aType.EqualsLiteral("mousedown"))
msg = NS_MOUSE_BUTTON_DOWN;
else if (aType.EqualsLiteral("mouseup"))
msg = NS_MOUSE_BUTTON_UP;
msg = eMouseUp;
else if (aType.EqualsLiteral("mousemove"))
msg = eMouseMove;
else if (aType.EqualsLiteral("mouseover"))

Просмотреть файл

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

Просмотреть файл

@ -818,7 +818,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent)
if (aEvent->mFlags.mIsTrusted &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
switch(aEvent->mMessage) {
case NS_MOUSE_BUTTON_UP :
case eMouseUp:
if (PopupAllowedForEvent("mouseup")) {
abuse = openControlled;
}

Просмотреть файл

@ -291,7 +291,7 @@ EVENT(mouseover,
EventNameType_All,
eMouseEventClass)
EVENT(mouseup,
NS_MOUSE_BUTTON_UP,
eMouseUp,
EventNameType_All,
eMouseEventClass)
EVENT(mozfullscreenchange,

Просмотреть файл

@ -567,7 +567,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
}
break;
}
case NS_MOUSE_BUTTON_UP: {
case eMouseUp: {
switch (mouseEvent->button) {
case WidgetMouseEvent::eLeftButton:
if (Prefs::ClickHoldContextMenu()) {
@ -1171,7 +1171,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent)
case eMouseEventClass:
switch (aEvent.mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
case eMouseMove:
case NS_CONTEXTMENU:
case NS_MOUSE_ENTER_WIDGET:
@ -2795,7 +2795,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
// Most of the events we handle below require a frame.
// Add special cases here.
if (!mCurrentTarget && aEvent->mMessage != NS_MOUSE_BUTTON_UP &&
if (!mCurrentTarget && aEvent->mMessage != eMouseUp &&
aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
return NS_OK;
}
@ -3017,7 +3017,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
}
break;
}
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
{
ClearGlobalActiveContent(this);
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
@ -4441,7 +4441,7 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mLastLeftMouseDownContent = mouseContent;
mLastLeftMouseDownContentParent = mouseContentParent;
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == eMouseUp) {
if (mLastLeftMouseDownContent == mouseContent ||
mLastLeftMouseDownContentParent == mouseContent ||
mLastLeftMouseDownContent == mouseContentParent) {
@ -4459,7 +4459,7 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mLastMiddleMouseDownContent = mouseContent;
mLastMiddleMouseDownContentParent = mouseContentParent;
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == eMouseUp) {
if (mLastMiddleMouseDownContent == mouseContent ||
mLastMiddleMouseDownContentParent == mouseContent ||
mLastMiddleMouseDownContent == mouseContentParent) {
@ -4477,7 +4477,7 @@ EventStateManager::SetClickCount(nsPresContext* aPresContext,
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mLastRightMouseDownContent = mouseContent;
mLastRightMouseDownContentParent = mouseContentParent;
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == eMouseUp) {
if (mLastRightMouseDownContent == mouseContent ||
mLastRightMouseDownContentParent == mouseContent ||
mLastRightMouseDownContent == mouseContentParent) {
@ -5765,7 +5765,7 @@ AutoHandlingUserInputStatePusher::AutoHandlingUserInputStatePusher(
}
mResetFMMouseButtonHandlingState =
(aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP);
aEvent->mMessage == eMouseUp);
if (mResetFMMouseButtonHandlingState) {
nsFocusManager* fm = nsFocusManager::GetFocusManager();
NS_ENSURE_TRUE_VOID(fm);

Просмотреть файл

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

Просмотреть файл

@ -210,7 +210,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent)
case eKeyPress:
case eKeyUp:
case eKeyDown:
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_DOUBLECLICK:
case NS_MOUSE_CLICK:

Просмотреть файл

@ -334,7 +334,7 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
// cancel all of these events for buttons
//XXXsmaug What to do with these events? Why these should be cancelled?
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
case NS_MOUSE_DOUBLECLICK:
{
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();

Просмотреть файл

@ -3228,7 +3228,7 @@ HTMLInputElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
if (stopSpin) {
StopNumberControlSpinnerSpin();
}
} else if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (aVisitor.mEvent->mMessage == eMouseUp) {
StopNumberControlSpinnerSpin();
}
}
@ -3939,7 +3939,7 @@ HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
} break; // eKeyPress || eKeyUp
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
case NS_MOUSE_DOUBLECLICK:
{
// cancel all of these events for buttons
@ -4133,7 +4133,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
case NS_TOUCH_END:
if (!mIsDraggingRange) {
break;

Просмотреть файл

@ -2059,7 +2059,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus)
APZCCallbackHelper::DispatchSynthesizedMouseEvent(
NS_MOUSE_BUTTON_DOWN, time, currentPoint, 0, mPuppetWidget);
APZCCallbackHelper::DispatchSynthesizedMouseEvent(
NS_MOUSE_BUTTON_UP, time, currentPoint, 0, mPuppetWidget);
eMouseUp, time, currentPoint, 0, mPuppetWidget);
}
// fall through
case NS_TOUCH_CANCEL:

Просмотреть файл

@ -1683,7 +1683,7 @@ nsresult nsPluginInstanceOwner::DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent,
aMouseEvent->StopPropagation();
}
}
if (mouseEvent->mMessage == NS_MOUSE_BUTTON_UP) {
if (mouseEvent->mMessage == eMouseUp) {
mLastMouseDownButtonType = -1;
}
}
@ -1824,7 +1824,7 @@ CocoaEventTypeForEvent(const WidgetGUIEvent& anEvent, nsIFrame* aObjectFrame)
}
case NS_MOUSE_BUTTON_DOWN:
return NPCocoaEventMouseDown;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
return NPCocoaEventMouseUp;
case eKeyDown:
return NPCocoaEventKeyDown;
@ -1849,7 +1849,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
if (anEvent->mMessage == eMouseMove ||
anEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
anEvent->mMessage == NS_MOUSE_BUTTON_UP ||
anEvent->mMessage == eMouseUp ||
anEvent->mMessage == NS_MOUSE_SCROLL ||
anEvent->mMessage == NS_MOUSE_OVER ||
anEvent->mMessage == NS_MOUSE_OUT)
@ -1870,8 +1870,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
switch (anEvent->mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
{
case eMouseUp: {
WidgetMouseEvent* mouseEvent = anEvent->AsMouseEvent();
if (mouseEvent) {
switch (mouseEvent->button) {
@ -1889,7 +1888,7 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
}
cocoaEvent.data.mouse.clickCount = mouseEvent->clickCount;
} else {
NS_WARNING("NS_MOUSE_BUTTON_UP/DOWN is not a WidgetMouseEvent?");
NS_WARNING("eMouseUp/DOWN is not a WidgetMouseEvent?");
}
break;
}
@ -2076,7 +2075,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
}
break;
}
case NS_MOUSE_BUTTON_UP: {
case eMouseUp: {
static const int upMsgs[] =
{ WM_LBUTTONUP, WM_MBUTTONUP, WM_RBUTTONUP };
pluginEvent.event = upMsgs[mouseEvent->button];
@ -2106,7 +2105,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
// See use of NPEvent in widget/windows/nsWindow.cpp
// for why this assert should be safe
NS_ASSERTION(anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ||
anEvent.mMessage == NS_MOUSE_BUTTON_UP ||
anEvent.mMessage == eMouseUp ||
anEvent.mMessage == NS_MOUSE_DOUBLECLICK ||
anEvent.mMessage == NS_MOUSE_OVER ||
anEvent.mMessage == NS_MOUSE_OUT ||
@ -2237,7 +2236,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
}
break;
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
{
XButtonEvent& event = pluginEvent.xbutton;
event.type = anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ?
@ -2410,7 +2409,7 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
mInstance->HandleEvent(&event, nullptr, NS_PLUGIN_CALL_SAFE_TO_REENTER_GECKO);
}
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
{
ANPEvent event;
event.inSize = sizeof(ANPEvent);

Просмотреть файл

@ -1742,7 +1742,7 @@ nsXULElement::ClickWithInputSource(uint16_t aInputSource)
WidgetMouseEvent eventDown(isCallerChrome, NS_MOUSE_BUTTON_DOWN,
nullptr, WidgetMouseEvent::eReal);
WidgetMouseEvent eventUp(isCallerChrome, NS_MOUSE_BUTTON_UP,
WidgetMouseEvent eventUp(isCallerChrome, eMouseUp,
nullptr, WidgetMouseEvent::eReal);
WidgetMouseEvent eventClick(isCallerChrome, NS_MOUSE_CLICK, nullptr,
WidgetMouseEvent::eReal);

Просмотреть файл

@ -422,7 +422,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
return mMouseDownOrUpConsumedByIME ? NS_OK : MouseDown(mouseEvent);
}
// mouseup
case NS_MOUSE_BUTTON_UP: {
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.

Просмотреть файл

@ -889,7 +889,7 @@ APZCTreeManager::UpdateWheelTransaction(WidgetInputEvent& aEvent)
case eKeyPress:
case eKeyUp:
case eKeyDown:
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_DOUBLECLICK:
case NS_MOUSE_CLICK:

Просмотреть файл

@ -497,7 +497,7 @@ APZCCallbackHelper::DispatchSynthesizedMouseEvent(EventMessage aMsg,
nsIWidget* aWidget)
{
MOZ_ASSERT(aMsg == eMouseMove || aMsg == NS_MOUSE_BUTTON_DOWN ||
aMsg == NS_MOUSE_BUTTON_UP || aMsg == NS_MOUSE_MOZLONGTAP);
aMsg == eMouseUp || aMsg == NS_MOUSE_MOZLONGTAP);
WidgetMouseEvent event(true, aMsg, nullptr,
WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
@ -548,7 +548,7 @@ APZCCallbackHelper::FireSingleTapEvent(const LayoutDevicePoint& aPoint,
int time = 0;
DispatchSynthesizedMouseEvent(eMouseMove, time, aPoint, aModifiers, aWidget);
DispatchSynthesizedMouseEvent(NS_MOUSE_BUTTON_DOWN, time, aPoint, aModifiers, aWidget);
DispatchSynthesizedMouseEvent(NS_MOUSE_BUTTON_UP, time, aPoint, aModifiers, aWidget);
DispatchSynthesizedMouseEvent(eMouseUp, time, aPoint, aModifiers, aWidget);
}
static nsIScrollableFrame*

Просмотреть файл

@ -514,10 +514,10 @@ AccessibleCaretEventHub::HandleMouseEvent(WidgetMouseEvent* aEvent)
AC_LOGV("After eMouseMove, state: %s, consume: %d", mState->Name(), rv);
break;
case NS_MOUSE_BUTTON_UP:
AC_LOGV("Before NS_MOUSE_BUTTON_UP, state: %s", mState->Name());
case eMouseUp:
AC_LOGV("Before eMouseUp, state: %s", mState->Name());
rv = mState->OnRelease(this);
AC_LOGV("After NS_MOUSE_BUTTON_UP, state: %s, consume: %d", mState->Name(),
AC_LOGV("After eMouseUp, state: %s, consume: %d", mState->Name(),
rv);
break;

Просмотреть файл

@ -233,7 +233,7 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent)
}
} else if (aEvent->mMessage == NS_TOUCH_END ||
aEvent->mMessage == NS_TOUCH_CANCEL ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
aEvent->mMessage == eMouseUp) {
CancelLongTapDetector();
if (mDragMode != NONE) {
// Only care about same id

Просмотреть файл

@ -769,7 +769,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent)
case NS_TOUCH_END:
status = HandleTouchUpEvent(aEvent->AsTouchEvent());
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
status = HandleMouseUpEvent(aEvent->AsMouseEvent());
break;
case NS_TOUCH_MOVE:

Просмотреть файл

@ -136,7 +136,7 @@ public:
static UniquePtr<WidgetEvent> CreateMouseReleaseEvent(nscoord aX, nscoord aY)
{
return CreateMouseEvent(NS_MOUSE_BUTTON_UP, aX, aY);
return CreateMouseEvent(eMouseUp, aX, aY);
}
static UniquePtr<WidgetEvent> CreateLongTapEvent(nscoord aX, nscoord aY)

Просмотреть файл

@ -468,7 +468,7 @@ public:
{
if (aVisitor.mPresContext && aVisitor.mEvent->mClass != eBasicEventClass) {
if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
aVisitor.mEvent->mMessage == eMouseUp) {
// 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
@ -492,7 +492,7 @@ public:
}
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
if (!frame &&
(aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP ||
(aVisitor.mEvent->mMessage == eMouseUp ||
aVisitor.mEvent->mMessage == NS_TOUCH_END)) {
// Redirect BUTTON_UP and TOUCH_END events to the root frame to ensure
// that capturing is released.
@ -6571,7 +6571,7 @@ PresShell::RecordMouseLocation(WidgetGUIEvent* aEvent)
aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal) ||
aEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
aEvent->mMessage == eMouseUp) {
nsIFrame* rootFrame = GetRootFrame();
if (!rootFrame) {
nsView* rootView = mViewManager->GetRootView();
@ -6676,7 +6676,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell,
}
pointerMessage = NS_POINTER_MOVE;
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
pointerMessage = NS_POINTER_UP;
break;
case NS_MOUSE_BUTTON_DOWN:
@ -7483,8 +7483,7 @@ PresShell::HandleEvent(nsIFrame* aFrame,
frame->PresContext()->Document()->EventHandlingSuppressed()) {
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
mNoDelayedMouseEvents = true;
} else if (!mNoDelayedMouseEvents &&
aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (!mNoDelayedMouseEvents && aEvent->mMessage == eMouseUp) {
DelayedEvent* event = new DelayedMouseEvent(aEvent->AsMouseEvent());
if (!mDelayedEvents.AppendElement(event)) {
delete event;
@ -7889,7 +7888,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
break;
}
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
isHandlingUserInput = true;
break;
@ -7993,7 +7992,7 @@ PresShell::HandleEventInternal(WidgetEvent* aEvent, nsEventStatus* aStatus)
}
break;
}
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
// reset the capturing content now that the mouse button is up
SetCapturingContent(nullptr, 0);
break;

Просмотреть файл

@ -162,7 +162,7 @@ nsImageControlFrame::HandleEvent(nsPresContext* aPresContext,
*aEventStatus = nsEventStatus_eIgnore;
if (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
if (aEvent->mMessage == eMouseUp &&
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

Просмотреть файл

@ -2570,7 +2570,7 @@ nsFrame::HandleEvent(nsPresContext* aPresContext,
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
aEvent->mMessage == NS_TOUCH_START) {
HandlePress(aPresContext, aEvent, aEventStatus);
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP ||
} else if (aEvent->mMessage == eMouseUp ||
aEvent->mMessage == NS_TOUCH_END) {
HandleRelease(aPresContext, aEvent, aEventStatus);
}
@ -2605,7 +2605,7 @@ nsFrame::GetDataForTableSelection(const nsFrameSelection* aFrameSelection,
bool doTableSelection =
displaySelection == nsISelectionDisplay::DISPLAY_ALL && selectingTableCells &&
(aMouseEvent->mMessage == eMouseMove ||
(aMouseEvent->mMessage == NS_MOUSE_BUTTON_UP &&
(aMouseEvent->mMessage == eMouseUp &&
aMouseEvent->button == WidgetMouseEvent::eLeftButton) ||
aMouseEvent->IsShift());

Просмотреть файл

@ -655,7 +655,7 @@ nsresult nsHTMLFramesetFrame::HandleEvent(nsPresContext* aPresContext,
case eMouseMove:
MouseDrag(aPresContext, aEvent);
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
if (aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
EndMouseDrag(aPresContext);
}

Просмотреть файл

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

Просмотреть файл

@ -1812,7 +1812,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
// nsPluginFrameSuper::HandleEvent() might have killed us.
#ifdef XP_MACOSX
if (anEvent->mMessage == NS_MOUSE_BUTTON_UP) {
if (anEvent->mMessage == eMouseUp) {
nsIPresShell::SetCapturingContent(nullptr, 0);
}
#endif

Просмотреть файл

@ -431,7 +431,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
}
else if (
#ifndef NSCONTEXTMENUISMOUSEUP
(aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
(aEvent->mMessage == eMouseUp &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eRightButton) &&
#else
aEvent->mMessage == NS_CONTEXTMENU &&
@ -452,7 +452,7 @@ nsMenuFrame::HandleEvent(nsPresContext* aPresContext,
Execute(aEvent);
}
}
else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
else if (aEvent->mMessage == eMouseUp &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
!IsMenu() && !IsDisabled()) {
// Execute the execute event handler.

Просмотреть файл

@ -129,7 +129,7 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext,
break;
case NS_TOUCH_END:
case NS_MOUSE_BUTTON_UP: {
case eMouseUp: {
if (aEvent->mClass == eTouchEventClass ||
(aEvent->mClass == eMouseEventClass &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton)) {

Просмотреть файл

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

Просмотреть файл

@ -60,7 +60,7 @@ nsScrollbarButtonFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
HandleRelease(aPresContext, aEvent, aEventStatus);
break;
case NS_MOUSE_OUT:

Просмотреть файл

@ -541,7 +541,7 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
break;
case NS_TOUCH_END:
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
if (ShouldScrollForEvent(aEvent)) {
StopDrag();
//we MUST call nsFrame HandleEvent for mouse ups to maintain the selection state and capture state.
@ -601,7 +601,7 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
// nsFrame::HandleEvent, but only for the left mouse button.
if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
HandlePress(aPresContext, aEvent, aEventStatus);
} else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
} else if (aEvent->mMessage == eMouseUp) {
HandleRelease(aPresContext, aEvent, aEventStatus);
}
@ -1053,7 +1053,7 @@ nsSliderFrame::ShouldScrollForEvent(WidgetGUIEvent* aEvent)
case NS_TOUCH_END:
return true;
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP: {
case eMouseUp: {
uint16_t button = aEvent->AsMouseEvent()->button;
#ifdef MOZ_WIDGET_GTK
return (button == WidgetMouseEvent::eLeftButton) ||

Просмотреть файл

@ -393,7 +393,7 @@ nsSplitterFrame::HandleEvent(nsPresContext* aPresContext,
mInner->MouseDrag(aPresContext, aEvent);
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
if (aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
mInner->MouseUp(aPresContext, aEvent);
}

Просмотреть файл

@ -92,7 +92,7 @@ nsTitleBarFrame::HandleEvent(nsPresContext* aPresContext,
break;
case NS_MOUSE_BUTTON_UP: {
case eMouseUp: {
if (mTrackingMouseMove &&
aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
// we're done tracking.

Просмотреть файл

@ -47,7 +47,7 @@ NS_EVENT_MESSAGE(eLanguageChange, eWindowEventFirst + 70)
NS_EVENT_MESSAGE(eMouseEventFirst, 300)
NS_EVENT_MESSAGE(eMouseMove, eMouseEventFirst)
NS_EVENT_MESSAGE(NS_MOUSE_BUTTON_UP, eMouseEventFirst + 1)
NS_EVENT_MESSAGE(eMouseUp, eMouseEventFirst + 1)
NS_EVENT_MESSAGE(NS_MOUSE_BUTTON_DOWN, eMouseEventFirst + 2)
NS_EVENT_MESSAGE(NS_MOUSE_ENTER_WIDGET, eMouseEventFirst + 22)
NS_EVENT_MESSAGE(NS_MOUSE_EXIT_WIDGET, eMouseEventFirst + 23)

Просмотреть файл

@ -132,7 +132,7 @@ MultiTouchInput::ToWidgetMouseEvent(nsIWidget* aWidget) const
break;
case MultiTouchInput::MULTITOUCH_CANCEL:
case MultiTouchInput::MULTITOUCH_END:
mouseEventMessage = NS_MOUSE_BUTTON_UP;
mouseEventMessage = eMouseUp;
break;
default:
MOZ_ASSERT_UNREACHABLE("Did not assign a type to WidgetMouseEvent");
@ -188,7 +188,7 @@ MultiTouchInput::MultiTouchInput(const WidgetMouseEvent& aMouseEvent)
case eMouseMove:
mType = MULTITOUCH_MOVE;
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
mType = MULTITOUCH_END;
break;
// The mouse pointer has been interrupted in an implementation-specific

Просмотреть файл

@ -79,7 +79,7 @@ WidgetEvent::HasMouseEventMessage() const
{
switch (mMessage) {
case NS_MOUSE_BUTTON_DOWN:
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
case NS_MOUSE_CLICK:
case NS_MOUSE_DOUBLECLICK:
case NS_MOUSE_ENTER_WIDGET:

Просмотреть файл

@ -4611,7 +4611,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
nsAutoRetainCocoaObject kungFuDeathGrip(self);
WidgetMouseEvent geckoEvent(true, NS_MOUSE_BUTTON_UP, mGeckoChild,
WidgetMouseEvent geckoEvent(true, eMouseUp, mGeckoChild,
WidgetMouseEvent::eReal);
[self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
if ([theEvent modifierFlags] & NSControlKeyMask)
@ -4810,7 +4810,7 @@ NewCGSRegionFromRegion(const nsIntRegion& aRegion,
if (!mGeckoChild)
return;
WidgetMouseEvent geckoEvent(true, NS_MOUSE_BUTTON_UP, mGeckoChild,
WidgetMouseEvent geckoEvent(true, eMouseUp, mGeckoChild,
WidgetMouseEvent::eReal);
[self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
geckoEvent.button = WidgetMouseEvent::eRightButton;
@ -4866,7 +4866,7 @@ NewCGSRegionFromRegion(const nsIntRegion& aRegion,
if (!mGeckoChild)
return;
WidgetMouseEvent geckoEvent(true, NS_MOUSE_BUTTON_UP, mGeckoChild,
WidgetMouseEvent geckoEvent(true, eMouseUp, mGeckoChild,
WidgetMouseEvent::eReal);
[self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
geckoEvent.button = WidgetMouseEvent::eMiddleButton;

Просмотреть файл

@ -2627,7 +2627,7 @@ nsWindow::DispatchMissedButtonReleases(GdkEventCrossing *aGdkEvent)
// change in state. This event is marked as synthesized so that
// it is not dispatched as a DOM event, because we don't know the
// position, widget, modifiers, or time/order.
WidgetMouseEvent synthEvent(true, NS_MOUSE_BUTTON_UP, this,
WidgetMouseEvent synthEvent(true, eMouseUp, this,
WidgetMouseEvent::eSynthesized);
synthEvent.button = buttonType;
DispatchInputEvent(&synthEvent);
@ -2652,7 +2652,7 @@ nsWindow::InitButtonEvent(WidgetMouseEvent& aEvent,
guint modifierState = aGdkEvent->state;
// aEvent's state doesn't include this event's information. Therefore,
// if aEvent is mouse button down event, we need to set it manually.
// Note that we cannot do same thing for NS_MOUSE_BUTTON_UP because
// Note that we cannot do same thing for eMouseUp because
// system may have two or more mice and same button of another mouse
// may be still pressed.
if (aGdkEvent->type != GDK_BUTTON_RELEASE) {
@ -2794,7 +2794,7 @@ nsWindow::OnButtonReleaseEvent(GdkEventButton *aEvent)
gButtonState &= ~ButtonMaskFromGDKButton(aEvent->button);
WidgetMouseEvent event(true, NS_MOUSE_BUTTON_UP, this,
WidgetMouseEvent event(true, eMouseUp, this,
WidgetMouseEvent::eReal);
event.button = domButton;
InitButtonEvent(event, aEvent);

Просмотреть файл

@ -2650,7 +2650,7 @@ case _value: eventName.AssignLiteral(_name) ; break
_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(NS_MOUSE_BUTTON_UP,"NS_MOUSE_BUTTON_UP");
_ASSIGN_eventName(eMouseUp,"eMouseUp");
_ASSIGN_eventName(NS_MOUSE_CLICK,"NS_MOUSE_CLICK");
_ASSIGN_eventName(NS_MOUSE_DOUBLECLICK,"NS_MOUSE_DBLCLICK");
_ASSIGN_eventName(eMouseMove,"eMouseMove");

Просмотреть файл

@ -1025,8 +1025,7 @@ nsWindow::mouseReleaseEvent(QMouseEvent* aEvent)
if (!IsAcceptedButton(aEvent->button()))
return nsEventStatus_eIgnore;
WidgetMouseEvent event(true, NS_MOUSE_BUTTON_UP, this,
WidgetMouseEvent::eReal);
WidgetMouseEvent event(true, eMouseUp, this, WidgetMouseEvent::eReal);
InitMouseEvent(event, aEvent, 1);
return DispatchEvent(&event);
}

Просмотреть файл

@ -160,7 +160,7 @@ private:
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:NS_MOUSE_BUTTON_UP point:lp widget:mGeckoChild];
[self sendMouseEvent:eMouseUp point:lp widget:mGeckoChild];
}
}

Просмотреть файл

@ -540,8 +540,8 @@ GetEventMessageName(uint32_t aMessage)
switch (aMessage) {
case NS_MOUSE_BUTTON_DOWN:
return "NS_MOUSE_BUTTON_DOWN";
case NS_MOUSE_BUTTON_UP:
return "NS_MOUSE_BUTTON_UP";
case eMouseUp:
return "eMouseUp";
default:
return "Unknown";
}
@ -4757,7 +4757,7 @@ TSFTextStore::OnMouseButtonEventInternal(
ULONG edge = quadrant < 2 ? offset + 1 : offset;
DWORD buttonStatus = 0;
bool isMouseUp =
aIMENotification.mMouseButtonEventData.mEventMessage == NS_MOUSE_BUTTON_UP;
aIMENotification.mMouseButtonEventData.mEventMessage == eMouseUp;
if (!isMouseUp) {
switch (aIMENotification.mMouseButtonEventData.mButton) {
case WidgetMouseEventBase::eLeftButton:

Просмотреть файл

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

Просмотреть файл

@ -4032,7 +4032,7 @@ nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
// eMouseMove and NS_MOUSE_EXIT_WIDGET are here because we need to make
// sure capture flag isn't left on after a drag where we wouldn't see a
// button up message (see bug 324131).
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
case eMouseMove:
case NS_MOUSE_EXIT_WIDGET:
if (!(wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) && sIsInMouseCapture)
@ -4106,7 +4106,7 @@ nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
sLastClickCount = 2;
sLastMouseDownTime = curMsgTime;
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
// remember when this happened for the next mouse down
sLastMousePoint.x = eventPoint.x;
sLastMousePoint.y = eventPoint.y;
@ -4162,7 +4162,7 @@ nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
break;
}
break;
case NS_MOUSE_BUTTON_UP:
case eMouseUp:
switch (aButton) {
case WidgetMouseEvent::eLeftButton:
pluginEvent.event = WM_LBUTTONUP;
@ -5151,7 +5151,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
case WM_LBUTTONUP:
{
result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam, lParam,
result = DispatchMouseEvent(eMouseUp, wParam, lParam,
false, WidgetMouseEvent::eLeftButton,
MOUSE_INPUT_SOURCE());
DispatchPendingEvents();
@ -5241,7 +5241,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
break;
case WM_MBUTTONUP:
result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam,
result = DispatchMouseEvent(eMouseUp, wParam,
lParam, false,
WidgetMouseEvent::eMiddleButton,
MOUSE_INPUT_SOURCE());
@ -5265,7 +5265,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
break;
case WM_NCMBUTTONUP:
result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0,
result = DispatchMouseEvent(eMouseUp, 0,
lParamToClient(lParam), false,
WidgetMouseEvent::eMiddleButton,
MOUSE_INPUT_SOURCE());
@ -5289,7 +5289,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
break;
case WM_RBUTTONUP:
result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam,
result = DispatchMouseEvent(eMouseUp, wParam,
lParam, false,
WidgetMouseEvent::eRightButton,
MOUSE_INPUT_SOURCE());
@ -5313,7 +5313,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
break;
case WM_NCRBUTTONUP:
result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0,
result = DispatchMouseEvent(eMouseUp, 0,
lParamToClient(lParam), false,
WidgetMouseEvent::eRightButton,
MOUSE_INPUT_SOURCE());
@ -5377,7 +5377,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
false, WidgetMouseEvent::eLeftButton,
MOUSE_INPUT_SOURCE());
result =
DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0, lParamToClient(lParam),
DispatchMouseEvent(eMouseUp, 0, lParamToClient(lParam),
false, WidgetMouseEvent::eLeftButton,
MOUSE_INPUT_SOURCE());
DispatchPendingEvents();