diff --git a/accessible/generic/Accessible.cpp b/accessible/generic/Accessible.cpp index 8a496bcba28f..b419134d1372 100644 --- a/accessible/generic/Accessible.cpp +++ b/accessible/generic/Accessible.cpp @@ -1838,7 +1838,8 @@ Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex) presShell, widget); nsCoreUtils::DispatchMouseEvent(eMouseDown, x, y, aContent, frame, presShell, widget); - nsCoreUtils::DispatchTouchEvent(NS_TOUCH_END, x, y, aContent, frame, presShell, widget); + nsCoreUtils::DispatchTouchEvent(eTouchEnd, x, y, aContent, frame, + presShell, widget); nsCoreUtils::DispatchMouseEvent(eMouseUp, x, y, aContent, frame, presShell, widget); } diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index b788670a6993..9ba5fcfae36f 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -966,7 +966,7 @@ nsDOMWindowUtils::SendTouchEventCommon(const nsAString& aType, } else if (aType.EqualsLiteral("touchmove")) { msg = eTouchMove; } else if (aType.EqualsLiteral("touchend")) { - msg = NS_TOUCH_END; + msg = eTouchEnd; } else if (aType.EqualsLiteral("touchcancel")) { msg = NS_TOUCH_CANCEL; } else { diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index e993e441a156..e20ecf058155 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -804,7 +804,7 @@ Event::GetEventPopupControlState(WidgetEvent* aEvent, nsIDOMEvent* aDOMEvent) abuse = openControlled; } break; - case NS_TOUCH_END : + case eTouchEnd: if (PopupAllowedForEvent("touchend")) { abuse = openControlled; } diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index f4eff9841ada..235285ce92cd 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -572,7 +572,7 @@ TOUCH_EVENT(touchstart, EventNameType_All, eTouchEventClass) TOUCH_EVENT(touchend, - NS_TOUCH_END, + eTouchEnd, EventNameType_All, eTouchEventClass) TOUCH_EVENT(touchmove, diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 2cbb44fc9e51..8bf6b861081d 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -1155,7 +1155,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent) switch (aEvent.mMessage) { case eTouchStart: case eTouchMove: - case NS_TOUCH_END: + case eTouchEnd: case NS_TOUCH_CANCEL: return true; default: diff --git a/dom/events/TouchEvent.cpp b/dom/events/TouchEvent.cpp index 7c14fc174f1f..02e7d8b4ac4b 100644 --- a/dom/events/TouchEvent.cpp +++ b/dom/events/TouchEvent.cpp @@ -122,7 +122,7 @@ TouchEvent::Touches() { if (!mTouches) { WidgetTouchEvent* touchEvent = mEvent->AsTouchEvent(); - if (mEvent->mMessage == NS_TOUCH_END || + if (mEvent->mMessage == eTouchEnd || mEvent->mMessage == NS_TOUCH_CANCEL) { // for touchend events, remove any changed touches from the touches array WidgetTouchEvent::AutoTouchArray unchangedTouches; @@ -150,7 +150,7 @@ 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->mMessage != NS_TOUCH_END && + if ((mEvent->mMessage != eTouchEnd && mEvent->mMessage != NS_TOUCH_CANCEL) || !touches[i]->mChanged) { if (touches[i]->mTarget == mEvent->originalTarget) { targetTouches.AppendElement(touches[i]); diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index d810223fe85d..7a9d20bf73f7 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -4134,7 +4134,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor) break; case eMouseUp: - case NS_TOUCH_END: + case eTouchEnd: if (!mIsDraggingRange) { break; } diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 59161378bb52..05b2af586916 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -2051,7 +2051,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus) } return; - case NS_TOUCH_END: + case eTouchEnd: if (!TouchManager::gPreventMouseEvents) { APZCCallbackHelper::DispatchSynthesizedMouseEvent( eMouseMove, time, currentPoint, 0, mPuppetWidget); diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 3a888119f56a..d802ef9fe600 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1834,7 +1834,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.mMessage == NS_TOUCH_END || event.mMessage == NS_TOUCH_CANCEL) { + if (event.mMessage == eTouchEnd || event.mMessage == NS_TOUCH_CANCEL) { for (int i = event.touches.Length() - 1; i >= 0; i--) { if (!event.touches[i]->mChanged) { event.touches.RemoveElementAt(i); @@ -2990,7 +2990,7 @@ TabParent::InjectTouchEvent(const nsAString& aType, EventMessage msg; nsContentUtils::GetEventMessageAndAtom(aType, eTouchEventClass, &msg); if (msg != eTouchStart && msg != eTouchMove && - msg != NS_TOUCH_END && msg != NS_TOUCH_CANCEL) { + msg != eTouchEnd && msg != NS_TOUCH_CANCEL) { return NS_ERROR_FAILURE; } diff --git a/gfx/layers/apz/util/APZEventState.cpp b/gfx/layers/apz/util/APZEventState.cpp index df5a91438314..7e6e8d8eec26 100644 --- a/gfx/layers/apz/util/APZEventState.cpp +++ b/gfx/layers/apz/util/APZEventState.cpp @@ -283,7 +283,7 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent, break; } - case NS_TOUCH_END: + case eTouchEnd: if (isTouchPrevented) { mTouchEndCancelled = true; mEndTouchIsClick = false; diff --git a/layout/base/AccessibleCaretEventHub.cpp b/layout/base/AccessibleCaretEventHub.cpp index 15903a4218c4..4f98488436f9 100644 --- a/layout/base/AccessibleCaretEventHub.cpp +++ b/layout/base/AccessibleCaretEventHub.cpp @@ -581,10 +581,10 @@ AccessibleCaretEventHub::HandleTouchEvent(WidgetTouchEvent* aEvent) AC_LOGV("After eTouchMove, state: %s, consume: %d", mState->Name(), rv); break; - case NS_TOUCH_END: - AC_LOGV("Before NS_TOUCH_END, state: %s", mState->Name()); + case eTouchEnd: + AC_LOGV("Before eTouchEnd, state: %s", mState->Name()); rv = mState->OnRelease(this); - AC_LOGV("After NS_TOUCH_END, state: %s, consume: %d", mState->Name(), rv); + AC_LOGV("After eTouchEnd, state: %s, consume: %d", mState->Name(), rv); break; case NS_TOUCH_CANCEL: diff --git a/layout/base/SelectionCarets.cpp b/layout/base/SelectionCarets.cpp index 326fcd2b7612..07fa6be5b570 100644 --- a/layout/base/SelectionCarets.cpp +++ b/layout/base/SelectionCarets.cpp @@ -231,7 +231,7 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent) mActiveTouchId = -1; LaunchLongTapDetector(); } - } else if (aEvent->mMessage == NS_TOUCH_END || + } else if (aEvent->mMessage == eTouchEnd || aEvent->mMessage == NS_TOUCH_CANCEL || aEvent->mMessage == eMouseUp) { CancelLongTapDetector(); diff --git a/layout/base/TouchCaret.cpp b/layout/base/TouchCaret.cpp index 246fb8583b63..d2cfe9e000d4 100644 --- a/layout/base/TouchCaret.cpp +++ b/layout/base/TouchCaret.cpp @@ -766,7 +766,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent) case eMouseDown: status = HandleMouseDownEvent(aEvent->AsMouseEvent()); break; - case NS_TOUCH_END: + case eTouchEnd: status = HandleTouchUpEvent(aEvent->AsTouchEvent()); break; case eMouseUp: diff --git a/layout/base/TouchManager.cpp b/layout/base/TouchManager.cpp index 15584ba57431..705ad0ce92cc 100644 --- a/layout/base/TouchManager.cpp +++ b/layout/base/TouchManager.cpp @@ -56,7 +56,7 @@ EvictTouchPoint(nsRefPtr& aTouch, nsPoint pt(aTouch->mRefPoint.x, aTouch->mRefPoint.y); nsCOMPtr widget = frame->GetView()->GetNearestWidget(&pt); if (widget) { - WidgetTouchEvent event(true, NS_TOUCH_END, widget); + WidgetTouchEvent event(true, eTouchEnd, widget); event.widget = widget; event.time = PR_IntervalNow(); event.touches.AppendElement(aTouch); @@ -190,7 +190,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent, } break; } - case NS_TOUCH_END: + case eTouchEnd: aIsHandlingUserInput = true; // Fall through to touchcancel code case NS_TOUCH_CANCEL: { diff --git a/layout/base/gtest/TestAccessibleCaretEventHub.cpp b/layout/base/gtest/TestAccessibleCaretEventHub.cpp index feb966695128..d948a845bd97 100644 --- a/layout/base/gtest/TestAccessibleCaretEventHub.cpp +++ b/layout/base/gtest/TestAccessibleCaretEventHub.cpp @@ -173,7 +173,7 @@ public: static UniquePtr CreateTouchReleaseEvent(nscoord aX, nscoord aY) { - return CreateTouchEvent(NS_TOUCH_END, aX, aY); + return CreateTouchEvent(eTouchEnd, aX, aY); } static UniquePtr CreateWheelEvent(EventMessage aMessage) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 271e858452e8..c8360e9d56fe 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -493,7 +493,7 @@ public: nsIFrame* frame = mPresShell->GetCurrentEventFrame(); if (!frame && (aVisitor.mEvent->mMessage == eMouseUp || - aVisitor.mEvent->mMessage == NS_TOUCH_END)) { + aVisitor.mEvent->mMessage == eTouchEnd)) { // Redirect BUTTON_UP and TOUCH_END events to the root frame to ensure // that capturing is released. frame = mPresShell->GetRootFrame(); @@ -6680,7 +6680,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell, case eTouchMove: pointerMessage = ePointerMove; break; - case NS_TOUCH_END: + case eTouchEnd: pointerMessage = ePointerUp; break; case eTouchStart: @@ -7480,7 +7480,7 @@ PresShell::HandleEvent(nsIFrame* aFrame, switch (aEvent->mMessage) { case eTouchMove: case NS_TOUCH_CANCEL: - case NS_TOUCH_END: { + case eTouchEnd: { // get the correct shell to dispatch to WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent(); for (dom::Touch* touch : touchEvent->touches) { @@ -8064,7 +8064,7 @@ PresShell::DispatchTouchEventToDOM(WidgetEvent* aEvent, // prevent click dispatching. bool canPrevent = (aEvent->mMessage == eTouchStart) || (aEvent->mMessage == eTouchMove && aTouchIsNew) || - (aEvent->mMessage == NS_TOUCH_END); + (aEvent->mMessage == eTouchEnd); bool preventDefault = false; nsEventStatus tmpStatus = nsEventStatus_eIgnore; WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent(); diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 243b2de7480c..e203a1a17678 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -2663,8 +2663,7 @@ nsFrame::HandleEvent(nsPresContext* aPresContext, aEvent->mClass == eTouchEventClass) { if (aEvent->mMessage == eMouseDown || aEvent->mMessage == eTouchStart) { HandlePress(aPresContext, aEvent, aEventStatus); - } else if (aEvent->mMessage == eMouseUp || - aEvent->mMessage == NS_TOUCH_END) { + } else if (aEvent->mMessage == eMouseUp || aEvent->mMessage == eTouchEnd) { HandleRelease(aPresContext, aEvent, aEventStatus); } } diff --git a/layout/xul/nsResizerFrame.cpp b/layout/xul/nsResizerFrame.cpp index 7f47613654e0..be7c2cc94a19 100644 --- a/layout/xul/nsResizerFrame.cpp +++ b/layout/xul/nsResizerFrame.cpp @@ -128,7 +128,7 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext, } break; - case NS_TOUCH_END: + case eTouchEnd: case eMouseUp: { if (aEvent->mClass == eTouchEventClass || (aEvent->mClass == eMouseEventClass && diff --git a/layout/xul/nsSliderFrame.cpp b/layout/xul/nsSliderFrame.cpp index d4e1565a22a0..aaa3f9bdf814 100644 --- a/layout/xul/nsSliderFrame.cpp +++ b/layout/xul/nsSliderFrame.cpp @@ -540,7 +540,7 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext, } break; - case NS_TOUCH_END: + case eTouchEnd: case eMouseUp: if (ShouldScrollForEvent(aEvent)) { StopDrag(); @@ -1050,7 +1050,7 @@ nsSliderFrame::ShouldScrollForEvent(WidgetGUIEvent* aEvent) { switch (aEvent->mMessage) { case eTouchStart: - case NS_TOUCH_END: + case eTouchEnd: return true; case eMouseDown: case eMouseUp: { diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h index bec3306d161f..03b8a4b7e39e 100644 --- a/widget/EventMessageList.h +++ b/widget/EventMessageList.h @@ -372,7 +372,7 @@ NS_EVENT_MESSAGE(eFullscreenError, eFullscreenEventFirst + 1) NS_EVENT_MESSAGE(eTouchEventFirst, 5200) NS_EVENT_MESSAGE(eTouchStart, eTouchEventFirst) NS_EVENT_MESSAGE(eTouchMove, eTouchEventFirst + 1) -NS_EVENT_MESSAGE(NS_TOUCH_END, eTouchEventFirst + 2) +NS_EVENT_MESSAGE(eTouchEnd, eTouchEventFirst + 2) NS_EVENT_MESSAGE(NS_TOUCH_CANCEL, eTouchEventFirst + 3) // Pointerlock DOM API diff --git a/widget/InputData.cpp b/widget/InputData.cpp index 48e02a8e00ce..8ee012bd086a 100644 --- a/widget/InputData.cpp +++ b/widget/InputData.cpp @@ -42,7 +42,7 @@ MultiTouchInput::MultiTouchInput(const WidgetTouchEvent& aTouchEvent) case eTouchMove: mType = MULTITOUCH_MOVE; break; - case NS_TOUCH_END: + case eTouchEnd: mType = MULTITOUCH_END; break; case NS_TOUCH_CANCEL: @@ -90,7 +90,7 @@ MultiTouchInput::ToWidgetTouchEvent(nsIWidget* aWidget) const touchEventMessage = eTouchMove; break; case MULTITOUCH_END: - touchEventMessage = NS_TOUCH_END; + touchEventMessage = eTouchEnd; break; case MULTITOUCH_CANCEL: touchEventMessage = NS_TOUCH_CANCEL; diff --git a/widget/android/AndroidJavaWrappers.cpp b/widget/android/AndroidJavaWrappers.cpp index c942f6b9817f..4c3592279047 100644 --- a/widget/android/AndroidJavaWrappers.cpp +++ b/widget/android/AndroidJavaWrappers.cpp @@ -720,7 +720,7 @@ AndroidGeckoEvent::MakeTouchEvent(nsIWidget* widget) } case AndroidMotionEvent::ACTION_UP: case AndroidMotionEvent::ACTION_POINTER_UP: { - type = NS_TOUCH_END; + type = eTouchEnd; // for pointer-up events we only want the data from // the one pointer that went up startIndex = PointerIndex(); diff --git a/widget/uikit/nsWindow.mm b/widget/uikit/nsWindow.mm index 49d465dba761..e910cca86cf4 100644 --- a/widget/uikit/nsWindow.mm +++ b/widget/uikit/nsWindow.mm @@ -224,7 +224,7 @@ private: if (!mGeckoChild) return; - [self sendTouchEvent:NS_TOUCH_END touches:touches widget:mGeckoChild]; + [self sendTouchEvent:eTouchEnd touches:touches widget:mGeckoChild]; for (UITouch* touch : touches) { CFDictionaryRemoveValue(mTouches, touch); } diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index fd68421ed872..55c884c4cf5f 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -6412,7 +6412,7 @@ bool nsWindow::OnTouch(WPARAM wParam, LPARAM lParam) } if (pInputs[i].dwFlags & TOUCHEVENTF_UP) { // Pres shell expects removed contacts points to be delivered in a separate - // NS_TOUCH_END event containing only the contact points that were removed. + // eTouchEnd event containing only the contact points that were removed. if (touchEndInput.mTimeStamp.IsNull()) { // Initialize a touch event to send. touchEndInput.mType = MultiTouchInput::MULTITOUCH_END;