diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 1ff02ecb1ca..b788670a699 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -964,7 +964,7 @@ nsDOMWindowUtils::SendTouchEventCommon(const nsAString& aType, if (aType.EqualsLiteral("touchstart")) { msg = eTouchStart; } else if (aType.EqualsLiteral("touchmove")) { - msg = NS_TOUCH_MOVE; + msg = eTouchMove; } else if (aType.EqualsLiteral("touchend")) { msg = NS_TOUCH_END; } else if (aType.EqualsLiteral("touchcancel")) { diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index aa58c0079d3..f4eff9841ad 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -576,7 +576,7 @@ TOUCH_EVENT(touchend, EventNameType_All, eTouchEventClass) TOUCH_EVENT(touchmove, - NS_TOUCH_MOVE, + eTouchMove, EventNameType_All, eTouchEventClass ) TOUCH_EVENT(touchcancel, diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 04283ddce10..2cbb44fc9e5 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -1154,7 +1154,7 @@ CrossProcessSafeEvent(const WidgetEvent& aEvent) case eTouchEventClass: switch (aEvent.mMessage) { case eTouchStart: - case NS_TOUCH_MOVE: + case eTouchMove: case NS_TOUCH_END: case NS_TOUCH_CANCEL: return true; diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index a81ff6552a3..d810223fe85 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -4119,7 +4119,7 @@ HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor) } break; case eMouseMove: - case NS_TOUCH_MOVE: + case eTouchMove: if (!mIsDraggingRange) { break; } diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index f92d22036c4..59161378bb5 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -2044,7 +2044,7 @@ TabChild::UpdateTapState(const WidgetTouchEvent& aEvent, nsEventStatus aStatus) LayoutDevicePoint currentPoint = LayoutDevicePoint(trackedTouch->mRefPoint.x, trackedTouch->mRefPoint.y); int64_t time = aEvent.time; switch (aEvent.mMessage) { - case NS_TOUCH_MOVE: + case eTouchMove: if (std::abs(currentPoint.x - mGestureDownPoint.x) > sDragThreshold.width || std::abs(currentPoint.y - mGestureDownPoint.y) > sDragThreshold.height) { CancelTapTracking(); diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 30c078c97fa..3a888119f56 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1856,7 +1856,7 @@ bool TabParent::SendRealTouchEvent(WidgetTouchEvent& event) event.touches[i]->mRefPoint += offset; } - return (event.mMessage == NS_TOUCH_MOVE) ? + return (event.mMessage == eTouchMove) ? PBrowserParent::SendRealTouchMoveEvent(event, guid, blockId, apzResponse) : PBrowserParent::SendRealTouchEvent(event, guid, blockId, apzResponse); } @@ -2989,7 +2989,7 @@ TabParent::InjectTouchEvent(const nsAString& aType, { EventMessage msg; nsContentUtils::GetEventMessageAndAtom(aType, eTouchEventClass, &msg); - if (msg != eTouchStart && msg != NS_TOUCH_MOVE && + if (msg != eTouchStart && msg != eTouchMove && msg != NS_TOUCH_END && 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 b533d405fec..df5a9143831 100644 --- a/gfx/layers/apz/util/APZEventState.cpp +++ b/gfx/layers/apz/util/APZEventState.cpp @@ -292,7 +292,7 @@ APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent, case NS_TOUCH_CANCEL: mActiveElementManager->HandleTouchEndEvent(mEndTouchIsClick); // fall through - case NS_TOUCH_MOVE: { + case eTouchMove: { if (mPendingTouchPreventedResponse) { MOZ_ASSERT(aGuid == mPendingTouchPreventedGuid); } diff --git a/layout/base/AccessibleCaretEventHub.cpp b/layout/base/AccessibleCaretEventHub.cpp index 7b2fd591e72..15903a4218c 100644 --- a/layout/base/AccessibleCaretEventHub.cpp +++ b/layout/base/AccessibleCaretEventHub.cpp @@ -575,10 +575,10 @@ AccessibleCaretEventHub::HandleTouchEvent(WidgetTouchEvent* aEvent) AC_LOGV("After eTouchStart, state: %s, consume: %d", mState->Name(), rv); break; - case NS_TOUCH_MOVE: - AC_LOGV("Before NS_TOUCH_MOVE, state: %s", mState->Name()); + case eTouchMove: + AC_LOGV("Before eTouchMove, state: %s", mState->Name()); rv = mState->OnMove(this, point); - AC_LOGV("After NS_TOUCH_MOVE, state: %s, consume: %d", mState->Name(), rv); + AC_LOGV("After eTouchMove, state: %s, consume: %d", mState->Name(), rv); break; case NS_TOUCH_END: diff --git a/layout/base/SelectionCarets.cpp b/layout/base/SelectionCarets.cpp index 7372f09d37b..326fcd2b761 100644 --- a/layout/base/SelectionCarets.cpp +++ b/layout/base/SelectionCarets.cpp @@ -244,8 +244,7 @@ SelectionCarets::HandleEvent(WidgetEvent* aEvent) } return nsEventStatus_eConsumeNoDefault; } - } else if (aEvent->mMessage == NS_TOUCH_MOVE || - aEvent->mMessage == eMouseMove) { + } else if (aEvent->mMessage == eTouchMove || aEvent->mMessage == eMouseMove) { if (mDragMode == START_FRAME || mDragMode == END_FRAME) { if (mActiveTouchId == nowTouchId) { ptInRoot.y += mCaretCenterToDownPointOffsetY; diff --git a/layout/base/TouchCaret.cpp b/layout/base/TouchCaret.cpp index 61f58bb5b48..246fb8583b6 100644 --- a/layout/base/TouchCaret.cpp +++ b/layout/base/TouchCaret.cpp @@ -772,7 +772,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent) case eMouseUp: status = HandleMouseUpEvent(aEvent->AsMouseEvent()); break; - case NS_TOUCH_MOVE: + case eTouchMove: status = HandleTouchMoveEvent(aEvent->AsTouchEvent()); break; case eMouseMove: @@ -895,7 +895,7 @@ TouchCaret::HandleTouchMoveEvent(WidgetTouchEvent* aEvent) break; case TOUCHCARET_TOUCHDRAG_INACTIVE: - // Consume NS_TOUCH_MOVE event in TOUCHCARET_TOUCHDRAG_INACTIVE state. + // Consume eTouchMove event in TOUCHCARET_TOUCHDRAG_INACTIVE state. status = nsEventStatus_eConsumeNoDefault; break; } diff --git a/layout/base/TouchManager.cpp b/layout/base/TouchManager.cpp index ad2e1d73068..15584ba5743 100644 --- a/layout/base/TouchManager.cpp +++ b/layout/base/TouchManager.cpp @@ -128,7 +128,7 @@ TouchManager::PreHandleEvent(WidgetEvent* aEvent, } break; } - case NS_TOUCH_MOVE: { + case eTouchMove: { // Check for touches that changed. Mark them add to queue WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent(); WidgetTouchEvent::TouchArray& touches = touchEvent->touches; diff --git a/layout/base/gtest/TestAccessibleCaretEventHub.cpp b/layout/base/gtest/TestAccessibleCaretEventHub.cpp index 26c579ad915..feb96669512 100644 --- a/layout/base/gtest/TestAccessibleCaretEventHub.cpp +++ b/layout/base/gtest/TestAccessibleCaretEventHub.cpp @@ -168,7 +168,7 @@ public: static UniquePtr CreateTouchMoveEvent(nscoord aX, nscoord aY) { - return CreateTouchEvent(NS_TOUCH_MOVE, aX, aY); + return CreateTouchEvent(eTouchMove, aX, aY); } static UniquePtr CreateTouchReleaseEvent(nscoord aX, nscoord aY) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index af3fbde179d..271e858452e 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -6677,7 +6677,7 @@ DispatchPointerFromMouseOrTouch(PresShell* aShell, // loop over all touches and dispatch pointer events on each touch // copy the event switch (touchEvent->mMessage) { - case NS_TOUCH_MOVE: + case eTouchMove: pointerMessage = ePointerMove; break; case NS_TOUCH_END: @@ -7478,7 +7478,7 @@ PresShell::HandleEvent(nsIFrame* aFrame, PresShell* shell = static_cast(frame->PresContext()->PresShell()); switch (aEvent->mMessage) { - case NS_TOUCH_MOVE: + case eTouchMove: case NS_TOUCH_CANCEL: case NS_TOUCH_END: { // get the correct shell to dispatch to @@ -8063,7 +8063,7 @@ PresShell::DispatchTouchEventToDOM(WidgetEvent* aEvent, // point prevents mouse events. calling it on the touchend should // prevent click dispatching. bool canPrevent = (aEvent->mMessage == eTouchStart) || - (aEvent->mMessage == NS_TOUCH_MOVE && aTouchIsNew) || + (aEvent->mMessage == eTouchMove && aTouchIsNew) || (aEvent->mMessage == NS_TOUCH_END); bool preventDefault = false; nsEventStatus tmpStatus = nsEventStatus_eIgnore; diff --git a/layout/xul/nsResizerFrame.cpp b/layout/xul/nsResizerFrame.cpp index 3d30703141e..7f47613654e 100644 --- a/layout/xul/nsResizerFrame.cpp +++ b/layout/xul/nsResizerFrame.cpp @@ -143,7 +143,7 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext, } break; - case NS_TOUCH_MOVE: + case eTouchMove: case eMouseMove: { if (mTrackingMouseMove) { diff --git a/layout/xul/nsSliderFrame.cpp b/layout/xul/nsSliderFrame.cpp index 63ac458bf2d..d4e1565a22a 100644 --- a/layout/xul/nsSliderFrame.cpp +++ b/layout/xul/nsSliderFrame.cpp @@ -478,7 +478,7 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext, if (isDraggingThumb()) { switch (aEvent->mMessage) { - case NS_TOUCH_MOVE: + case eTouchMove: case eMouseMove: { nsPoint eventPoint; if (!GetEventPoint(aEvent, eventPoint)) { diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h index 7e70986fa65..bec3306d161 100644 --- a/widget/EventMessageList.h +++ b/widget/EventMessageList.h @@ -371,7 +371,7 @@ NS_EVENT_MESSAGE(eFullscreenError, eFullscreenEventFirst + 1) NS_EVENT_MESSAGE(eTouchEventFirst, 5200) NS_EVENT_MESSAGE(eTouchStart, eTouchEventFirst) -NS_EVENT_MESSAGE(NS_TOUCH_MOVE, eTouchEventFirst + 1) +NS_EVENT_MESSAGE(eTouchMove, eTouchEventFirst + 1) NS_EVENT_MESSAGE(NS_TOUCH_END, eTouchEventFirst + 2) NS_EVENT_MESSAGE(NS_TOUCH_CANCEL, eTouchEventFirst + 3) diff --git a/widget/InputData.cpp b/widget/InputData.cpp index 158aef21674..48e02a8e00c 100644 --- a/widget/InputData.cpp +++ b/widget/InputData.cpp @@ -39,7 +39,7 @@ MultiTouchInput::MultiTouchInput(const WidgetTouchEvent& aTouchEvent) case eTouchStart: mType = MULTITOUCH_START; break; - case NS_TOUCH_MOVE: + case eTouchMove: mType = MULTITOUCH_MOVE; break; case NS_TOUCH_END: @@ -87,7 +87,7 @@ MultiTouchInput::ToWidgetTouchEvent(nsIWidget* aWidget) const touchEventMessage = eTouchStart; break; case MULTITOUCH_MOVE: - touchEventMessage = NS_TOUCH_MOVE; + touchEventMessage = eTouchMove; break; case MULTITOUCH_END: touchEventMessage = NS_TOUCH_END; diff --git a/widget/android/AndroidJavaWrappers.cpp b/widget/android/AndroidJavaWrappers.cpp index 895ec02753d..c942f6b9817 100644 --- a/widget/android/AndroidJavaWrappers.cpp +++ b/widget/android/AndroidJavaWrappers.cpp @@ -710,7 +710,7 @@ AndroidGeckoEvent::MakeTouchEvent(nsIWidget* widget) } } case AndroidMotionEvent::ACTION_MOVE: { - type = NS_TOUCH_MOVE; + type = eTouchMove; break; } case AndroidMotionEvent::ACTION_HOVER_EXIT: { diff --git a/widget/uikit/nsWindow.mm b/widget/uikit/nsWindow.mm index 3452547aba0..49d465dba76 100644 --- a/widget/uikit/nsWindow.mm +++ b/widget/uikit/nsWindow.mm @@ -239,7 +239,9 @@ private: if (!mGeckoChild) return; - [self sendTouchEvent:NS_TOUCH_MOVE touches:[event allTouches] widget:mGeckoChild]; + [self sendTouchEvent:eTouchMove + touches:[event allTouches] + widget:mGeckoChild]; } - (void)setNeedsDisplayInRect:(CGRect)aRect