diff --git a/dom/events/IMEStateManager.cpp b/dom/events/IMEStateManager.cpp index 07741835852..1a116851df2 100644 --- a/dom/events/IMEStateManager.cpp +++ b/dom/events/IMEStateManager.cpp @@ -147,8 +147,8 @@ GetEventMessageName(EventMessage aMessage) return "eCompositionChange"; case eCompositionCommitAsIs: return "eCompositionCommitAsIs"; - case NS_COMPOSITION_COMMIT: - return "NS_COMPOSITION_COMMIT"; + case eCompositionCommit: + return "eCompositionCommit"; case eSetSelection: return "eSetSelection"; default: diff --git a/dom/events/TextComposition.cpp b/dom/events/TextComposition.cpp index 35e11424137..b8c3d8d757c 100644 --- a/dom/events/TextComposition.cpp +++ b/dom/events/TextComposition.cpp @@ -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; } @@ -287,7 +287,7 @@ TextComposition::DispatchCompositionEvent( case eCompositionEnd: case eCompositionChange: case eCompositionCommitAsIs: - case NS_COMPOSITION_COMMIT: + case eCompositionCommit: committingData = &aCompositionEvent->mData; break; default: @@ -493,7 +493,7 @@ TextComposition::RequestToCommit(nsIWidget* aWidget, bool aDiscard) DispatchCompositionEventRunnable(eCompositionCommitAsIs, EmptyString(), true); } else { - DispatchCompositionEventRunnable(NS_COMPOSITION_COMMIT, data, true); + DispatchCompositionEventRunnable(eCompositionCommit, data, true); } return NS_OK; } @@ -627,7 +627,7 @@ TextComposition::CompositionEventDispatcher::Run() } case eCompositionChange: case eCompositionCommitAsIs: - case NS_COMPOSITION_COMMIT: { + case eCompositionCommit: { WidgetCompositionEvent compEvent(true, mEventMessage, widget); if (mEventMessage != eCompositionCommitAsIs) { compEvent.mData = mData; diff --git a/widget/ContentCache.cpp b/widget/ContentCache.cpp index 8923c6e3c7a..4b67b35ec42 100644 --- a/widget/ContentCache.cpp +++ b/widget/ContentCache.cpp @@ -37,8 +37,8 @@ GetEventMessageName(EventMessage aMessage) return "eCompositionChange"; case eCompositionCommitAsIs: return "eCompositionCommitAsIs"; - case NS_COMPOSITION_COMMIT: - return "NS_COMPOSITION_COMMIT"; + case eCompositionCommit: + return "eCompositionCommit"; case eSetSelection: return "eSetSelection"; default: diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h index 4db5b29a312..35945b5510c 100644 --- a/widget/EventMessageList.h +++ b/widget/EventMessageList.h @@ -148,7 +148,7 @@ NS_EVENT_MESSAGE(eUnidentifiedEvent, 2000) 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 NS_COMPOSITION_COMMIT +// This event should NOT be dispatched from widget if eCompositionCommit // is available. NS_EVENT_MESSAGE(eCompositionEnd, eCompositionEventFirst + 1) // eCompositionUpdate is the message for DOM compositionupdate event. @@ -168,12 +168,12 @@ NS_EVENT_MESSAGE(eCompositionChange, eCompositionEventFirst + 3) // eCompositionEnd will be dispatched automatically. // Its mData and mRanges should be empty and nullptr. NS_EVENT_MESSAGE(eCompositionCommitAsIs, eCompositionEventFirst + 4) -// NS_COMPOSITION_COMMIT is the message for representing a commit of +// 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 eCompositionChange without clause information. // After that, eCompositionEnd will be dispatched automatically. // Its mRanges should be nullptr. -NS_EVENT_MESSAGE(NS_COMPOSITION_COMMIT, eCompositionEventFirst + 5) +NS_EVENT_MESSAGE(eCompositionCommit, eCompositionEventFirst + 5) // Following events are defined for deprecated DOM events which are using // InternalUIEvent class. diff --git a/widget/PuppetWidget.cpp b/widget/PuppetWidget.cpp index 8b009139e03..3236b2a74a6 100644 --- a/widget/PuppetWidget.cpp +++ b/widget/PuppetWidget.cpp @@ -575,8 +575,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 8d29836b643..adc450cfdd9 100644 --- a/widget/TextEventDispatcher.cpp +++ b/widget/TextEventDispatcher.cpp @@ -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 : + 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); diff --git a/widget/TextEvents.h b/widget/TextEvents.h index 15b0c9999a6..44dab1b6294 100644 --- a/widget/TextEvents.h +++ b/widget/TextEvents.h @@ -435,20 +435,20 @@ public: bool CausesDOMTextEvent() const { return mMessage == eCompositionChange || - mMessage == NS_COMPOSITION_COMMIT || + mMessage == eCompositionCommit || mMessage == eCompositionCommitAsIs; } bool CausesDOMCompositionEndEvent() const { return mMessage == eCompositionEnd || - mMessage == NS_COMPOSITION_COMMIT || + mMessage == eCompositionCommit || mMessage == eCompositionCommitAsIs; } bool IsFollowedByCompositionEnd() const { - return mOriginalMessage == NS_COMPOSITION_COMMIT || + return mOriginalMessage == eCompositionCommit || mOriginalMessage == eCompositionCommitAsIs; } }; diff --git a/widget/WidgetEventImpl.cpp b/widget/WidgetEventImpl.cpp index fe5de838e20..381982250f5 100644 --- a/widget/WidgetEventImpl.cpp +++ b/widget/WidgetEventImpl.cpp @@ -141,7 +141,7 @@ WidgetEvent::HasIMEEventMessage() const case eCompositionUpdate: case eCompositionChange: case eCompositionCommitAsIs: - case NS_COMPOSITION_COMMIT: + case eCompositionCommit: return true; default: return false; diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index de9e1301b1d..fa0957be5bc 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -2053,7 +2053,7 @@ nsWindow::NotifyIMEInternal(const IMENotification& aIMENotification) nsRefPtr kungFuDeathGrip(this); WidgetCompositionEvent compositionCommitEvent( - true, NS_COMPOSITION_COMMIT, this); + true, eCompositionCommit, this); InitEvent(compositionCommitEvent, nullptr); // Dispatch it with empty mData value for canceling the // composition diff --git a/widget/cocoa/TextInputHandler.mm b/widget/cocoa/TextInputHandler.mm index 8ea5821b738..839699dd5ca 100644 --- a/widget/cocoa/TextInputHandler.mm +++ b/widget/cocoa/TextInputHandler.mm @@ -2740,7 +2740,7 @@ IMEInputHandler::DispatchCompositionCommitEvent(const nsAString* aCommitString) nsRefPtr kungFuDeathGrip(this); EventMessage message = - aCommitString ? NS_COMPOSITION_COMMIT : eCompositionCommitAsIs; + aCommitString ? eCompositionCommit : eCompositionCommitAsIs; WidgetCompositionEvent compositionCommitEvent(true, message, mWidget); compositionCommitEvent.time = PR_IntervalNow(); if (aCommitString) { diff --git a/widget/gtk/IMContextWrapper.cpp b/widget/gtk/IMContextWrapper.cpp index 69c1f730248..cf0d68b0354 100644 --- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -1439,7 +1439,7 @@ IMContextWrapper::DispatchCompositionCommitEvent( nsRefPtr lastFocusedWindow(mLastFocusedWindow); - EventMessage message = aCommitString ? NS_COMPOSITION_COMMIT : + EventMessage message = aCommitString ? eCompositionCommit : eCompositionCommitAsIs; mCompositionState = eCompositionState_NotComposing; mCompositionStart = UINT32_MAX; @@ -1449,7 +1449,7 @@ IMContextWrapper::DispatchCompositionCommitEvent( WidgetCompositionEvent compositionCommitEvent(true, message, mLastFocusedWindow); InitEvent(compositionCommitEvent); - if (message == NS_COMPOSITION_COMMIT) { + if (message == eCompositionCommit) { compositionCommitEvent.mData = *aCommitString; } diff --git a/widget/windows/IMMHandler.cpp b/widget/windows/IMMHandler.cpp index 5d92c9df570..35ac6f72398 100644 --- a/widget/windows/IMMHandler.cpp +++ b/widget/windows/IMMHandler.cpp @@ -1525,7 +1525,7 @@ IMMHandler::HandleEndComposition(nsWindow* aWindow, } EventMessage message = - aCommitString ? NS_COMPOSITION_COMMIT : eCompositionCommitAsIs; + aCommitString ? eCompositionCommit : eCompositionCommitAsIs; WidgetCompositionEvent compositionCommitEvent(true, message, aWindow); nsIntPoint point(0, 0); aWindow->InitEvent(compositionCommitEvent, &point); diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp index d002f3b7661..6e34a456634 100644 --- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -1798,11 +1798,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.