From 52a7afe36cf224bf02320eb6f2ba092a04547991 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 15 Sep 2015 00:14:35 +0900 Subject: [PATCH] Bug 895274 part.242 Rename NS_TOUCH_MOVE to eTouchMove r=smaug --- dom/base/nsDOMWindowUtils.cpp | 2 +- dom/events/EventNameList.h | 2 +- dom/events/EventStateManager.cpp | 2 +- dom/html/HTMLInputElement.cpp | 2 +- dom/ipc/TabChild.cpp | 2 +- dom/ipc/TabParent.cpp | 4 ++-- gfx/layers/apz/util/APZEventState.cpp | 2 +- layout/base/AccessibleCaretEventHub.cpp | 6 +++--- layout/base/SelectionCarets.cpp | 3 +-- layout/base/TouchCaret.cpp | 4 ++-- layout/base/TouchManager.cpp | 2 +- layout/base/gtest/TestAccessibleCaretEventHub.cpp | 2 +- layout/base/nsPresShell.cpp | 6 +++--- layout/xul/nsResizerFrame.cpp | 2 +- layout/xul/nsSliderFrame.cpp | 2 +- widget/EventMessageList.h | 2 +- widget/InputData.cpp | 4 ++-- widget/android/AndroidJavaWrappers.cpp | 2 +- widget/uikit/nsWindow.mm | 4 +++- 19 files changed, 28 insertions(+), 27 deletions(-) diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 1ff02ecb1ca5..b788670a6993 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 aa58c0079d3d..f4eff9841ada 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 04283ddce101..2cbb44fc9e51 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 a81ff6552a34..d810223fe85d 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 f92d22036c45..59161378bb52 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 30c078c97fa4..3a888119f56a 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 b533d405fec4..df5a91438314 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 7b2fd591e727..15903a4218c4 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 7372f09d37b9..326fcd2b7612 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 61f58bb5b489..246fb8583b63 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 ad2e1d730684..15584ba57431 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 26c579ad9156..feb966695128 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 af3fbde179d3..271e858452e8 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 3d30703141ee..7f47613654e0 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 63ac458bf2d5..d4e1565a22a0 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 7e70986fa657..bec3306d161f 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 158aef216743..48e02a8e00ce 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 895ec02753de..c942f6b9817f 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 3452547aba08..49d465dba761 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