diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index ac3c7784bc..05e4eb27bd 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -842,7 +842,7 @@ nsDOMWindowUtils::SendWheelEvent(float aX, return NS_ERROR_NULL_POINTER; } - WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, widget); + WidgetWheelEvent wheelEvent(true, eWheel, widget); wheelEvent.modifiers = nsContentUtils::GetWidgetModifiers(aModifiers); wheelEvent.deltaX = aDeltaX; wheelEvent.deltaY = aDeltaY; @@ -1943,7 +1943,7 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType, message = eQueryCaretRect; break; case QUERY_TEXT_RECT: - message = NS_QUERY_TEXT_RECT; + message = eQueryTextRect; break; case QUERY_EDITOR_RECT: message = eQueryEditorRect; @@ -1998,7 +1998,7 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType, case eQueryCaretRect: queryEvent.InitForQueryCaretRect(aOffset, useNativeLineBreak); break; - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: queryEvent.InitForQueryTextRect(aOffset, aLength, useNativeLineBreak); break; default: diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index b0e0c09955..71041dc7ad 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -1431,8 +1431,8 @@ nsGlobalWindow::CleanUp() } #ifdef MOZ_B2G - DisableNetworkEvent(NS_NETWORK_UPLOAD_EVENT); - DisableNetworkEvent(NS_NETWORK_DOWNLOAD_EVENT); + DisableNetworkEvent(eNetworkUpload); + DisableNetworkEvent(eNetworkDownload); #endif // MOZ_B2G if (mIdleService) { @@ -14314,13 +14314,13 @@ nsGlobalWindow::EnableNetworkEvent(EventMessage aEventMessage) } switch (aEventMessage) { - case NS_NETWORK_UPLOAD_EVENT: + case eNetworkUpload: if (!mNetworkUploadObserverEnabled) { mNetworkUploadObserverEnabled = true; os->AddObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_UPLOAD_TOPIC, false); } break; - case NS_NETWORK_DOWNLOAD_EVENT: + case eNetworkDownload: if (!mNetworkDownloadObserverEnabled) { mNetworkDownloadObserverEnabled = true; os->AddObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_DOWNLOAD_TOPIC, false); @@ -14342,13 +14342,13 @@ nsGlobalWindow::DisableNetworkEvent(EventMessage aEventMessage) } switch (aEventMessage) { - case NS_NETWORK_UPLOAD_EVENT: + case eNetworkUpload: if (mNetworkUploadObserverEnabled) { mNetworkUploadObserverEnabled = false; os->RemoveObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_UPLOAD_TOPIC); } break; - case NS_NETWORK_DOWNLOAD_EVENT: + case eNetworkDownload: if (mNetworkDownloadObserverEnabled) { mNetworkDownloadObserverEnabled = false; os->RemoveObserver(mObserver, NS_NETWORK_ACTIVITY_BLIP_DOWNLOAD_TOPIC); diff --git a/dom/base/nsQueryContentEventResult.cpp b/dom/base/nsQueryContentEventResult.cpp index 6f3a830652..7ffd2ead03 100644 --- a/dom/base/nsQueryContentEventResult.cpp +++ b/dom/base/nsQueryContentEventResult.cpp @@ -58,7 +58,7 @@ nsQueryContentEventResult::GetTentativeCaretOffset(uint32_t* aOffset) static bool IsRectEnabled(EventMessage aEventMessage) { return aEventMessage == eQueryCaretRect || - aEventMessage == NS_QUERY_TEXT_RECT || + aEventMessage == eQueryTextRect || aEventMessage == eQueryEditorRect || aEventMessage == eQueryCharacterAtPoint; } diff --git a/dom/events/ContentEventHandler.cpp b/dom/events/ContentEventHandler.cpp index 73dd49e2dc..084743070a 100644 --- a/dom/events/ContentEventHandler.cpp +++ b/dom/events/ContentEventHandler.cpp @@ -802,7 +802,7 @@ ContentEventHandler::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent) return OnQueryTextContent(aEvent); case eQueryCaretRect: return OnQueryCaretRect(aEvent); - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: return OnQueryTextRect(aEvent); case eQueryEditorRect: return OnQueryEditorRect(aEvent); @@ -1330,7 +1330,7 @@ ContentEventHandler::OnQueryCharacterAtPoint(WidgetQueryContentEvent* aEvent) GetLineBreakType(aEvent)); NS_ENSURE_SUCCESS(rv, rv); - WidgetQueryContentEvent textRect(true, NS_QUERY_TEXT_RECT, aEvent->widget); + WidgetQueryContentEvent textRect(true, eQueryTextRect, aEvent->widget); textRect.InitForQueryTextRect(offset, 1, aEvent->mUseNativeLineBreak); rv = OnQueryTextRect(&textRect); NS_ENSURE_SUCCESS(rv, rv); diff --git a/dom/events/ContentEventHandler.h b/dom/events/ContentEventHandler.h index a2b1043a63..2707789e4a 100644 --- a/dom/events/ContentEventHandler.h +++ b/dom/events/ContentEventHandler.h @@ -48,7 +48,7 @@ public: nsresult OnQueryTextContent(WidgetQueryContentEvent* aEvent); // eQueryCaretRect event handler nsresult OnQueryCaretRect(WidgetQueryContentEvent* aEvent); - // NS_QUERY_TEXT_RECT event handler + // eQueryTextRect event handler nsresult OnQueryTextRect(WidgetQueryContentEvent* aEvent); // eQueryEditorRect event handler nsresult OnQueryEditorRect(WidgetQueryContentEvent* aEvent); diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index 2cf5a5a89b..0369480452 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -317,13 +317,13 @@ EventListenerManager::AddEventListenerInternal( kAllMutationBits : MutationBitForEventType(aEventMessage)); } } else if (aTypeAtom == nsGkAtoms::ondeviceorientation) { - EnableDevice(NS_DEVICE_ORIENTATION); + EnableDevice(eDeviceOrientation); } else if (aTypeAtom == nsGkAtoms::ondeviceproximity || aTypeAtom == nsGkAtoms::onuserproximity) { - EnableDevice(NS_DEVICE_PROXIMITY); + EnableDevice(eDeviceProximity); } else if (aTypeAtom == nsGkAtoms::ondevicelight) { - EnableDevice(NS_DEVICE_LIGHT); + EnableDevice(eDeviceLight); } else if (aTypeAtom == nsGkAtoms::ondevicemotion) { - EnableDevice(NS_DEVICE_MOTION); + EnableDevice(eDeviceMotion); #ifdef MOZ_B2G } else if (aTypeAtom == nsGkAtoms::onmoztimechange) { nsCOMPtr window = GetTargetAsInnerWindow(); @@ -333,12 +333,12 @@ EventListenerManager::AddEventListenerInternal( } else if (aTypeAtom == nsGkAtoms::onmoznetworkupload) { nsCOMPtr window = GetTargetAsInnerWindow(); if (window) { - window->EnableNetworkEvent(NS_NETWORK_UPLOAD_EVENT); + window->EnableNetworkEvent(eNetworkUpload); } } else if (aTypeAtom == nsGkAtoms::onmoznetworkdownload) { nsCOMPtr window = GetTargetAsInnerWindow(); if (window) { - window->EnableNetworkEvent(NS_NETWORK_DOWNLOAD_EVENT); + window->EnableNetworkEvent(eNetworkDownload); } #endif // MOZ_B2G } else if (aTypeAtom == nsGkAtoms::ontouchstart || @@ -382,8 +382,8 @@ EventListenerManager::AddEventListenerInternal( window->SetHasMouseEnterLeaveEventListeners(); } #ifdef MOZ_GAMEPAD - } else if (aEventMessage >= NS_GAMEPAD_START && - aEventMessage <= NS_GAMEPAD_END) { + } else if (aEventMessage >= eGamepadEventFirst && + aEventMessage <= eGamepadEventLast) { nsPIDOMWindow* window = GetInnerWindowForTarget(); if (window) { window->SetHasGamepadEventListener(); @@ -425,11 +425,11 @@ bool EventListenerManager::IsDeviceType(EventMessage aEventMessage) { switch (aEventMessage) { - case NS_DEVICE_ORIENTATION: - case NS_DEVICE_MOTION: - case NS_DEVICE_LIGHT: - case NS_DEVICE_PROXIMITY: - case NS_USER_PROXIMITY: + case eDeviceOrientation: + case eDeviceMotion: + case eDeviceLight: + case eDeviceProximity: + case eUserProximity: return true; default: break; @@ -446,17 +446,17 @@ EventListenerManager::EnableDevice(EventMessage aEventMessage) } switch (aEventMessage) { - case NS_DEVICE_ORIENTATION: + case eDeviceOrientation: window->EnableDeviceSensor(SENSOR_ORIENTATION); break; - case NS_DEVICE_PROXIMITY: - case NS_USER_PROXIMITY: + case eDeviceProximity: + case eUserProximity: window->EnableDeviceSensor(SENSOR_PROXIMITY); break; - case NS_DEVICE_LIGHT: + case eDeviceLight: window->EnableDeviceSensor(SENSOR_LIGHT); break; - case NS_DEVICE_MOTION: + case eDeviceMotion: window->EnableDeviceSensor(SENSOR_ACCELERATION); window->EnableDeviceSensor(SENSOR_LINEAR_ACCELERATION); window->EnableDeviceSensor(SENSOR_GYROSCOPE); @@ -476,19 +476,19 @@ EventListenerManager::DisableDevice(EventMessage aEventMessage) } switch (aEventMessage) { - case NS_DEVICE_ORIENTATION: + case eDeviceOrientation: window->DisableDeviceSensor(SENSOR_ORIENTATION); break; - case NS_DEVICE_MOTION: + case eDeviceMotion: window->DisableDeviceSensor(SENSOR_ACCELERATION); window->DisableDeviceSensor(SENSOR_LINEAR_ACCELERATION); window->DisableDeviceSensor(SENSOR_GYROSCOPE); break; - case NS_DEVICE_PROXIMITY: - case NS_USER_PROXIMITY: + case eDeviceProximity: + case eUserProximity: window->DisableDeviceSensor(SENSOR_PROXIMITY); break; - case NS_DEVICE_LIGHT: + case eDeviceLight: window->DisableDeviceSensor(SENSOR_LIGHT); break; default: @@ -516,9 +516,9 @@ EventListenerManager::RemoveEventListenerInternal( uint32_t typeCount = 0; bool deviceType = IsDeviceType(aEventMessage); #ifdef MOZ_B2G - bool timeChangeEvent = (aEventMessage == NS_MOZ_TIME_CHANGE_EVENT); - bool networkEvent = (aEventMessage == NS_NETWORK_UPLOAD_EVENT || - aEventMessage == NS_NETWORK_DOWNLOAD_EVENT); + bool timeChangeEvent = (aEventMessage == eTimeChange); + bool networkEvent = (aEventMessage == eNetworkUpload || + aEventMessage == eNetworkDownload); #endif // MOZ_B2G for (uint32_t i = 0; i < count; ++i) { diff --git a/dom/events/EventNameList.h b/dom/events/EventNameList.h index 0233e6c1e5..322a397415 100644 --- a/dom/events/EventNameList.h +++ b/dom/events/EventNameList.h @@ -303,11 +303,11 @@ EVENT(mozfullscreenerror, EventNameType_HTML, eBasicEventClass) EVENT(mozpointerlockchange, - NS_POINTERLOCKCHANGE, + ePointerLockChange, EventNameType_HTML, eBasicEventClass) EVENT(mozpointerlockerror, - NS_POINTERLOCKERROR, + ePointerLockError, EventNameType_HTML, eBasicEventClass) EVENT(pointerdown, @@ -426,7 +426,7 @@ EVENT(waiting, EventNameType_HTML, eBasicEventClass) EVENT(wheel, - NS_WHEEL_WHEEL, + eWheel, EventNameType_All, eWheelEventClass) EVENT(copy, @@ -477,11 +477,11 @@ FORWARDED_EVENT(scroll, eBasicEventClass) WINDOW_EVENT(afterprint, - NS_AFTERPRINT, + eAfterPrint, EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly, eBasicEventClass) WINDOW_EVENT(beforeprint, - NS_BEFOREPRINT, + eBeforePrint, EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly, eBasicEventClass) BEFOREUNLOAD_EVENT(beforeunload, @@ -536,37 +536,37 @@ WINDOW_EVENT(unload, eBasicEventClass) WINDOW_ONLY_EVENT(devicemotion, - NS_DEVICE_MOTION, + eDeviceMotion, EventNameType_None, eBasicEventClass) WINDOW_ONLY_EVENT(deviceorientation, - NS_DEVICE_ORIENTATION, + eDeviceOrientation, EventNameType_None, eBasicEventClass) WINDOW_ONLY_EVENT(deviceproximity, - NS_DEVICE_PROXIMITY, + eDeviceProximity, EventNameType_None, eBasicEventClass) WINDOW_ONLY_EVENT(userproximity, - NS_USER_PROXIMITY, + eUserProximity, EventNameType_None, eBasicEventClass) WINDOW_ONLY_EVENT(devicelight, - NS_DEVICE_LIGHT, + eDeviceLight, EventNameType_None, eBasicEventClass) #ifdef MOZ_B2G WINDOW_ONLY_EVENT(moztimechange, - NS_MOZ_TIME_CHANGE_EVENT, + eTimeChange, EventNameType_None, eBasicEventClass) WINDOW_ONLY_EVENT(moznetworkupload, - NS_NETWORK_UPLOAD_EVENT, + eNetworkUpload, EventNameType_None, eBasicEventClass) WINDOW_ONLY_EVENT(moznetworkdownload, - NS_NETWORK_DOWNLOAD_EVENT, + eNetworkDownload, EventNameType_None, eBasicEventClass) #endif // MOZ_B2G @@ -593,11 +593,11 @@ DOCUMENT_ONLY_EVENT(readystatechange, EventNameType_HTMLXUL, eBasicEventClass) DOCUMENT_ONLY_EVENT(selectionchange, - NS_SELECTION_CHANGE, + eSelectionChange, EventNameType_HTMLXUL, eBasicEventClass) DOCUMENT_ONLY_EVENT(visibilitychange, - NS_VISIBILITY_CHANGE, + eVisibilityChange, EventNameType_HTMLXUL, eBasicEventClass) @@ -688,19 +688,19 @@ NON_IDL_EVENT(speakerforcedchange, // This shouldn't be used by web/xul apps. "compositionupdate" should be // used instead. NON_IDL_EVENT(text, - NS_COMPOSITION_CHANGE, + eCompositionChange, EventNameType_XUL, eCompositionEventClass) NON_IDL_EVENT(compositionstart, - NS_COMPOSITION_START, + eCompositionStart, EventNameType_XUL, eCompositionEventClass) NON_IDL_EVENT(compositionupdate, - NS_COMPOSITION_UPDATE, + eCompositionUpdate, EventNameType_XUL, eCompositionEventClass) NON_IDL_EVENT(compositionend, - NS_COMPOSITION_END, + eCompositionEnd, EventNameType_XUL, eCompositionEventClass) NON_IDL_EVENT(command, @@ -748,11 +748,11 @@ NON_IDL_EVENT(draggesture, EventNameType_XUL, eDragEventClass) NON_IDL_EVENT(overflow, - NS_SCROLLPORT_OVERFLOW, + eScrollPortOverflow, EventNameType_XUL, eBasicEventClass) NON_IDL_EVENT(underflow, - NS_SCROLLPORT_UNDERFLOW, + eScrollPortUnderflow, EventNameType_XUL, eBasicEventClass) @@ -790,34 +790,34 @@ NON_IDL_EVENT(zoom, // Only map the ID to the real event name when MESSAGE_TO_EVENT is defined. #ifndef MESSAGE_TO_EVENT NON_IDL_EVENT(begin, - NS_SMIL_BEGIN, + eSMILBeginEvent, EventNameType_SMIL, eBasicEventClass) #endif NON_IDL_EVENT(beginEvent, - NS_SMIL_BEGIN, + eSMILBeginEvent, EventNameType_None, eSMILTimeEventClass) // Only map the ID to the real event name when MESSAGE_TO_EVENT is defined. #ifndef MESSAGE_TO_EVENT NON_IDL_EVENT(end, - NS_SMIL_END, + eSMILEndEvent, EventNameType_SMIL, eBasicEventClass) #endif NON_IDL_EVENT(endEvent, - NS_SMIL_END, + eSMILEndEvent, EventNameType_None, eSMILTimeEventClass) // Only map the ID to the real event name when MESSAGE_TO_EVENT is defined. #ifndef MESSAGE_TO_EVENT NON_IDL_EVENT(repeat, - NS_SMIL_REPEAT, + eSMILRepeatEvent, EventNameType_SMIL, eBasicEventClass) #endif NON_IDL_EVENT(repeatEvent, - NS_SMIL_REPEAT, + eSMILRepeatEvent, EventNameType_None, eSMILTimeEventClass) @@ -827,29 +827,29 @@ NON_IDL_EVENT(MozAfterPaint, eBasicEventClass) NON_IDL_EVENT(MozScrolledAreaChanged, - NS_SCROLLEDAREACHANGED, + eScrolledAreaChanged, EventNameType_None, eScrollAreaEventClass) #ifdef MOZ_GAMEPAD NON_IDL_EVENT(gamepadbuttondown, - NS_GAMEPAD_BUTTONDOWN, + eGamepadButtonDown, EventNameType_None, eBasicEventClass) NON_IDL_EVENT(gamepadbuttonup, - NS_GAMEPAD_BUTTONUP, + eGamepadButtonUp, EventNameType_None, eBasicEventClass) NON_IDL_EVENT(gamepadaxismove, - NS_GAMEPAD_AXISMOVE, + eGamepadAxisMove, EventNameType_None, eBasicEventClass) NON_IDL_EVENT(gamepadconnected, - NS_GAMEPAD_CONNECTED, + eGamepadConnected, EventNameType_None, eBasicEventClass) NON_IDL_EVENT(gamepaddisconnected, - NS_GAMEPAD_DISCONNECTED, + eGamepadDisconnected, EventNameType_None, eBasicEventClass) #endif diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index be8f20b308..be62b0edb5 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -519,7 +519,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, nsCOMPtr node = do_QueryInterface(aTargetContent); if (node && (aEvent->mMessage == eKeyUp || aEvent->mMessage == eMouseUp || - aEvent->mMessage == NS_WHEEL_WHEEL || aEvent->mMessage == NS_TOUCH_END || + aEvent->mMessage == eWheel || aEvent->mMessage == NS_TOUCH_END || aEvent->mMessage == ePointerUp)) { nsIDocument* doc = node->OwnerDoc(); while (doc && !doc->UserHasInteracted()) { @@ -727,9 +727,9 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, keyEvent->mIsComposing = !!composition; } break; - case NS_WHEEL_WHEEL: - case NS_WHEEL_START: - case NS_WHEEL_STOP: + case eWheel: + case eWheelOperationStart: + case eWheelOperationEnd: { NS_ASSERTION(aEvent->mFlags.mIsTrusted, "Untrusted wheel event shouldn't be here"); @@ -739,7 +739,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, mCurrentTargetContent = content; } - if (aEvent->mMessage != NS_WHEEL_WHEEL) { + if (aEvent->mMessage != eWheel) { break; } @@ -775,7 +775,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, case eContentCommandScroll: DoContentCommandScrollEvent(aEvent->AsContentCommandEvent()); break; - case NS_COMPOSITION_START: + case eCompositionStart: if (aEvent->mFlags.mIsTrusted) { // If the event is trusted event, set the selected text to data of // composition event. @@ -800,7 +800,7 @@ EventStateManager::HandleQueryContentEvent(WidgetQueryContentEvent* aEvent) case eQuerySelectedText: case eQueryTextContent: case eQueryCaretRect: - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: case eQueryEditorRect: if (!IsTargetCrossProcess(aEvent)) { break; @@ -2579,7 +2579,7 @@ EventStateManager::DecideGestureEvent(WidgetGestureNotifyEvent* aEvent, nsIFrame* targetFrame) { - NS_ASSERTION(aEvent->mMessage == NS_GESTURENOTIFY_EVENT_START, + NS_ASSERTION(aEvent->mMessage == eGestureNotify, "DecideGestureEvent called with a non-gesture event"); /* Check the ancestor tree to decide if any frame is willing* to receive @@ -3024,7 +3024,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, } } break; - case NS_WHEEL_STOP: + case eWheelOperationEnd: { MOZ_ASSERT(aEvent->mFlags.mIsTrusted); ScrollbarsForWheel::MayInactivate(); @@ -3037,8 +3037,8 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, } } break; - case NS_WHEEL_WHEEL: - case NS_WHEEL_START: + case eWheel: + case eWheelOperationStart: { MOZ_ASSERT(aEvent->mFlags.mIsTrusted); @@ -3064,7 +3064,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, ScrollbarsForWheel::PrepareToScrollText(this, aTargetFrame, wheelEvent); - if (aEvent->mMessage != NS_WHEEL_WHEEL || + if (aEvent->mMessage != eWheel || (!wheelEvent->deltaX && !wheelEvent->deltaY)) { break; } @@ -3149,7 +3149,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, } break; - case NS_GESTURENOTIFY_EVENT_START: + case eGestureNotify: { if (nsEventStatus_eConsumeNoDefault != *aStatus) { DecideGestureEvent(aEvent->AsGestureNotifyEvent(), mCurrentTarget); @@ -5596,7 +5596,8 @@ EventStateManager::WheelPrefs::HasUserPrefsForDelta(WidgetWheelEvent* aEvent) bool EventStateManager::WheelEventIsScrollAction(WidgetWheelEvent* aEvent) { - return WheelPrefs::GetInstance()->ComputeActionFor(aEvent) == WheelPrefs::ACTION_SCROLL; + return aEvent->mMessage == eWheel && + WheelPrefs::GetInstance()->ComputeActionFor(aEvent) == WheelPrefs::ACTION_SCROLL; } bool diff --git a/dom/events/IMEContentObserver.cpp b/dom/events/IMEContentObserver.cpp index 019d5d6c6e..4f1fcd8475 100644 --- a/dom/events/IMEContentObserver.cpp +++ b/dom/events/IMEContentObserver.cpp @@ -57,8 +57,8 @@ ToChar(EventMessage aEventMessage) return "eQueryTextContent"; case eQueryCaretRect: return "eQueryCaretRect"; - case NS_QUERY_TEXT_RECT: - return "NS_QUERY_TEXT_RECT"; + case eQueryTextRect: + return "eQueryTextRect"; case eQueryEditorRect: return "eQueryEditorRect"; case eQueryContentState: diff --git a/dom/events/IMEStateManager.cpp b/dom/events/IMEStateManager.cpp index d9231f6d11..fa07deffe9 100644 --- a/dom/events/IMEStateManager.cpp +++ b/dom/events/IMEStateManager.cpp @@ -137,18 +137,18 @@ static const char* GetEventMessageName(EventMessage aMessage) { switch (aMessage) { - case NS_COMPOSITION_START: - return "NS_COMPOSITION_START"; - case NS_COMPOSITION_END: - return "NS_COMPOSITION_END"; - case NS_COMPOSITION_UPDATE: - return "NS_COMPOSITION_UPDATE"; - case NS_COMPOSITION_CHANGE: - return "NS_COMPOSITION_CHANGE"; - case NS_COMPOSITION_COMMIT_AS_IS: - return "NS_COMPOSITION_COMMIT_AS_IS"; - case NS_COMPOSITION_COMMIT: - return "NS_COMPOSITION_COMMIT"; + case eCompositionStart: + return "eCompositionStart"; + case eCompositionEnd: + return "eCompositionEnd"; + case eCompositionUpdate: + return "eCompositionUpdate"; + case eCompositionChange: + return "eCompositionChange"; + case eCompositionCommitAsIs: + return "eCompositionCommitAsIs"; + case eCompositionCommit: + return "eCompositionCommit"; case eSetSelection: return "eSetSelection"; default: @@ -1147,7 +1147,7 @@ IMEStateManager::DispatchCompositionEvent( return; } - MOZ_ASSERT(aCompositionEvent->mMessage != NS_COMPOSITION_UPDATE, + MOZ_ASSERT(aCompositionEvent->mMessage != eCompositionUpdate, "compositionupdate event shouldn't be dispatched manually"); EnsureTextCompositionArray(); @@ -1163,7 +1163,7 @@ IMEStateManager::DispatchCompositionEvent( MOZ_LOG(sISMLog, LogLevel::Debug, ("ISM: IMEStateManager::DispatchCompositionEvent(), " "adding new TextComposition to the array")); - MOZ_ASSERT(aCompositionEvent->mMessage == NS_COMPOSITION_START); + MOZ_ASSERT(aCompositionEvent->mMessage == eCompositionStart); composition = new TextComposition(aPresContext, aEventTargetNode, tabParent, aCompositionEvent); @@ -1171,7 +1171,7 @@ IMEStateManager::DispatchCompositionEvent( } #ifdef DEBUG else { - MOZ_ASSERT(aCompositionEvent->mMessage != NS_COMPOSITION_START); + MOZ_ASSERT(aCompositionEvent->mMessage != eCompositionStart); } #endif // #ifdef DEBUG @@ -1277,7 +1277,7 @@ IMEStateManager::OnCompositionEventDiscarded( // Ignore compositionstart for now because sTextCompositions may not have // been created yet. - if (aCompositionEvent->mMessage == NS_COMPOSITION_START) { + if (aCompositionEvent->mMessage == eCompositionStart) { return; } diff --git a/dom/events/TextComposition.cpp b/dom/events/TextComposition.cpp index 79458fd5e5..b8c3d8d757 100644 --- a/dom/events/TextComposition.cpp +++ b/dom/events/TextComposition.cpp @@ -93,7 +93,7 @@ TextComposition::MaybeDispatchCompositionUpdate( if (mLastData == aCompositionEvent->mData) { return true; } - CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_UPDATE); + CloneAndDispatchAs(aCompositionEvent, eCompositionUpdate); return IsValidStateForComposition(aCompositionEvent->widget); } @@ -120,7 +120,7 @@ TextComposition::CloneAndDispatchAs( nsEventStatus dummyStatus = nsEventStatus_eConsumeNoDefault; nsEventStatus* status = aStatus ? aStatus : &dummyStatus; - if (aMessage == NS_COMPOSITION_UPDATE) { + if (aMessage == eCompositionUpdate) { mLastData = compositionEvent.mData; } EventDispatcher::Dispatch(mNode, mPresContext, @@ -234,12 +234,12 @@ TextComposition::DispatchCompositionEvent( RemoveControlCharactersFrom(aCompositionEvent->mData, aCompositionEvent->mRanges); } - if (aCompositionEvent->mMessage == NS_COMPOSITION_COMMIT_AS_IS) { + if (aCompositionEvent->mMessage == eCompositionCommitAsIs) { NS_ASSERTION(!aCompositionEvent->mRanges, - "mRanges of NS_COMPOSITION_COMMIT_AS_IS should be null"); + "mRanges of eCompositionCommitAsIs should be null"); aCompositionEvent->mRanges = nullptr; NS_ASSERTION(aCompositionEvent->mData.IsEmpty(), - "mData of NS_COMPOSITION_COMMIT_AS_IS should be empty string"); + "mData of eCompositionCommitAsIs should be empty string"); if (mLastData == IDEOGRAPHIC_SPACE) { // If the last data is an ideographic space (FullWidth space), it must be // a placeholder character of some Chinese IME. So, committing with @@ -248,9 +248,9 @@ TextComposition::DispatchCompositionEvent( } else { aCompositionEvent->mData = mLastData; } - } else if (aCompositionEvent->mMessage == NS_COMPOSITION_COMMIT) { + } else if (aCompositionEvent->mMessage == eCompositionCommit) { NS_ASSERTION(!aCompositionEvent->mRanges, - "mRanges of NS_COMPOSITION_COMMIT should be null"); + "mRanges of eCompositionCommit should be null"); aCompositionEvent->mRanges = nullptr; } @@ -284,10 +284,10 @@ TextComposition::DispatchCompositionEvent( if (!aIsSynthesized && (mIsRequestingCommit || mIsRequestingCancel)) { nsString* committingData = nullptr; switch (aCompositionEvent->mMessage) { - case NS_COMPOSITION_END: - case NS_COMPOSITION_CHANGE: - case NS_COMPOSITION_COMMIT_AS_IS: - case NS_COMPOSITION_COMMIT: + case eCompositionEnd: + case eCompositionChange: + case eCompositionCommitAsIs: + case eCompositionCommit: committingData = &aCompositionEvent->mData; break; default: @@ -309,20 +309,20 @@ TextComposition::DispatchCompositionEvent( bool dispatchDOMTextEvent = aCompositionEvent->CausesDOMTextEvent(); // When mIsComposing is false but the committing string is different from - // the last data (E.g., previous NS_COMPOSITION_CHANGE event made the + // the last data (E.g., previous eCompositionChange event made the // composition string empty or didn't have clause information), we don't // need to dispatch redundant DOM text event. if (dispatchDOMTextEvent && - aCompositionEvent->mMessage != NS_COMPOSITION_CHANGE && + aCompositionEvent->mMessage != eCompositionChange && !mIsComposing && mLastData == aCompositionEvent->mData) { dispatchEvent = dispatchDOMTextEvent = false; } - // widget may dispatch redundant NS_COMPOSITION_CHANGE event + // widget may dispatch redundant eCompositionChange event // which modifies neither composition string, clauses nor caret // position. In such case, we shouldn't dispatch DOM events. if (dispatchDOMTextEvent && - aCompositionEvent->mMessage == NS_COMPOSITION_CHANGE && + aCompositionEvent->mMessage == eCompositionChange && mLastData == aCompositionEvent->mData && mRanges && aCompositionEvent->mRanges && mRanges->Equals(*aCompositionEvent->mRanges)) { @@ -337,13 +337,13 @@ TextComposition::DispatchCompositionEvent( if (dispatchEvent) { // If the composition event should cause a DOM text event, we should - // overwrite the event message as NS_COMPOSITION_CHANGE because due to + // overwrite the event message as eCompositionChange because due to // the limitation of mapping between event messages and DOM event types, // we cannot map multiple event messages to a DOM event type. if (dispatchDOMTextEvent && - aCompositionEvent->mMessage != NS_COMPOSITION_CHANGE) { + aCompositionEvent->mMessage != eCompositionChange) { aCompositionEvent->mFlags = - CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_CHANGE, + CloneAndDispatchAs(aCompositionEvent, eCompositionChange, aStatus, aCallBack); } else { EventDispatcher::Dispatch(mNode, mPresContext, @@ -366,8 +366,8 @@ TextComposition::DispatchCompositionEvent( if (aCompositionEvent->CausesDOMCompositionEndEvent()) { // Dispatch a compositionend event if it's necessary. - if (aCompositionEvent->mMessage != NS_COMPOSITION_END) { - CloneAndDispatchAs(aCompositionEvent, NS_COMPOSITION_END); + if (aCompositionEvent->mMessage != eCompositionEnd) { + CloneAndDispatchAs(aCompositionEvent, eCompositionEnd); } MOZ_ASSERT(!mIsComposing, "Why is the editor still composing?"); MOZ_ASSERT(!HasEditor(), "Why does the editor still keep to hold this?"); @@ -412,7 +412,7 @@ TextComposition::NotityUpdateComposition( // When compositon start, notify the rect of first offset character. // When not compositon start, notify the rect of selected composition // string if compositionchange event. - if (aCompositionEvent->mMessage == NS_COMPOSITION_START) { + if (aCompositionEvent->mMessage == eCompositionStart) { nsCOMPtr widget = mPresContext->GetRootWidget(); // Update composition start offset WidgetQueryContentEvent selectedTextEvent(true, eQuerySelectedText, widget); @@ -490,10 +490,10 @@ TextComposition::RequestToCommit(nsIWidget* aWidget, bool aDiscard) // Otherwise, synthesize the commit in content. nsAutoString data(aDiscard ? EmptyString() : lastData); if (data == mLastData) { - DispatchCompositionEventRunnable(NS_COMPOSITION_COMMIT_AS_IS, EmptyString(), + DispatchCompositionEventRunnable(eCompositionCommitAsIs, EmptyString(), true); } else { - DispatchCompositionEventRunnable(NS_COMPOSITION_COMMIT, data, true); + DispatchCompositionEventRunnable(eCompositionCommit, data, true); } return NS_OK; } @@ -611,8 +611,8 @@ TextComposition::CompositionEventDispatcher::Run() nsRefPtr presContext = mTextComposition->mPresContext; nsEventStatus status = nsEventStatus_eIgnore; switch (mEventMessage) { - case NS_COMPOSITION_START: { - WidgetCompositionEvent compStart(true, NS_COMPOSITION_START, widget); + case eCompositionStart: { + WidgetCompositionEvent compStart(true, eCompositionStart, widget); WidgetQueryContentEvent selectedText(true, eQuerySelectedText, widget); ContentEventHandler handler(presContext); handler.OnQuerySelectedText(&selectedText); @@ -625,11 +625,11 @@ TextComposition::CompositionEventDispatcher::Run() mIsSynthesizedEvent); break; } - case NS_COMPOSITION_CHANGE: - case NS_COMPOSITION_COMMIT_AS_IS: - case NS_COMPOSITION_COMMIT: { + case eCompositionChange: + case eCompositionCommitAsIs: + case eCompositionCommit: { WidgetCompositionEvent compEvent(true, mEventMessage, widget); - if (mEventMessage != NS_COMPOSITION_COMMIT_AS_IS) { + if (mEventMessage != eCompositionCommitAsIs) { compEvent.mData = mData; } compEvent.mFlags.mIsSynthesizedForTests = diff --git a/dom/events/WheelHandlingHelper.cpp b/dom/events/WheelHandlingHelper.cpp index 79bb04503e..136fdf8583 100644 --- a/dom/events/WheelHandlingHelper.cpp +++ b/dom/events/WheelHandlingHelper.cpp @@ -94,7 +94,7 @@ WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame, WidgetWheelEvent* aEvent) { NS_ASSERTION(!sTargetFrame, "previous transaction is not finished!"); - MOZ_ASSERT(aEvent->mMessage == NS_WHEEL_WHEEL, + MOZ_ASSERT(aEvent->mMessage == eWheel, "Transaction must be started with a wheel event"); ScrollbarsForWheel::OwnWheelTransaction(false); sTargetFrame = aTargetFrame; @@ -176,7 +176,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent) } switch (aEvent->mMessage) { - case NS_WHEEL_WHEEL: + case eWheel: if (sMouseMoved != 0 && OutOfTime(sMouseMoved, GetIgnoreMoveDelayTime())) { // Terminate the current mousewheel transaction if the mouse moved more @@ -415,7 +415,7 @@ ScrollbarsForWheel::PrepareToScrollText(EventStateManager* aESM, nsIFrame* aTargetFrame, WidgetWheelEvent* aEvent) { - if (aEvent->mMessage == NS_WHEEL_START) { + if (aEvent->mMessage == eWheelOperationStart) { WheelTransaction::OwnScrollbars(false); if (!IsActive()) { TemporarilyActivateAllPossibleScrollTargets(aESM, aTargetFrame, aEvent); diff --git a/dom/events/WheelHandlingHelper.h b/dom/events/WheelHandlingHelper.h index 115cb89e42..4b37eb0434 100644 --- a/dom/events/WheelHandlingHelper.h +++ b/dom/events/WheelHandlingHelper.h @@ -95,8 +95,8 @@ protected: /** - * These two methods are called upon NS_WHEEL_START/NS_WHEEL_STOP events - * to show/hide the right scrollbars. + * These two methods are called upon eWheelOperationStart/eWheelOperationEnd + * events to show/hide the right scrollbars. */ static void TemporarilyActivateAllPossibleScrollTargets( EventStateManager* aESM, diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index 245307b1c3..b2ca1b024d 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -3023,8 +3023,8 @@ HTMLInputElement::NeedToInitializeEditorForEvent( case eMouseExitFromWidget: case eMouseOver: case eMouseOut: - case NS_SCROLLPORT_UNDERFLOW: - case NS_SCROLLPORT_OVERFLOW: + case eScrollPortUnderflow: + case eScrollPortOverflow: return false; default: return true; diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp index 5e7d8a1165..88dfac1a80 100644 --- a/dom/html/nsGenericHTMLElement.cpp +++ b/dom/html/nsGenericHTMLElement.cpp @@ -2457,7 +2457,7 @@ nsGenericHTMLFormElement::IsElementDisabledForEvents(EventMessage aMessage, case ePointerOut: case ePointerEnter: case ePointerLeave: - case NS_WHEEL_WHEEL: + case eWheel: case eLegacyMouseLineOrPageScroll: case eLegacyMousePixelScroll: return false; diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 432cca970c..c53d58952e 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -2333,7 +2333,7 @@ TabParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent) return true; } switch (aEvent.mMessage) { - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: case eQueryCaretRect: case eQueryEditorRect: aEvent.mReply.mRect -= GetChildProcessOffset(); diff --git a/dom/smil/nsSMILTimedElement.cpp b/dom/smil/nsSMILTimedElement.cpp index 2858c21e08..082a5f906c 100644 --- a/dom/smil/nsSMILTimedElement.cpp +++ b/dom/smil/nsSMILTimedElement.cpp @@ -643,7 +643,7 @@ nsSMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly) mClient->Activate(mCurrentInterval->Begin()->Time().GetMillis()); } if (mSeekState == SEEK_NOT_SEEKING) { - FireTimeEventAsync(NS_SMIL_BEGIN, 0); + FireTimeEventAsync(eSMILBeginEvent, 0); } if (HasPlayed()) { Reset(); // Apply restart behaviour @@ -679,7 +679,7 @@ nsSMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly) } mCurrentInterval->FixEnd(); if (mSeekState == SEEK_NOT_SEEKING) { - FireTimeEventAsync(NS_SMIL_END, 0); + FireTimeEventAsync(eSMILEndEvent, 0); } mCurrentRepeatIteration = 0; mOldIntervals.AppendElement(mCurrentInterval.forget()); @@ -727,7 +727,7 @@ nsSMILTimedElement::DoSampleAt(nsSMILTime aContainerTime, bool aEndOnly) mCurrentRepeatIteration != prevRepeatIteration && mCurrentRepeatIteration && mSeekState == SEEK_NOT_SEEKING) { - FireTimeEventAsync(NS_SMIL_REPEAT, + FireTimeEventAsync(eSMILRepeatEvent, static_cast(mCurrentRepeatIteration)); } } @@ -1518,14 +1518,14 @@ nsSMILTimedElement::DoPostSeek() case SEEK_FORWARD_FROM_ACTIVE: case SEEK_BACKWARD_FROM_ACTIVE: if (mElementState != STATE_ACTIVE) { - FireTimeEventAsync(NS_SMIL_END, 0); + FireTimeEventAsync(eSMILEndEvent, 0); } break; case SEEK_FORWARD_FROM_INACTIVE: case SEEK_BACKWARD_FROM_INACTIVE: if (mElementState == STATE_ACTIVE) { - FireTimeEventAsync(NS_SMIL_BEGIN, 0); + FireTimeEventAsync(eSMILBeginEvent, 0); } break; diff --git a/editor/libeditor/nsEditor.cpp b/editor/libeditor/nsEditor.cpp index 7abebd5113..01e71e3736 100644 --- a/editor/libeditor/nsEditor.cpp +++ b/editor/libeditor/nsEditor.cpp @@ -261,7 +261,7 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIContent *aRoot, // recreated with same content. Therefore, we need to forget mIMETextNode, // but we need to keep storing mIMETextOffset and mIMETextLength becuase // they are necessary to restore IME selection and replacing composing string - // when this receives NS_COMPOSITION_CHANGE event next time. + // when this receives eCompositionChange event next time. if (mIMETextNode && !mIMETextNode->IsInComposedDoc()) { mIMETextNode = nullptr; } @@ -5126,11 +5126,11 @@ nsEditor::IsAcceptableInputEvent(nsIDOMEvent* aEvent) // If events are not created with proper event interface, their message // are initialized with eUnidentifiedEvent. Let's ignore such event. return false; - case NS_COMPOSITION_START: - case NS_COMPOSITION_END: - case NS_COMPOSITION_UPDATE: - case NS_COMPOSITION_CHANGE: - case NS_COMPOSITION_COMMIT_AS_IS: + case eCompositionStart: + case eCompositionEnd: + case eCompositionUpdate: + case eCompositionChange: + case eCompositionCommitAsIs: // Don't allow composition events whose internal event are not // WidgetCompositionEvent. widgetGUIEvent = aEvent->GetInternalNSEvent()->AsCompositionEvent(); diff --git a/editor/libeditor/nsEditorEventListener.cpp b/editor/libeditor/nsEditorEventListener.cpp index 470a5db7de..433cd1b237 100644 --- a/editor/libeditor/nsEditorEventListener.cpp +++ b/editor/libeditor/nsEditorEventListener.cpp @@ -460,13 +460,13 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent) case eBlur: return Blur(aEvent); // text - case NS_COMPOSITION_CHANGE: + case eCompositionChange: return HandleText(aEvent); // compositionstart - case NS_COMPOSITION_START: + case eCompositionStart: return HandleStartComposition(aEvent); // compositionend - case NS_COMPOSITION_END: + case eCompositionEnd: HandleEndComposition(aEvent); return NS_OK; default: diff --git a/editor/libeditor/nsPlaintextEditor.cpp b/editor/libeditor/nsPlaintextEditor.cpp index c3e5ce13a3..67df3e24a4 100644 --- a/editor/libeditor/nsPlaintextEditor.cpp +++ b/editor/libeditor/nsPlaintextEditor.cpp @@ -845,8 +845,8 @@ nsPlaintextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent) WidgetCompositionEvent* compositionChangeEvent = aDOMTextEvent->GetInternalNSEvent()->AsCompositionEvent(); NS_ENSURE_TRUE(compositionChangeEvent, NS_ERROR_INVALID_ARG); - MOZ_ASSERT(compositionChangeEvent->mMessage == NS_COMPOSITION_CHANGE, - "The internal event should be NS_COMPOSITION_CHANGE"); + MOZ_ASSERT(compositionChangeEvent->mMessage == eCompositionChange, + "The internal event should be eCompositionChange"); EnsureComposition(compositionChangeEvent); diff --git a/layout/base/AccessibleCaretEventHub.cpp b/layout/base/AccessibleCaretEventHub.cpp index 6fd3576d87..c0f908b2f6 100644 --- a/layout/base/AccessibleCaretEventHub.cpp +++ b/layout/base/AccessibleCaretEventHub.cpp @@ -534,19 +534,19 @@ nsEventStatus AccessibleCaretEventHub::HandleWheelEvent(WidgetWheelEvent* aEvent) { switch (aEvent->mMessage) { - case NS_WHEEL_WHEEL: - AC_LOGV("NS_WHEEL_WHEEL, isMomentum %d, state: %s", aEvent->isMomentum, + case eWheel: + AC_LOGV("eWheel, isMomentum %d, state: %s", aEvent->isMomentum, mState->Name()); mState->OnScrolling(this); break; - case NS_WHEEL_START: - AC_LOGV("NS_WHEEL_START, state: %s", mState->Name()); + case eWheelOperationStart: + AC_LOGV("eWheelOperationStart, state: %s", mState->Name()); mState->OnScrollStart(this); break; - case NS_WHEEL_STOP: - AC_LOGV("NS_WHEEL_STOP, state: %s", mState->Name()); + case eWheelOperationEnd: + AC_LOGV("eWheelOperationEnd, state: %s", mState->Name()); mState->OnScrollEnd(this); break; diff --git a/layout/base/TouchCaret.cpp b/layout/base/TouchCaret.cpp index fca14eb105..c180963b08 100644 --- a/layout/base/TouchCaret.cpp +++ b/layout/base/TouchCaret.cpp @@ -788,9 +788,9 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent) case eKeyUp: case eKeyDown: case eKeyPress: - case NS_WHEEL_WHEEL: - case NS_WHEEL_START: - case NS_WHEEL_STOP: + case eWheel: + case eWheelOperationStart: + case eWheelOperationEnd: // Disable touch caret while key/wheel event is received. TOUCHCARET_LOG("Receive key/wheel event %d", aEvent->mMessage); SetVisibility(false); diff --git a/layout/base/gtest/TestAccessibleCaretEventHub.cpp b/layout/base/gtest/TestAccessibleCaretEventHub.cpp index 39866a64c6..25fbdacd2b 100644 --- a/layout/base/gtest/TestAccessibleCaretEventHub.cpp +++ b/layout/base/gtest/TestAccessibleCaretEventHub.cpp @@ -732,22 +732,22 @@ TEST_F(AccessibleCaretEventHubTester, TestWheelEventScroll) check.Call("1"); - HandleEventAndCheckState(CreateWheelEvent(NS_WHEEL_START), + HandleEventAndCheckState(CreateWheelEvent(eWheelOperationStart), MockAccessibleCaretEventHub::ScrollState(), nsEventStatus_eIgnore); - HandleEventAndCheckState(CreateWheelEvent(NS_WHEEL_WHEEL), + HandleEventAndCheckState(CreateWheelEvent(eWheel), MockAccessibleCaretEventHub::ScrollState(), nsEventStatus_eIgnore); mHub->ScrollPositionChanged(); - HandleEventAndCheckState(CreateWheelEvent(NS_WHEEL_STOP), + HandleEventAndCheckState(CreateWheelEvent(eWheelOperationEnd), MockAccessibleCaretEventHub::PostScrollState(), nsEventStatus_eIgnore); // Momentum scroll - HandleEventAndCheckState(CreateWheelEvent(NS_WHEEL_WHEEL), + HandleEventAndCheckState(CreateWheelEvent(eWheel), MockAccessibleCaretEventHub::PostScrollState(), nsEventStatus_eIgnore); diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index e074b04b1f..e430cbe79a 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -476,7 +476,7 @@ public: // will return a real frame and we don't have to worry about // destroying it by flushing later. mPresShell->FlushPendingNotifications(Flush_Layout); - } else if (aVisitor.mEvent->mMessage == NS_WHEEL_WHEEL && + } else if (aVisitor.mEvent->mMessage == eWheel && aVisitor.mEventStatus != nsEventStatus_eConsumeNoDefault) { nsIFrame* frame = mPresShell->GetCurrentEventFrame(); if (frame) { diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index eebfda50ae..3dd377f47f 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3731,7 +3731,7 @@ ScrollFrameHelper::FireScrollPortEvent() InternalScrollPortEvent event(true, (orient == InternalScrollPortEvent::horizontal ? mHorizontalOverflow : mVerticalOverflow) ? - NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW, nullptr); + eScrollPortOverflow : eScrollPortUnderflow, nullptr); event.orient = orient; return EventDispatcher::Dispatch(mOuter->GetContent(), mOuter->PresContext(), &event); @@ -5280,7 +5280,7 @@ ScrollFrameHelper::FireScrolledAreaEvent() { mScrolledAreaEvent.Forget(); - InternalScrollAreaEvent event(true, NS_SCROLLEDAREACHANGED, nullptr); + InternalScrollAreaEvent event(true, eScrolledAreaChanged, nullptr); nsPresContext *prescontext = mOuter->PresContext(); nsIContent* content = mOuter->GetContent(); diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp index 0a48191f22..1efb624eea 100644 --- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -1787,7 +1787,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext, #ifdef XP_MACOSX // we want to process some native mouse events in the cocoa event model if ((anEvent->mMessage == eMouseEnterIntoWidget || - anEvent->mMessage == NS_WHEEL_WHEEL) && + anEvent->mMessage == eWheel) && mInstanceOwner->GetEventModel() == NPEventModelCocoa) { *anEventStatus = mInstanceOwner->ProcessEvent(*anEvent); // Due to plugin code reentering Gecko, this frame may be dead at this diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index 60985a4e3d..31f4ac8616 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -918,7 +918,7 @@ nsTreeBodyFrame::CheckOverflow(const ScrollParts& aParts) if (verticalOverflowChanged) { InternalScrollPortEvent event(true, - mVerticalOverflow ? NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW, + mVerticalOverflow ? eScrollPortOverflow : eScrollPortUnderflow, nullptr); event.orient = InternalScrollPortEvent::vertical; EventDispatcher::Dispatch(content, presContext, &event); @@ -926,7 +926,7 @@ nsTreeBodyFrame::CheckOverflow(const ScrollParts& aParts) if (horizontalOverflowChanged) { InternalScrollPortEvent event(true, - mHorizontalOverflow ? NS_SCROLLPORT_OVERFLOW : NS_SCROLLPORT_UNDERFLOW, + mHorizontalOverflow ? eScrollPortOverflow : eScrollPortUnderflow, nullptr); event.orient = InternalScrollPortEvent::horizontal; EventDispatcher::Dispatch(content, presContext, &event); diff --git a/widget/ContentCache.cpp b/widget/ContentCache.cpp index efe4844293..dda11aae88 100644 --- a/widget/ContentCache.cpp +++ b/widget/ContentCache.cpp @@ -27,18 +27,18 @@ static const char* GetEventMessageName(EventMessage aMessage) { switch (aMessage) { - case NS_COMPOSITION_START: - return "NS_COMPOSITION_START"; - case NS_COMPOSITION_END: - return "NS_COMPOSITION_END"; - case NS_COMPOSITION_UPDATE: - return "NS_COMPOSITION_UPDATE"; - case NS_COMPOSITION_CHANGE: - return "NS_COMPOSITION_CHANGE"; - case NS_COMPOSITION_COMMIT_AS_IS: - return "NS_COMPOSITION_COMMIT_AS_IS"; - case NS_COMPOSITION_COMMIT: - return "NS_COMPOSITION_COMMIT"; + case eCompositionStart: + return "eCompositionStart"; + case eCompositionEnd: + return "eCompositionEnd"; + case eCompositionUpdate: + return "eCompositionUpdate"; + case eCompositionChange: + return "eCompositionChange"; + case eCompositionCommitAsIs: + return "eCompositionCommitAsIs"; + case eCompositionCommit: + return "eCompositionCommit"; case eSetSelection: return "eSetSelection"; default: @@ -302,7 +302,7 @@ ContentCacheInChild::QueryCharRect(nsIWidget* aWidget, aCharRect.SetEmpty(); nsEventStatus status = nsEventStatus_eIgnore; - WidgetQueryContentEvent textRect(true, NS_QUERY_TEXT_RECT, aWidget); + WidgetQueryContentEvent textRect(true, eQueryTextRect, aWidget); textRect.InitForQueryTextRect(aOffset, 1); aWidget->DispatchEvent(&textRect, status); if (NS_WARN_IF(!textRect.mSucceeded)) { @@ -394,7 +394,7 @@ ContentCacheInChild::CacheTextRects(nsIWidget* aWidget, if (!mSelection.Collapsed()) { nsEventStatus status = nsEventStatus_eIgnore; - WidgetQueryContentEvent textRect(true, NS_QUERY_TEXT_RECT, aWidget); + WidgetQueryContentEvent textRect(true, eQueryTextRect, aWidget); textRect.InitForQueryTextRect(mSelection.StartOffset(), mSelection.Length()); aWidget->DispatchEvent(&textRect, status); @@ -583,10 +583,10 @@ ContentCacheInParent::HandleQueryContentEvent(WidgetQueryContentEvent& aEvent, this, aEvent.mReply.mOffset, aEvent.mReply.mString.Length())); break; } - case NS_QUERY_TEXT_RECT: + case eQueryTextRect: MOZ_LOG(sContentCacheLog, LogLevel::Info, ("ContentCacheInParent: 0x%p HandleQueryContentEvent(" - "aEvent={ mMessage=NS_QUERY_TEXT_RECT, mInput={ mOffset=%u, " + "aEvent={ mMessage=eQueryTextRect, mInput={ mOffset=%u, " "mLength=%u } }, aWidget=0x%p), mText.Length()=%u", this, aEvent.mInput.mOffset, aEvent.mInput.mLength, aWidget, mText.Length())); @@ -858,7 +858,7 @@ ContentCacheInParent::OnCompositionEvent(const WidgetCompositionEvent& aEvent) GetBoolName(mRequestedToCommitOrCancelComposition))); if (!aEvent.CausesDOMTextEvent()) { - MOZ_ASSERT(aEvent.mMessage == NS_COMPOSITION_START); + MOZ_ASSERT(aEvent.mMessage == eCompositionStart); mIsComposing = !aEvent.CausesDOMCompositionEndEvent(); mCompositionStart = mSelection.StartOffset(); // XXX What's this case?? @@ -875,7 +875,7 @@ ContentCacheInParent::OnCompositionEvent(const WidgetCompositionEvent& aEvent) // TextComposition must handle following events correctly! // During REQUEST_TO_COMMIT_COMPOSITION or REQUEST_TO_CANCEL_COMPOSITION, - // widget usually sends a NS_COMPOSITION_CHANGE event to finalize or + // widget usually sends a eCompositionChange event to finalize or // clear the composition, respectively. // Because the event will not reach content in time, we intercept it // here and pass the text as the DidRequestToCommitOrCancelComposition() diff --git a/widget/ContentCache.h b/widget/ContentCache.h index 29070708c1..96bc3f64e9 100644 --- a/widget/ContentCache.h +++ b/widget/ContentCache.h @@ -293,7 +293,7 @@ public: * knowing the exact length of text. It's up to widget to handle cases when * the returned offset/length are different from the queried offset/length. * - * For NS_QUERY_TEXT_RECT, fail if cached offset/length aren't equals to input. + * For eQueryTextRect, fail if cached offset/length aren't equals to input. * Cocoa widget always queries selected offset, so it works on it. * * For eQueryCaretRect, fail if cached offset isn't equals to input diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h index e28fc76b0e..bb63f3769b 100644 --- a/widget/EventMessageList.h +++ b/widget/EventMessageList.h @@ -128,9 +128,9 @@ NS_EVENT_MESSAGE(eLegacyMouseScrollEventFirst, 1600) NS_EVENT_MESSAGE(eLegacyMouseLineOrPageScroll, eLegacyMouseScrollEventFirst) NS_EVENT_MESSAGE(eLegacyMousePixelScroll, eLegacyMouseScrollEventFirst + 1) -NS_EVENT_MESSAGE(NS_SCROLLPORT_START, 1700) -NS_EVENT_MESSAGE(NS_SCROLLPORT_UNDERFLOW, NS_SCROLLPORT_START) -NS_EVENT_MESSAGE(NS_SCROLLPORT_OVERFLOW, NS_SCROLLPORT_START + 1) +NS_EVENT_MESSAGE(eScrollPortEventFirst, 1700) +NS_EVENT_MESSAGE(eScrollPortUnderflow, eScrollPortEventFirst) +NS_EVENT_MESSAGE(eScrollPortOverflow, eScrollPortEventFirst + 1) NS_EVENT_MESSAGE(eLegacyMutationEventFirst, 1800) NS_EVENT_MESSAGE(eLegacySubtreeModified, eLegacyMutationEventFirst) @@ -145,35 +145,35 @@ NS_EVENT_MESSAGE(eLegacyMutationEventLast, eLegacyCharacterDataModified) NS_EVENT_MESSAGE(eUnidentifiedEvent, 2000) // composition events -NS_EVENT_MESSAGE(NS_COMPOSITION_EVENT_START, 2200) -NS_EVENT_MESSAGE(NS_COMPOSITION_START, NS_COMPOSITION_EVENT_START) -// NS_COMPOSITION_END is the message for DOM compositionend event. -// This event should NOT be dispatched from widget if NS_COMPOSITION_COMMIT +NS_EVENT_MESSAGE(eCompositionEventFirst, 2200) +NS_EVENT_MESSAGE(eCompositionStart, eCompositionEventFirst) +// eCompositionEnd is the message for DOM compositionend event. +// This event should NOT be dispatched from widget if eCompositionCommit // is available. -NS_EVENT_MESSAGE(NS_COMPOSITION_END, NS_COMPOSITION_EVENT_START + 1) -// NS_COMPOSITION_UPDATE is the message for DOM compositionupdate event. +NS_EVENT_MESSAGE(eCompositionEnd, eCompositionEventFirst + 1) +// eCompositionUpdate is the message for DOM compositionupdate event. // This event should NOT be dispatched from widget since it will be dispatched -// by mozilla::TextComposition automatically if NS_COMPOSITION_CHANGE event +// by mozilla::TextComposition automatically if eCompositionChange event // will change composition string. -NS_EVENT_MESSAGE(NS_COMPOSITION_UPDATE, NS_COMPOSITION_EVENT_START + 2) -// NS_COMPOSITION_CHANGE is the message for representing a change of +NS_EVENT_MESSAGE(eCompositionUpdate, eCompositionEventFirst + 2) +// eCompositionChange is the message for representing a change of // composition string. This should be dispatched from widget even if // composition string isn't changed but the ranges are changed. This causes // a DOM "text" event which is a non-standard DOM event. -NS_EVENT_MESSAGE(NS_COMPOSITION_CHANGE, NS_COMPOSITION_EVENT_START + 3) -// NS_COMPOSITION_COMMIT_AS_IS is the message for representing a commit of +NS_EVENT_MESSAGE(eCompositionChange, eCompositionEventFirst + 3) +// eCompositionCommitAsIs is the message for representing a commit of // composition string. TextComposition will commit composition with the // last data. TextComposition will dispatch this event to the DOM tree as -// NS_COMPOSITION_CHANGE without clause information. After that, -// NS_COMPOSITION_END will be dispatched automatically. +// eCompositionChange without clause information. After that, +// eCompositionEnd will be dispatched automatically. // Its mData and mRanges should be empty and nullptr. -NS_EVENT_MESSAGE(NS_COMPOSITION_COMMIT_AS_IS, NS_COMPOSITION_EVENT_START + 4) -// NS_COMPOSITION_COMMIT is the message for representing a commit of +NS_EVENT_MESSAGE(eCompositionCommitAsIs, eCompositionEventFirst + 4) +// eCompositionCommit is the message for representing a commit of // composition string with its mData value. TextComposition will dispatch this -// event to the DOM tree as NS_COMPOSITION_CHANGE without clause information. -// After that, NS_COMPOSITION_END will be dispatched automatically. +// event to the DOM tree as eCompositionChange without clause information. +// After that, eCompositionEnd will be dispatched automatically. // Its mRanges should be nullptr. -NS_EVENT_MESSAGE(NS_COMPOSITION_COMMIT, NS_COMPOSITION_EVENT_START + 5) +NS_EVENT_MESSAGE(eCompositionCommit, eCompositionEventFirst + 5) // Following events are defined for deprecated DOM events which are using // InternalUIEvent class. @@ -226,7 +226,7 @@ NS_EVENT_MESSAGE(eQueryCaretRect, eQueryContentEventFirst + 3) // Query for the bounding rect of a range of characters. This works on any // valid character range given offset and length. Result is relative to top // level widget coordinates -NS_EVENT_MESSAGE(NS_QUERY_TEXT_RECT, eQueryContentEventFirst + 4) +NS_EVENT_MESSAGE(eQueryTextRect, eQueryContentEventFirst + 4) // Query for the bounding rect of the current focused frame. Result is relative // to top level widget coordinates NS_EVENT_MESSAGE(eQueryEditorRect, eQueryContentEventFirst + 5) @@ -315,12 +315,10 @@ NS_EVENT_MESSAGE(eContentCommandPasteTransferable, eContentCommandEventFirst + 6 NS_EVENT_MESSAGE(eContentCommandScroll, eContentCommandEventFirst + 7) // Event to gesture notification -NS_EVENT_MESSAGE(NS_GESTURENOTIFY_EVENT_START, 3900) +NS_EVENT_MESSAGE(eGestureNotify, 3900) -NS_EVENT_MESSAGE(NS_ORIENTATION_EVENT, 4000) - -NS_EVENT_MESSAGE(NS_SCROLLAREA_EVENT_START, 4100) -NS_EVENT_MESSAGE(NS_SCROLLEDAREACHANGED, NS_SCROLLAREA_EVENT_START) +NS_EVENT_MESSAGE(eScrolledAreaEventFirst, 4100) +NS_EVENT_MESSAGE(eScrolledAreaChanged, eScrolledAreaEventFirst) NS_EVENT_MESSAGE(NS_TRANSITION_EVENT_START, 4200) NS_EVENT_MESSAGE(NS_TRANSITION_END, NS_TRANSITION_EVENT_START) @@ -330,10 +328,10 @@ NS_EVENT_MESSAGE(eAnimationStart, eAnimationEventFirst) NS_EVENT_MESSAGE(eAnimationEnd, eAnimationEventFirst + 1) NS_EVENT_MESSAGE(eAnimationIteration, eAnimationEventFirst + 2) -NS_EVENT_MESSAGE(NS_SMIL_TIME_EVENT_START, 4300) -NS_EVENT_MESSAGE(NS_SMIL_BEGIN, NS_SMIL_TIME_EVENT_START) -NS_EVENT_MESSAGE(NS_SMIL_END, NS_SMIL_TIME_EVENT_START + 1) -NS_EVENT_MESSAGE(NS_SMIL_REPEAT, NS_SMIL_TIME_EVENT_START + 2) +NS_EVENT_MESSAGE(eSMILEventFirst, 4300) +NS_EVENT_MESSAGE(eSMILBeginEvent, eSMILEventFirst) +NS_EVENT_MESSAGE(eSMILEndEvent, eSMILEventFirst + 1) +NS_EVENT_MESSAGE(eSMILRepeatEvent, eSMILEventFirst + 2) NS_EVENT_MESSAGE(NS_WEBAUDIO_EVENT_START, 4350) NS_EVENT_MESSAGE(NS_AUDIO_PROCESS, NS_WEBAUDIO_EVENT_START) @@ -344,9 +342,9 @@ NS_EVENT_MESSAGE(eScriptEventFirst, 4500) NS_EVENT_MESSAGE(eBeforeScriptExecute, eScriptEventFirst) NS_EVENT_MESSAGE(eAfterScriptExecute, eScriptEventFirst + 1) -NS_EVENT_MESSAGE(NS_PRINT_EVENT_START, 4600) -NS_EVENT_MESSAGE(NS_BEFOREPRINT, NS_PRINT_EVENT_START) -NS_EVENT_MESSAGE(NS_AFTERPRINT, NS_PRINT_EVENT_START + 1) +NS_EVENT_MESSAGE(ePrintEventFirst, 4600) +NS_EVENT_MESSAGE(eBeforePrint, ePrintEventFirst) +NS_EVENT_MESSAGE(eAfterPrint, ePrintEventFirst + 1) NS_EVENT_MESSAGE(NS_MESSAGE_EVENT_START, 4700) NS_EVENT_MESSAGE(NS_MESSAGE, NS_MESSAGE_EVENT_START) @@ -356,12 +354,12 @@ NS_EVENT_MESSAGE(eOpenCloseEventFirst, 4800) NS_EVENT_MESSAGE(eOpen, eOpenCloseEventFirst) // Device motion and orientation -NS_EVENT_MESSAGE(NS_DEVICE_ORIENTATION_START, 4900) -NS_EVENT_MESSAGE(NS_DEVICE_ORIENTATION, NS_DEVICE_ORIENTATION_START) -NS_EVENT_MESSAGE(NS_DEVICE_MOTION, NS_DEVICE_ORIENTATION_START + 1) -NS_EVENT_MESSAGE(NS_DEVICE_PROXIMITY, NS_DEVICE_ORIENTATION_START + 2) -NS_EVENT_MESSAGE(NS_USER_PROXIMITY, NS_DEVICE_ORIENTATION_START + 3) -NS_EVENT_MESSAGE(NS_DEVICE_LIGHT, NS_DEVICE_ORIENTATION_START + 4) +NS_EVENT_MESSAGE(eDeviceEventFirst, 4900) +NS_EVENT_MESSAGE(eDeviceOrientation, eDeviceEventFirst) +NS_EVENT_MESSAGE(eDeviceMotion, eDeviceEventFirst + 1) +NS_EVENT_MESSAGE(eDeviceProximity, eDeviceEventFirst + 2) +NS_EVENT_MESSAGE(eUserProximity, eDeviceEventFirst + 3) +NS_EVENT_MESSAGE(eDeviceLight, eDeviceEventFirst + 4) NS_EVENT_MESSAGE(NS_SHOW_EVENT, 5000) @@ -377,22 +375,29 @@ NS_EVENT_MESSAGE(NS_TOUCH_END, NS_TOUCH_EVENT_START + 2) NS_EVENT_MESSAGE(NS_TOUCH_CANCEL, NS_TOUCH_EVENT_START + 3) // Pointerlock DOM API -NS_EVENT_MESSAGE(NS_POINTERLOCK_START, 5300) -NS_EVENT_MESSAGE(NS_POINTERLOCKCHANGE, NS_POINTERLOCK_START) -NS_EVENT_MESSAGE(NS_POINTERLOCKERROR, NS_POINTERLOCK_START + 1) +NS_EVENT_MESSAGE(ePointerLockEventFirst, 5300) +NS_EVENT_MESSAGE(ePointerLockChange, ePointerLockEventFirst) +NS_EVENT_MESSAGE(ePointerLockError, ePointerLockEventFirst + 1) NS_EVENT_MESSAGE(eWheelEventFirst, 5400) -NS_EVENT_MESSAGE(NS_WHEEL_WHEEL, eWheelEventFirst) -NS_EVENT_MESSAGE(NS_WHEEL_START, eWheelEventFirst + 1) -NS_EVENT_MESSAGE(NS_WHEEL_STOP, eWheelEventFirst + 2) +// eWheel is the event message of DOM wheel event. +NS_EVENT_MESSAGE(eWheel, eWheelEventFirst) +// eWheelOperationStart may be dispatched when user starts to operate mouse +// wheel. This won't be fired on some platforms which don't have corresponding +// native event. +NS_EVENT_MESSAGE(eWheelOperationStart, eWheelEventFirst + 1) +// eWheelOperationEnd may be dispatched when user ends or cancels operating +// mouse wheel. This won't be fired on some platforms which don't have +// corresponding native event. +NS_EVENT_MESSAGE(eWheelOperationEnd, eWheelEventFirst + 2) //System time is changed -NS_EVENT_MESSAGE(NS_MOZ_TIME_CHANGE_EVENT, 5500) +NS_EVENT_MESSAGE(eTimeChange, 5500) // Network packet events. -NS_EVENT_MESSAGE(NS_NETWORK_EVENT_START, 5600) -NS_EVENT_MESSAGE(NS_NETWORK_UPLOAD_EVENT, NS_NETWORK_EVENT_START + 1) -NS_EVENT_MESSAGE(NS_NETWORK_DOWNLOAD_EVENT, NS_NETWORK_EVENT_START + 2) +NS_EVENT_MESSAGE(eNetworkEventFirst, 5600) +NS_EVENT_MESSAGE(eNetworkUpload, eNetworkEventFirst + 1) +NS_EVENT_MESSAGE(eNetworkDownload, eNetworkEventFirst + 2) // MediaRecorder events. NS_EVENT_MESSAGE(NS_MEDIARECORDER_EVENT_START, 5700) @@ -406,14 +411,13 @@ NS_EVENT_MESSAGE(NS_SPEAKERMANAGER_SPEAKERFORCEDCHANGE, NS_SPEAKERMANAGER_EVENT_ #ifdef MOZ_GAMEPAD // Gamepad input events -NS_EVENT_MESSAGE(NS_GAMEPAD_START, 6000) -NS_EVENT_MESSAGE(NS_GAMEPAD_BUTTONDOWN, NS_GAMEPAD_START) -NS_EVENT_MESSAGE(NS_GAMEPAD_BUTTONUP, NS_GAMEPAD_START + 1) -NS_EVENT_MESSAGE(NS_GAMEPAD_AXISMOVE, NS_GAMEPAD_START + 2) -NS_EVENT_MESSAGE(NS_GAMEPAD_CONNECTED, NS_GAMEPAD_START + 3) -NS_EVENT_MESSAGE(NS_GAMEPAD_DISCONNECTED, NS_GAMEPAD_START + 4) -// Keep this defined to the same value as the event above -NS_EVENT_MESSAGE(NS_GAMEPAD_END, NS_GAMEPAD_START + 4) +NS_EVENT_MESSAGE(eGamepadEventFirst, 6000) +NS_EVENT_MESSAGE(eGamepadButtonDown, eGamepadEventFirst) +NS_EVENT_MESSAGE(eGamepadButtonUp, eGamepadEventFirst + 1) +NS_EVENT_MESSAGE(eGamepadAxisMove, eGamepadEventFirst + 2) +NS_EVENT_MESSAGE(eGamepadConnected, eGamepadEventFirst + 3) +NS_EVENT_MESSAGE(eGamepadDisconnected, eGamepadEventFirst + 4) +NS_EVENT_MESSAGE(eGamepadEventLast, eGamepadDisconnected) #endif // input and beforeinput events. @@ -423,11 +427,11 @@ NS_EVENT_MESSAGE(NS_EDITOR_INPUT, NS_EDITOR_EVENT_START) // Selection events NS_EVENT_MESSAGE(NS_SELECT_EVENT_START, 6200) NS_EVENT_MESSAGE(NS_SELECT_START, NS_SELECT_EVENT_START) -NS_EVENT_MESSAGE(NS_SELECTION_CHANGE, NS_SELECT_EVENT_START + 1) +NS_EVENT_MESSAGE(eSelectionChange, NS_SELECT_EVENT_START + 1) // Visibility change NS_EVENT_MESSAGE(NS_VISIBILITY_START, 6300) -NS_EVENT_MESSAGE(NS_VISIBILITY_CHANGE, NS_VISIBILITY_START + 1) +NS_EVENT_MESSAGE(eVisibilityChange, NS_VISIBILITY_START + 1) // Details and Summary events. NS_EVENT_MESSAGE(NS_DETAILS_SUMMARY_EVENT_START, 6400) diff --git a/widget/InputData.cpp b/widget/InputData.cpp index 755e438ed9..6b7e6d3962 100644 --- a/widget/InputData.cpp +++ b/widget/InputData.cpp @@ -241,7 +241,7 @@ PanGestureInput::IsMomentum() const WidgetWheelEvent PanGestureInput::ToWidgetWheelEvent(nsIWidget* aWidget) const { - WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget); + WidgetWheelEvent wheelEvent(true, eWheel, aWidget); wheelEvent.modifiers = this->modifiers; wheelEvent.time = mTime; wheelEvent.timeStamp = mTimeStamp; @@ -313,7 +313,7 @@ DeltaModeForDeltaType(ScrollWheelInput::ScrollDeltaType aDeltaType) WidgetWheelEvent ScrollWheelInput::ToWidgetWheelEvent(nsIWidget* aWidget) const { - WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget); + WidgetWheelEvent wheelEvent(true, eWheel, aWidget); wheelEvent.modifiers = this->modifiers; wheelEvent.time = mTime; wheelEvent.timeStamp = mTimeStamp; diff --git a/widget/PuppetWidget.cpp b/widget/PuppetWidget.cpp index 7ac0489ccc..06a35b8127 100644 --- a/widget/PuppetWidget.cpp +++ b/widget/PuppetWidget.cpp @@ -573,8 +573,7 @@ PuppetWidget::IMEEndComposition(bool aCancel) nsEventStatus status; bool noCompositionEvent = true; - WidgetCompositionEvent compositionCommitEvent(true, NS_COMPOSITION_COMMIT, - this); + WidgetCompositionEvent compositionCommitEvent(true, eCompositionCommit, this); InitEvent(compositionCommitEvent, nullptr); // SendEndIMEComposition is always called since ResetInputState // should always be called even if we aren't composing something. diff --git a/widget/TextEventDispatcher.cpp b/widget/TextEventDispatcher.cpp index 01e71daa24..adc450cfdd 100644 --- a/widget/TextEventDispatcher.cpp +++ b/widget/TextEventDispatcher.cpp @@ -191,7 +191,7 @@ TextEventDispatcher::StartComposition(nsEventStatus& aStatus) } mIsComposing = true; - WidgetCompositionEvent compositionStartEvent(true, NS_COMPOSITION_START, + WidgetCompositionEvent compositionStartEvent(true, eCompositionStart, mWidget); InitEvent(compositionStartEvent); rv = DispatchEvent(mWidget, compositionStartEvent, aStatus); @@ -268,11 +268,11 @@ TextEventDispatcher::CommitComposition(nsEventStatus& aStatus, // End current composition and make this free for other IMEs. mIsComposing = false; - EventMessage message = aCommitString ? NS_COMPOSITION_COMMIT : - NS_COMPOSITION_COMMIT_AS_IS; + EventMessage message = aCommitString ? eCompositionCommit : + eCompositionCommitAsIs; WidgetCompositionEvent compositionCommitEvent(true, message, widget); InitEvent(compositionCommitEvent); - if (message == NS_COMPOSITION_COMMIT) { + if (message == eCompositionCommit) { compositionCommitEvent.mData = *aCommitString; } rv = DispatchEvent(widget, compositionCommitEvent, aStatus); @@ -541,7 +541,7 @@ TextEventDispatcher::PendingComposition::Flush(TextEventDispatcher* aDispatcher, nsRefPtr kungFuDeathGrip(aDispatcher); nsCOMPtr widget(aDispatcher->mWidget); - WidgetCompositionEvent compChangeEvent(true, NS_COMPOSITION_CHANGE, widget); + WidgetCompositionEvent compChangeEvent(true, eCompositionChange, widget); aDispatcher->InitEvent(compChangeEvent); compChangeEvent.mData = mString; if (mClauses) { diff --git a/widget/TextEventDispatcher.h b/widget/TextEventDispatcher.h index 0d64468a8b..08bf15bd14 100644 --- a/widget/TextEventDispatcher.h +++ b/widget/TextEventDispatcher.h @@ -112,7 +112,7 @@ public: /** * SetPendingCompositionString() sets new composition string which will be - * dispatched with NS_COMPOSITION_CHANGE event by calling Flush(). + * dispatched with eCompositionChange event by calling Flush(). * * @param aString New composition string. */ @@ -255,7 +255,7 @@ private: nsWeakPtr mListener; // mPendingComposition stores new composition string temporarily. - // These values will be used for dispatching NS_COMPOSITION_CHANGE event + // These values will be used for dispatching eCompositionChange event // in Flush(). When Flush() is called, the members will be cleared // automatically. class PendingComposition diff --git a/widget/TextEvents.h b/widget/TextEvents.h index 2f251a0f84..41deadecaf 100644 --- a/widget/TextEvents.h +++ b/widget/TextEvents.h @@ -434,22 +434,22 @@ public: bool CausesDOMTextEvent() const { - return mMessage == NS_COMPOSITION_CHANGE || - mMessage == NS_COMPOSITION_COMMIT || - mMessage == NS_COMPOSITION_COMMIT_AS_IS; + return mMessage == eCompositionChange || + mMessage == eCompositionCommit || + mMessage == eCompositionCommitAsIs; } bool CausesDOMCompositionEndEvent() const { - return mMessage == NS_COMPOSITION_END || - mMessage == NS_COMPOSITION_COMMIT || - mMessage == NS_COMPOSITION_COMMIT_AS_IS; + return mMessage == eCompositionEnd || + mMessage == eCompositionCommit || + mMessage == eCompositionCommitAsIs; } bool IsFollowedByCompositionEnd() const { - return mOriginalMessage == NS_COMPOSITION_COMMIT || - mOriginalMessage == NS_COMPOSITION_COMMIT_AS_IS; + return mOriginalMessage == eCompositionCommit || + mOriginalMessage == eCompositionCommitAsIs; } }; @@ -514,7 +514,7 @@ public: void InitForQueryTextRect(uint32_t aOffset, uint32_t aLength, bool aUseNativeLineBreak = true) { - NS_ASSERTION(mMessage == NS_QUERY_TEXT_RECT, + NS_ASSERTION(mMessage == eQueryTextRect, "wrong initializer is called"); mInput.mOffset = aOffset; mInput.mLength = aLength; @@ -553,7 +553,7 @@ public: { NS_ASSERTION(mMessage == eQuerySelectedText || mMessage == eQueryCaretRect || - mMessage == NS_QUERY_TEXT_RECT, + mMessage == eQueryTextRect, "not querying selection or text rect"); return mReply.mWritingMode; } diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp index b309a86622..381982250f 100644 --- a/widget/WidgetEventImpl.cpp +++ b/widget/WidgetEventImpl.cpp @@ -136,12 +136,12 @@ bool WidgetEvent::HasIMEEventMessage() const { switch (mMessage) { - case NS_COMPOSITION_START: - case NS_COMPOSITION_END: - case NS_COMPOSITION_UPDATE: - case NS_COMPOSITION_CHANGE: - case NS_COMPOSITION_COMMIT_AS_IS: - case NS_COMPOSITION_COMMIT: + case eCompositionStart: + case eCompositionEnd: + case eCompositionUpdate: + case eCompositionChange: + case eCompositionCommitAsIs: + case eCompositionCommit: return true; default: return false; diff --git a/widget/cocoa/TextInputHandler.mm b/widget/cocoa/TextInputHandler.mm index cfa454109c..59603103e4 100644 --- a/widget/cocoa/TextInputHandler.mm +++ b/widget/cocoa/TextInputHandler.mm @@ -2714,7 +2714,7 @@ IMEInputHandler::DispatchCompositionChangeEvent(const nsString& aText, nsRefPtr kungFuDeathGrip(this); - WidgetCompositionEvent compositionChangeEvent(true, NS_COMPOSITION_CHANGE, + WidgetCompositionEvent compositionChangeEvent(true, eCompositionChange, mWidget); compositionChangeEvent.time = PR_IntervalNow(); compositionChangeEvent.mData = aText; @@ -2740,7 +2740,7 @@ IMEInputHandler::DispatchCompositionCommitEvent(const nsAString* aCommitString) nsRefPtr kungFuDeathGrip(this); EventMessage message = - aCommitString ? NS_COMPOSITION_COMMIT : NS_COMPOSITION_COMMIT_AS_IS; + aCommitString ? eCompositionCommit : eCompositionCommitAsIs; WidgetCompositionEvent compositionCommitEvent(true, message, mWidget); compositionCommitEvent.time = PR_IntervalNow(); if (aCommitString) { @@ -2813,7 +2813,7 @@ IMEInputHandler::InsertTextAsCommittingComposition( // XXXmnakano Probably, we shouldn't emulate composition in this case. // I think that we should just fire DOM3 textInput event if we implement it. - WidgetCompositionEvent compStart(true, NS_COMPOSITION_START, mWidget); + WidgetCompositionEvent compStart(true, eCompositionStart, mWidget); InitCompositionEvent(compStart); DispatchEvent(compStart); @@ -2903,7 +2903,7 @@ IMEInputHandler::SetMarkedText(NSAttributedString* aAttrString, mMarkedRange.location = SelectedRange().location; - WidgetCompositionEvent compStart(true, NS_COMPOSITION_START, mWidget); + WidgetCompositionEvent compStart(true, eCompositionStart, mWidget); InitCompositionEvent(compStart); DispatchEvent(compStart); @@ -3186,7 +3186,7 @@ IMEInputHandler::FirstRectForCharacterRange(NSRange& aRange, LayoutDeviceIntRect r; bool useCaretRect = (aRange.length == 0); if (!useCaretRect) { - WidgetQueryContentEvent charRect(true, NS_QUERY_TEXT_RECT, mWidget); + WidgetQueryContentEvent charRect(true, eQueryTextRect, mWidget); charRect.InitForQueryTextRect(aRange.location, 1); DispatchEvent(charRect); if (charRect.mSucceeded) { diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 490347bf99..b61fe9fd98 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -2764,7 +2764,7 @@ nsChildView::DispatchAPZWheelInputEvent(InputData& aEvent, bool aCanTriggerSwipe } } - WidgetWheelEvent event(true, NS_WHEEL_WHEEL, this); + WidgetWheelEvent event(true, eWheel, this); if (mAPZC) { uint64_t inputBlockId = 0; @@ -2817,8 +2817,7 @@ nsChildView::DispatchAPZWheelInputEvent(InputData& aEvent, bool aCanTriggerSwipe MOZ_CRASH("unsupported event type"); return; } - if (event.mMessage == NS_WHEEL_WHEEL && - (event.deltaX != 0 || event.deltaY != 0)) { + if (event.mMessage == eWheel && (event.deltaX != 0 || event.deltaY != 0)) { ProcessUntransformedAPZEvent(&event, guid, inputBlockId, result); } return; @@ -2862,8 +2861,7 @@ nsChildView::DispatchAPZWheelInputEvent(InputData& aEvent, bool aCanTriggerSwipe MOZ_CRASH("unexpected event type"); return; } - if (event.mMessage == NS_WHEEL_WHEEL && - (event.deltaX != 0 || event.deltaY != 0)) { + if (event.mMessage == eWheel && (event.deltaX != 0 || event.deltaY != 0)) { DispatchEvent(&event, status); } } @@ -4819,7 +4817,7 @@ static int32_t RoundUp(double aDouble) { WidgetWheelEvent wheelEvent(true, msg, mGeckoChild); [self convertCocoaMouseWheelEvent:theEvent toGeckoEvent:&wheelEvent]; - mExpectingWheelStop = (msg == NS_WHEEL_START); + mExpectingWheelStop = (msg == eWheelOperationStart); mGeckoChild->DispatchAPZAwareEvent(wheelEvent.AsInputEvent()); } @@ -4889,11 +4887,18 @@ PanGestureTypeForEvent(NSEvent* aEvent) } NSEventPhase phase = nsCocoaUtils::EventPhase(theEvent); - // Fire NS_WHEEL_START/STOP events when 2 fingers touch/release the touchpad. + // Fire eWheelOperationStart/End events when 2 fingers touch/release the + // touchpad. if (phase & NSEventPhaseMayBegin) { - [self sendWheelCondition:YES first:NS_WHEEL_STOP second:NS_WHEEL_START forEvent:theEvent]; + [self sendWheelCondition:YES + first:eWheelOperationEnd + second:eWheelOperationStart + forEvent:theEvent]; } else if (phase & (NSEventPhaseEnded | NSEventPhaseCancelled)) { - [self sendWheelCondition:NO first:NS_WHEEL_START second:NS_WHEEL_STOP forEvent:theEvent]; + [self sendWheelCondition:NO + first:eWheelOperationStart + second:eWheelOperationEnd + forEvent:theEvent]; } NSPoint locationInWindow = nsCocoaUtils::EventLocationForWindow(theEvent, [self window]); diff --git a/widget/gtk/IMContextWrapper.cpp b/widget/gtk/IMContextWrapper.cpp index 23f6606f0c..cf0d68b035 100644 --- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -915,7 +915,7 @@ IMContextWrapper::OnSelectionChange(nsWindow* aCaller, // The focused editor might have placeholder text with normal text node. // In such case, the text node must be removed from a compositionstart - // event handler. So, we're dispatching NS_COMPOSITION_START, + // event handler. So, we're dispatching eCompositionStart, // we should ignore selection change notification. if (mCompositionState == eCompositionState_CompositionStartDispatched) { if (NS_WARN_IF(!mSelection.IsValid())) { @@ -1303,7 +1303,7 @@ IMContextWrapper::DispatchCompositionStart(GtkIMContext* aContext) ("GTKIM: %p DispatchCompositionStart(), FAILED, mCompositionStart=%u", this, mCompositionStart)); mCompositionState = eCompositionState_CompositionStartDispatched; - WidgetCompositionEvent compEvent(true, NS_COMPOSITION_START, + WidgetCompositionEvent compEvent(true, eCompositionStart, mLastFocusedWindow); InitEvent(compEvent); nsCOMPtr kungFuDeathGrip = mLastFocusedWindow; @@ -1364,7 +1364,7 @@ IMContextWrapper::DispatchCompositionChangeEvent( } } - WidgetCompositionEvent compositionChangeEvent(true, NS_COMPOSITION_CHANGE, + WidgetCompositionEvent compositionChangeEvent(true, eCompositionChange, mLastFocusedWindow); InitEvent(compositionChangeEvent); @@ -1439,8 +1439,8 @@ IMContextWrapper::DispatchCompositionCommitEvent( nsRefPtr lastFocusedWindow(mLastFocusedWindow); - EventMessage message = aCommitString ? NS_COMPOSITION_COMMIT : - NS_COMPOSITION_COMMIT_AS_IS; + EventMessage message = aCommitString ? eCompositionCommit : + eCompositionCommitAsIs; mCompositionState = eCompositionState_NotComposing; mCompositionStart = UINT32_MAX; mCompositionTargetRange.Clear(); @@ -1449,7 +1449,7 @@ IMContextWrapper::DispatchCompositionCommitEvent( WidgetCompositionEvent compositionCommitEvent(true, message, mLastFocusedWindow); InitEvent(compositionCommitEvent); - if (message == NS_COMPOSITION_COMMIT) { + if (message == eCompositionCommit) { compositionCommitEvent.mData = *aCommitString; } @@ -1811,7 +1811,7 @@ IMContextWrapper::SetCursorPosition(GtkIMContext* aContext) WidgetQueryContentEvent charRect(true, useCaret ? eQueryCaretRect : - NS_QUERY_TEXT_RECT, + eQueryTextRect, mLastFocusedWindow); if (useCaret) { charRect.InitForQueryCaretRect(mSelection.mOffset); @@ -1833,7 +1833,7 @@ IMContextWrapper::SetCursorPosition(GtkIMContext* aContext) if (!charRect.mSucceeded) { MOZ_LOG(gGtkIMLog, LogLevel::Error, ("GTKIM: %p SetCursorPosition(), FAILED, %s was failed", - this, useCaret ? "eQueryCaretRect" : "NS_QUERY_TEXT_RECT")); + this, useCaret ? "eQueryCaretRect" : "eQueryTextRect")); return; } diff --git a/widget/gtk/IMContextWrapper.h b/widget/gtk/IMContextWrapper.h index f1933b39d8..aa3a745d2e 100644 --- a/widget/gtk/IMContextWrapper.h +++ b/widget/gtk/IMContextWrapper.h @@ -257,7 +257,7 @@ protected: // trying to delete the surrounding text. bool mIsDeletingSurrounding; // mLayoutChanged is true after OnLayoutChange() is called. This is reset - // when NS_COMPOSITION_CHANGE is being dispatched. + // when eCompositionChange is being dispatched. bool mLayoutChanged; // mSetCursorPositionOnKeyEvent true when caret rect or position is updated // with no composition. If true, we update candidate window position diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index f78cf83fac..9c4915eaf4 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -2977,7 +2977,7 @@ nsWindow::OnKeyPressEvent(GdkEventKey *aEvent) } else { WidgetCompositionEvent compositionChangeEvent( - true, NS_COMPOSITION_CHANGE, this); + true, eCompositionChange, this); char16_t textString[3]; textString[0] = H_SURROGATE(event.charCode); textString[1] = L_SURROGATE(event.charCode); @@ -3031,7 +3031,7 @@ nsWindow::OnScrollEvent(GdkEventScroll *aEvent) mLastScrollEventTime == aEvent->time) return; #endif - WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, this); + WidgetWheelEvent wheelEvent(true, eWheel, this); wheelEvent.deltaMode = nsIDOMWheelEvent::DOM_DELTA_LINE; switch (aEvent->direction) { #if GTK_CHECK_VERSION(3,4,0) diff --git a/widget/qt/nsWindow.cpp b/widget/qt/nsWindow.cpp index 7a0aa32655..c01cf7eb14 100644 --- a/widget/qt/nsWindow.cpp +++ b/widget/qt/nsWindow.cpp @@ -1259,7 +1259,7 @@ nsEventStatus nsWindow::wheelEvent(QWheelEvent* aEvent) { // check to see if we should rollup - WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, this); + WidgetWheelEvent wheelEvent(true, eWheel, this); wheelEvent.deltaMode = nsIDOMWheelEvent::DOM_DELTA_LINE; // negative values for aEvent->delta indicate downward scrolling; diff --git a/widget/tests/TestWinTSF.cpp b/widget/tests/TestWinTSF.cpp index 0bb71c55d9..70d44bb13e 100644 --- a/widget/tests/TestWinTSF.cpp +++ b/widget/tests/TestWinTSF.cpp @@ -1965,7 +1965,7 @@ TestApp::TestText(void) * Bug in eQueryTextContent handler * nsTextStore::SetText not calling SetSelection or InsertTextAtSelection * Bug in SetSelection or InsertTextAtSelection - * eSetSelection bug or NS_COMPOSITION_* / NS_COMPOSITION_CHANGE bug + * eSetSelection bug or eComposition* / eCompositionChange bug */ if (!mMgr->GetFocusedStore()) { diff --git a/widget/windows/IMMHandler.cpp b/widget/windows/IMMHandler.cpp index b823e2c0ec..35ac6f7239 100644 --- a/widget/windows/IMMHandler.cpp +++ b/widget/windows/IMMHandler.cpp @@ -1250,7 +1250,7 @@ IMMHandler::HandleStartComposition(nsWindow* aWindow, mCompositionStart = selection.mOffset; mCursorPosition = NO_IME_CARET; - WidgetCompositionEvent event(true, NS_COMPOSITION_START, aWindow); + WidgetCompositionEvent event(true, eCompositionStart, aWindow); nsIntPoint point(0, 0); aWindow->InitEvent(event, &point); aWindow->DispatchWindowEvent(&event); @@ -1525,7 +1525,7 @@ IMMHandler::HandleEndComposition(nsWindow* aWindow, } EventMessage message = - aCommitString ? NS_COMPOSITION_COMMIT : NS_COMPOSITION_COMMIT_AS_IS; + aCommitString ? eCompositionCommit : eCompositionCommitAsIs; WidgetCompositionEvent compositionCommitEvent(true, message, aWindow); nsIntPoint point(0, 0); aWindow->InitEvent(compositionCommitEvent, &point); @@ -1897,7 +1897,7 @@ IMMHandler::DispatchCompositionChangeEvent(nsWindow* aWindow, nsIntPoint point(0, 0); - WidgetCompositionEvent event(true, NS_COMPOSITION_CHANGE, aWindow); + WidgetCompositionEvent event(true, eCompositionChange, aWindow); aWindow->InitEvent(event, &point); @@ -2165,7 +2165,7 @@ IMMHandler::GetCharacterRectOfSelectedTextAt(nsWindow* aWindow, // If there is a caret and retrieving offset is same as the caret offset, // we should use the caret rect. if (offset != caretOffset) { - WidgetQueryContentEvent charRect(true, NS_QUERY_TEXT_RECT, aWindow); + WidgetQueryContentEvent charRect(true, eQueryTextRect, aWindow); charRect.InitForQueryTextRect(offset, 1); aWindow->InitEvent(charRect, &point); aWindow->DispatchWindowEvent(&charRect); diff --git a/widget/windows/IMMHandler.h b/widget/windows/IMMHandler.h index c01a8a441c..3514fb2da0 100644 --- a/widget/windows/IMMHandler.h +++ b/widget/windows/IMMHandler.h @@ -353,7 +353,7 @@ protected: bool GetTargetClauseRange(uint32_t *aOffset, uint32_t *aLength = nullptr); /** - * DispatchCompositionChangeEvent() dispatches NS_COMPOSITION_CHANGE event + * DispatchCompositionChangeEvent() dispatches eCompositionChange event * with clause information (it'll be retrieved by CreateTextRangeArray()). * I.e., this should be called only during composing. If a composition is * being committed, only HandleCompositionEnd() should be called. diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp index 0b6e0bd2c9..272b9d4ad5 100644 --- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -1703,10 +1703,10 @@ TSFTextStore::FlushPendingActions() MOZ_LOG(sTextStoreLog, LogLevel::Debug, ("TSF: 0x%p TSFTextStore::FlushPendingActions() " "dispatching compositionstart event...", this)); - WidgetCompositionEvent compositionStart(true, NS_COMPOSITION_START, + WidgetCompositionEvent compositionStart(true, eCompositionStart, mWidget); mWidget->InitEvent(compositionStart); - // NS_COMPOSITION_START always causes NOTIFY_IME_OF_COMPOSITION_UPDATE. + // eCompositionStart always causes NOTIFY_IME_OF_COMPOSITION_UPDATE. // Therefore, we should wait to clear the locked content until it's // notified. mDeferClearingLockedContent = true; @@ -1761,7 +1761,7 @@ TSFTextStore::FlushPendingActions() MOZ_LOG(sTextStoreLog, LogLevel::Debug, ("TSF: 0x%p TSFTextStore::FlushPendingActions(), " "dispatching compositionchange event...", this)); - WidgetCompositionEvent compositionChange(true, NS_COMPOSITION_CHANGE, + WidgetCompositionEvent compositionChange(true, eCompositionChange, mWidget); mWidget->InitEvent(compositionChange); compositionChange.mData = action.mData; @@ -1773,7 +1773,7 @@ TSFTextStore::FlushPendingActions() action.mRanges->AppendElement(wholeRange); } compositionChange.mRanges = action.mRanges; - // When the NS_COMPOSITION_CHANGE causes a DOM text event, + // When the eCompositionChange causes a DOM text event, // the IME will be notified of NOTIFY_IME_OF_COMPOSITION_UPDATE. In // such case, we should not clear the locked content until we notify // the IME of the composition update. @@ -1796,11 +1796,11 @@ TSFTextStore::FlushPendingActions() MOZ_LOG(sTextStoreLog, LogLevel::Debug, ("TSF: 0x%p TSFTextStore::FlushPendingActions(), " "dispatching compositioncommit event...", this)); - WidgetCompositionEvent compositionCommit(true, NS_COMPOSITION_COMMIT, + WidgetCompositionEvent compositionCommit(true, eCompositionCommit, mWidget); mWidget->InitEvent(compositionCommit); compositionCommit.mData = action.mData; - // When the NS_COMPOSITION_COMMIT causes a DOM text event, + // When the eCompositionCommit causes a DOM text event, // the IME will be notified of NOTIFY_IME_OF_COMPOSITION_UPDATE. In // such case, we should not clear the locked content until we notify // the IME of the composition update. @@ -2459,7 +2459,7 @@ TSFTextStore::RecordCompositionUpdateAction() // the attribute, we have to find out all the ranges that have distinct // attribute values. Then we query for what the value represents through // the display attribute manager and translate that to TextRange to be - // sent in NS_COMPOSITION_CHANGE + // sent in eCompositionChange nsRefPtr attrPropetry; HRESULT hr = mContext->GetProperty(GUID_PROP_ATTRIBUTE, @@ -2508,7 +2508,7 @@ TSFTextStore::RecordCompositionUpdateAction() TextRange newRange; // No matter if we have display attribute info or not, - // we always pass in at least one range to NS_COMPOSITION_CHANGE + // we always pass in at least one range to eCompositionChange newRange.mStartOffset = 0; newRange.mEndOffset = action->mData.Length(); newRange.mRangeType = NS_TEXTRANGE_RAWINPUT; @@ -3407,7 +3407,7 @@ TSFTextStore::GetACPFromPoint(TsViewCookie vcView, // offset since there is no inexpensive API to check it strictly. // XXX If we retrieve 2 bounding boxes, one is before the offset and // the other is after the offset, we could resolve the offset. - // However, dispatching 2 NS_QUERY_TEXT_RECT may be expensive. + // However, dispatching 2 eQueryTextRect may be expensive. // So, use tentative offset for now. offset = charAtPt.mReply.mTentativeCaretOffset; @@ -3566,15 +3566,15 @@ TSFTextStore::GetTextExt(TsViewCookie vcView, return TS_E_NOLAYOUT; } - // use NS_QUERY_TEXT_RECT to get rect in system, screen coordinates - WidgetQueryContentEvent event(true, NS_QUERY_TEXT_RECT, mWidget); + // use eQueryTextRect to get rect in system, screen coordinates + WidgetQueryContentEvent event(true, eQueryTextRect, mWidget); mWidget->InitEvent(event); event.InitForQueryTextRect(acpStart, acpEnd - acpStart); DispatchEvent(event); if (!event.mSucceeded) { MOZ_LOG(sTextStoreLog, LogLevel::Error, ("TSF: 0x%p TSFTextStore::GetTextExt() FAILED due to " - "NS_QUERY_TEXT_RECT failure", this)); + "eQueryTextRect failure", this)); return TS_E_INVALIDPOS; // but unexpected failure, maybe. } // IMEs don't like empty rects, fix here @@ -5412,8 +5412,8 @@ TSFTextStore::Content::ReplaceTextWith(LONG aStart, if (mComposition.IsComposing()) { // Emulate text insertion during compositions, because during a // composition, editor expects the whole composition string to - // be sent in NS_COMPOSITION_CHANGE, not just the inserted part. - // The actual NS_COMPOSITION_CHANGE will be sent in SetSelection + // be sent in eCompositionChange, not just the inserted part. + // The actual eCompositionChange will be sent in SetSelection // or OnUpdateComposition. MOZ_ASSERT(aStart >= mComposition.mStart); MOZ_ASSERT(aStart + aLength <= mComposition.EndOffset()); diff --git a/widget/windows/TSFTextStore.h b/widget/windows/TSFTextStore.h index 7e3c680db0..0fa09b5fbe 100644 --- a/widget/windows/TSFTextStore.h +++ b/widget/windows/TSFTextStore.h @@ -335,7 +335,7 @@ protected: // Current copy of the active composition string. Only mString is // changed during a InsertTextAtSelection call if we have a composition. // mString acts as a buffer until OnUpdateComposition is called - // and mString is flushed to editor through NS_COMPOSITION_CHANGE. + // and mString is flushed to editor through eCompositionChange. // This way all changes are updated in batches to avoid // inconsistencies/artifacts. nsString mString; diff --git a/widget/windows/WinMouseScrollHandler.cpp b/widget/windows/WinMouseScrollHandler.cpp index 070920db1a..0d6a9e983d 100644 --- a/widget/windows/WinMouseScrollHandler.cpp +++ b/widget/windows/WinMouseScrollHandler.cpp @@ -626,23 +626,23 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindowBase* aWidget, // Grab the widget, it might be destroyed by a DOM event handler. nsRefPtr kungFuDethGrip(aWidget); - WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget); + WidgetWheelEvent wheelEvent(true, eWheel, aWidget); if (mLastEventInfo.InitWheelEvent(aWidget, wheelEvent, modKeyState)) { MOZ_LOG(gMouseScrollLog, LogLevel::Info, ("MouseScroll::HandleMouseWheelMessage: dispatching " - "NS_WHEEL_WHEEL event")); + "eWheel event")); aWidget->DispatchWheelEvent(&wheelEvent); if (aWidget->Destroyed()) { MOZ_LOG(gMouseScrollLog, LogLevel::Info, ("MouseScroll::HandleMouseWheelMessage: The window was destroyed " - "by NS_WHEEL_WHEEL event")); + "by eWheel event")); mLastEventInfo.ResetTransaction(); return; } } else { MOZ_LOG(gMouseScrollLog, LogLevel::Info, - ("MouseScroll::HandleMouseWheelMessage: NS_WHEEL_WHEEL event is not " + ("MouseScroll::HandleMouseWheelMessage: eWheel event is not " "dispatched")); } } @@ -662,7 +662,7 @@ MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindowBase* aWidget ModifierKeyState modKeyState = GetModifierKeyState(aMessage); - WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget); + WidgetWheelEvent wheelEvent(true, eWheel, aWidget); double& delta = (aMessage == MOZ_WM_VSCROLL) ? wheelEvent.deltaY : wheelEvent.deltaX; int32_t& lineOrPageDelta = @@ -819,7 +819,7 @@ MouseScrollHandler::LastEventInfo::InitWheelEvent( WidgetWheelEvent& aWheelEvent, const ModifierKeyState& aModKeyState) { - MOZ_ASSERT(aWheelEvent.mMessage == NS_WHEEL_WHEEL); + MOZ_ASSERT(aWheelEvent.mMessage == eWheel); // XXX Why don't we use lParam value? We should use lParam value because // our internal message is always posted by original message handler. diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 44584849db..07e422d5cb 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -5399,8 +5399,7 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam, nsPointWin touchPoint; touchPoint = gestureinfo->ptsLocation; touchPoint.ScreenToClient(mWnd); - WidgetGestureNotifyEvent gestureNotifyEvent(true, - NS_GESTURENOTIFY_EVENT_START, this); + WidgetGestureNotifyEvent gestureNotifyEvent(true, eGestureNotify, this); gestureNotifyEvent.refPoint = LayoutDeviceIntPoint::FromUntyped(touchPoint); nsEventStatus status; DispatchEvent(&gestureNotifyEvent, status); @@ -6343,7 +6342,7 @@ bool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam) nsEventStatus status; - WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, this); + WidgetWheelEvent wheelEvent(true, eWheel, this); ModifierKeyState modifierKeyState; modifierKeyState.InitInputEvent(wheelEvent);