Bug 895274 part.193 Rename NS_COMPOSITION_CHANGE to eCompositionChange r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 11 Sep 2015 21:21:27 +0900
changeset 296314 4802505f05ad9a02184bb5ffdd541057f51ebe28
parent 296313 9f26179268e3b25496700f153b93365049dd2588
child 296315 7cf9012735c6d2a6c7d814a33f1baa54af552c15
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs895274
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 895274 part.193 Rename NS_COMPOSITION_CHANGE to eCompositionChange r=smaug
dom/events/EventNameList.h
dom/events/IMEStateManager.cpp
dom/events/TextComposition.cpp
editor/libeditor/nsEditor.cpp
editor/libeditor/nsEditorEventListener.cpp
editor/libeditor/nsPlaintextEditor.cpp
widget/ContentCache.cpp
widget/EventMessageList.h
widget/TextEventDispatcher.cpp
widget/TextEventDispatcher.h
widget/TextEvents.h
widget/WidgetEventImpl.cpp
widget/android/nsWindow.cpp
widget/cocoa/TextInputHandler.mm
widget/gtk/IMContextWrapper.cpp
widget/gtk/IMContextWrapper.h
widget/gtk/nsWindow.cpp
widget/tests/TestWinTSF.cpp
widget/windows/IMMHandler.cpp
widget/windows/IMMHandler.h
widget/windows/TSFTextStore.cpp
widget/windows/TSFTextStore.h
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -667,17 +667,17 @@ NON_IDL_EVENT(speakerforcedchange,
               eBasicEventClass)
 
 // Events that only have on* attributes on XUL elements
 
  // "text" event is legacy event for modifying composition string in nsEditor.
  // 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,
               eCompositionStart,
               EventNameType_XUL,
               eCompositionEventClass)
 NON_IDL_EVENT(compositionupdate,
               eCompositionUpdate,
--- a/dom/events/IMEStateManager.cpp
+++ b/dom/events/IMEStateManager.cpp
@@ -138,18 +138,18 @@ GetEventMessageName(EventMessage aMessag
 {
   switch (aMessage) {
     case eCompositionStart:
       return "eCompositionStart";
     case eCompositionEnd:
       return "eCompositionEnd";
     case eCompositionUpdate:
       return "eCompositionUpdate";
-    case NS_COMPOSITION_CHANGE:
-      return "NS_COMPOSITION_CHANGE";
+    case eCompositionChange:
+      return "eCompositionChange";
     case eCompositionCommitAsIs:
       return "eCompositionCommitAsIs";
     case NS_COMPOSITION_COMMIT:
       return "NS_COMPOSITION_COMMIT";
     case eSetSelection:
       return "eSetSelection";
     default:
       return "unacceptable event message";
--- a/dom/events/TextComposition.cpp
+++ b/dom/events/TextComposition.cpp
@@ -280,17 +280,17 @@ TextComposition::DispatchCompositionEven
   // string.  Therefore, we should hack it only when:
   // 1. committing string is empty string at requesting commit but the last
   //    data isn't IDEOGRAPHIC SPACE.
   // 2. non-empty string is committed at requesting cancel.
   if (!aIsSynthesized && (mIsRequestingCommit || mIsRequestingCancel)) {
     nsString* committingData = nullptr;
     switch (aCompositionEvent->mMessage) {
       case eCompositionEnd:
-      case NS_COMPOSITION_CHANGE:
+      case eCompositionChange:
       case eCompositionCommitAsIs:
       case NS_COMPOSITION_COMMIT:
         committingData = &aCompositionEvent->mData;
         break;
       default:
         NS_WARNING("Unexpected event comes during committing or "
                    "canceling composition");
         break;
@@ -304,51 +304,51 @@ TextComposition::DispatchCompositionEven
       }
     }
   }
 
   bool dispatchEvent = true;
   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)) {
     dispatchEvent = dispatchDOMTextEvent = false;
   }
 
   if (dispatchDOMTextEvent) {
     if (!MaybeDispatchCompositionUpdate(aCompositionEvent)) {
       return;
     }
   }
 
   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,
                                 aCompositionEvent, nullptr, aStatus, aCallBack);
     }
   } else {
     *aStatus = nsEventStatus_eConsumeNoDefault;
   }
@@ -620,17 +620,17 @@ TextComposition::CompositionEventDispatc
       compStart.mData = selectedText.mReply.mString;
       compStart.mFlags.mIsSynthesizedForTests =
         mTextComposition->IsSynthesizedForTests();
       IMEStateManager::DispatchCompositionEvent(mEventTarget, presContext,
                                                 &compStart, &status, nullptr,
                                                 mIsSynthesizedEvent);
       break;
     }
-    case NS_COMPOSITION_CHANGE:
+    case eCompositionChange:
     case eCompositionCommitAsIs:
     case NS_COMPOSITION_COMMIT: {
       WidgetCompositionEvent compEvent(true, mEventMessage, widget);
       if (mEventMessage != eCompositionCommitAsIs) {
         compEvent.mData = mData;
       }
       compEvent.mFlags.mIsSynthesizedForTests =
         mTextComposition->IsSynthesizedForTests();
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -249,17 +249,17 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsI
     mRootElement = do_QueryInterface(aRoot);
 
   mUpdateCount=0;
 
   // If this is an editor for <input> or <textarea>, mIMETextNode is always
   // 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;
   }
 
   /* Show the caret */
   selCon->SetCaretReadOnly(false);
   selCon->SetDisplaySelection(nsISelectionController::SELECTION_ON);
 
@@ -5157,17 +5157,17 @@ nsEditor::IsAcceptableInputEvent(nsIDOME
   switch (widgetEvent->mMessage) {
     case eUnidentifiedEvent:
       // If events are not created with proper event interface, their message
       // are initialized with eUnidentifiedEvent.  Let's ignore such event.
       return false;
     case eCompositionStart:
     case eCompositionEnd:
     case eCompositionUpdate:
-    case NS_COMPOSITION_CHANGE:
+    case eCompositionChange:
     case eCompositionCommitAsIs:
       // Don't allow composition events whose internal event are not
       // WidgetCompositionEvent.
       widgetGUIEvent = aEvent->GetInternalNSEvent()->AsCompositionEvent();
       needsWidget = true;
       break;
     default:
       break;
--- a/editor/libeditor/nsEditorEventListener.cpp
+++ b/editor/libeditor/nsEditorEventListener.cpp
@@ -455,17 +455,17 @@ nsEditorEventListener::HandleEvent(nsIDO
     }
     // focus
     case eFocus:
       return Focus(aEvent);
     // blur
     case eBlur:
       return Blur(aEvent);
     // text
-    case NS_COMPOSITION_CHANGE:
+    case eCompositionChange:
       return HandleText(aEvent);
     // compositionstart
     case eCompositionStart:
       return HandleStartComposition(aEvent);
     // compositionend
     case eCompositionEnd:
       HandleEndComposition(aEvent);
       return NS_OK;
--- a/editor/libeditor/nsPlaintextEditor.cpp
+++ b/editor/libeditor/nsPlaintextEditor.cpp
@@ -840,18 +840,18 @@ nsPlaintextEditor::BeginIMEComposition(W
 nsresult
 nsPlaintextEditor::UpdateIMEComposition(nsIDOMEvent* aDOMTextEvent)
 {
   MOZ_ASSERT(aDOMTextEvent, "aDOMTextEvent must not be nullptr");
 
   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);
 
   nsCOMPtr<nsIPresShell> ps = GetPresShell();
   NS_ENSURE_TRUE(ps, NS_ERROR_NOT_INITIALIZED);
 
   nsRefPtr<Selection> selection = GetSelection();
   NS_ENSURE_STATE(selection);
--- a/widget/ContentCache.cpp
+++ b/widget/ContentCache.cpp
@@ -28,18 +28,18 @@ GetEventMessageName(EventMessage aMessag
 {
   switch (aMessage) {
     case eCompositionStart:
       return "eCompositionStart";
     case eCompositionEnd:
       return "eCompositionEnd";
     case eCompositionUpdate:
       return "eCompositionUpdate";
-    case NS_COMPOSITION_CHANGE:
-      return "NS_COMPOSITION_CHANGE";
+    case eCompositionChange:
+      return "eCompositionChange";
     case eCompositionCommitAsIs:
       return "eCompositionCommitAsIs";
     case NS_COMPOSITION_COMMIT:
       return "NS_COMPOSITION_COMMIT";
     case eSetSelection:
       return "eSetSelection";
     default:
       return "unacceptable event message";
@@ -870,17 +870,17 @@ ContentCacheInParent::OnCompositionEvent
     mPendingEventsNeedingAck++;
     return true;
   }
 
   // XXX Why do we ignore following composition events here?
   //     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()
   // return value.
   if (mRequestedToCommitOrCancelComposition) {
     mCommitStringByRequest = aEvent.mData;
     mCompositionEventsDuringRequest++;
     return false;
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -148,34 +148,34 @@ NS_EVENT_MESSAGE(eUnidentifiedEvent,    
 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
 // is available.
 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(eCompositionUpdate,     eCompositionEventFirst + 2)
-// NS_COMPOSITION_CHANGE is the message for representing a change of
+// 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,  eCompositionEventFirst + 3)
+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,
+// eCompositionChange without clause information.  After that,
 // 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
 // composition string with its mData value.  TextComposition will dispatch this
-// event to the DOM tree as NS_COMPOSITION_CHANGE without clause information.
+// 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)
 
 // Following events are defined for deprecated DOM events which are using
 // InternalUIEvent class.
 NS_EVENT_MESSAGE(eLegacyUIEventFirst,   2500)
 // DOMActivate (mapped with the DOM event and used internally)
--- a/widget/TextEventDispatcher.cpp
+++ b/widget/TextEventDispatcher.cpp
@@ -536,17 +536,17 @@ TextEventDispatcher::PendingComposition:
       return NS_ERROR_ILLEGAL_VALUE;
     }
     EnsureClauseArray();
     mClauses->AppendElement(mCaret);
   }
 
   nsRefPtr<TextEventDispatcher> kungFuDeathGrip(aDispatcher);
   nsCOMPtr<nsIWidget> widget(aDispatcher->mWidget);
-  WidgetCompositionEvent compChangeEvent(true, NS_COMPOSITION_CHANGE, widget);
+  WidgetCompositionEvent compChangeEvent(true, eCompositionChange, widget);
   aDispatcher->InitEvent(compChangeEvent);
   compChangeEvent.mData = mString;
   if (mClauses) {
     MOZ_ASSERT(!mClauses->IsEmpty(),
                "mClauses must be non-empty array when it's not nullptr");
     compChangeEvent.mRanges = mClauses;
   }
 
--- a/widget/TextEventDispatcher.h
+++ b/widget/TextEventDispatcher.h
@@ -107,17 +107,17 @@ public:
    *                        string.  Otherwise, commits the composition with
    *                        this value.
    */
    nsresult CommitComposition(nsEventStatus& aStatus,
                               const nsAString* aCommitString = nullptr);
 
   /**
    * 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.
    */
   nsresult SetPendingCompositionString(const nsAString& aString)
   {
     return mPendingComposition.SetString(aString);
   }
 
@@ -250,17 +250,17 @@ private:
   // mListener is a weak reference to TextEventDispatcherListener.  That might
   // be referred by JS.  Therefore, the listener might be difficult to release
   // itself if this is a strong reference.  Additionally, it's difficult to
   // check if a method to uninstall the listener is called by valid instance.
   // So, using weak reference is the best way in this case.
   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
   {
   public:
     PendingComposition();
     nsresult SetString(const nsAString& aString);
     nsresult AppendClause(uint32_t aLength, uint32_t aAttribute);
--- a/widget/TextEvents.h
+++ b/widget/TextEvents.h
@@ -429,17 +429,17 @@ public:
 
   uint32_t RangeCount() const
   {
     return mRanges ? mRanges->Length() : 0;
   }
 
   bool CausesDOMTextEvent() const
   {
-    return mMessage == NS_COMPOSITION_CHANGE ||
+    return mMessage == eCompositionChange ||
            mMessage == NS_COMPOSITION_COMMIT ||
            mMessage == eCompositionCommitAsIs;
   }
 
   bool CausesDOMCompositionEndEvent() const
   {
     return mMessage == eCompositionEnd ||
            mMessage == NS_COMPOSITION_COMMIT ||
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -134,17 +134,17 @@ WidgetEvent::HasKeyEventMessage() const
 
 bool
 WidgetEvent::HasIMEEventMessage() const
 {
   switch (mMessage) {
     case eCompositionStart:
     case eCompositionEnd:
     case eCompositionUpdate:
-    case NS_COMPOSITION_CHANGE:
+    case eCompositionChange:
     case eCompositionCommitAsIs:
     case NS_COMPOSITION_COMMIT:
       return true;
     default:
       return false;
   }
 }
 
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1839,17 +1839,17 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *
                  * one, so we manually generate a notification. */
                 IMEChange dummyChange;
                 dummyChange.mStart = ae->Start();
                 dummyChange.mOldEnd = dummyChange.mNewEnd = ae->End();
                 AddIMETextChange(dummyChange);
             }
 
             {
-                WidgetCompositionEvent event(true, NS_COMPOSITION_CHANGE, this);
+                WidgetCompositionEvent event(true, eCompositionChange, this);
                 InitEvent(event, nullptr);
                 event.mData = ae->Characters();
 
                 // Include proper text ranges to make the editor happy.
                 TextRange range;
                 range.mStartOffset = 0;
                 range.mEndOffset = event.mData.Length();
                 range.mRangeType = NS_TEXTRANGE_RAWINPUT;
@@ -1941,17 +1941,17 @@ nsWindow::OnIMEEvent(AndroidGeckoEvent *
 
                 Selection updates are masked so the result of
                   temporary events are not passed on to Java
             */
             AutoIMEMask selMask(mIMEMaskSelectionUpdate);
             const auto composition(GetIMEComposition());
             MOZ_ASSERT(!composition || !composition->IsEditorHandlingEvent());
 
-            WidgetCompositionEvent event(true, NS_COMPOSITION_CHANGE, this);
+            WidgetCompositionEvent event(true, eCompositionChange, this);
             InitEvent(event, nullptr);
 
             event.mRanges = new TextRangeArray();
             mIMERanges.swap(event.mRanges);
 
             if (!composition ||
                 uint32_t(ae->Start()) !=
                     composition->NativeOffsetOfStartComposition() ||
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -2709,17 +2709,17 @@ IMEInputHandler::DispatchCompositionChan
      GetCharacters([aAttrString string]),
      aSelectedRange.location, aSelectedRange.length,
      TrueOrFalse(Destroyed())));
 
   NS_ENSURE_TRUE(!Destroyed(), false);
 
   nsRefPtr<IMEInputHandler> kungFuDeathGrip(this);
 
-  WidgetCompositionEvent compositionChangeEvent(true, NS_COMPOSITION_CHANGE,
+  WidgetCompositionEvent compositionChangeEvent(true, eCompositionChange,
                                                 mWidget);
   compositionChangeEvent.time = PR_IntervalNow();
   compositionChangeEvent.mData = aText;
   compositionChangeEvent.mRanges =
     CreateTextRangeArray(aAttrString, aSelectedRange);
   return DispatchEvent(compositionChangeEvent);
 }
 
--- a/widget/gtk/IMContextWrapper.cpp
+++ b/widget/gtk/IMContextWrapper.cpp
@@ -1359,17 +1359,17 @@ IMContextWrapper::DispatchCompositionCha
             // XXX How should we behave in this case??
         } else {
             // XXX We should assume, for now, any web applications don't change
             //     selection at handling this compositionchange event.
             mCompositionStart = mSelection.mOffset;
         }
     }
 
-    WidgetCompositionEvent compositionChangeEvent(true, NS_COMPOSITION_CHANGE,
+    WidgetCompositionEvent compositionChangeEvent(true, eCompositionChange,
                                                   mLastFocusedWindow);
     InitEvent(compositionChangeEvent);
 
     uint32_t targetOffset = mCompositionStart;
 
     compositionChangeEvent.mData =
       mDispatchedCompositionString = aCompositionString;
 
--- a/widget/gtk/IMContextWrapper.h
+++ b/widget/gtk/IMContextWrapper.h
@@ -252,17 +252,17 @@ protected:
     // a keydown event if the composition start is caused by a native
     // keypress event.  If this is true, the keydown event has been dispatched.
     // Then, DispatchCompositionStart() doesn't dispatch keydown event.
     bool mKeyDownEventWasSent;
     // mIsDeletingSurrounding is true while OnDeleteSurroundingNative() is
     // 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
     // before key down
     bool mSetCursorPositionOnKeyEvent;
 
     // sLastFocusedContext is a pointer to the last focused instance of this
     // class.  When a instance is destroyed and sLastFocusedContext refers it,
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3074,17 +3074,17 @@ nsWindow::OnKeyPressEvent(GdkEventKey *a
         // If the character code is in the BMP, send the key press event.
         // Otherwise, send a compositionchange event with the equivalent UTF-16
         // string.
         if (IS_IN_BMP(event.charCode)) {
             status = DispatchInputEvent(&event);
         }
         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);
             textString[2] = 0;
             compositionChangeEvent.mData = textString;
             compositionChangeEvent.time = event.time;
             compositionChangeEvent.timeStamp = GetEventTimeStamp(aEvent->time);
             DispatchEvent(&compositionChangeEvent, status);
--- a/widget/tests/TestWinTSF.cpp
+++ b/widget/tests/TestWinTSF.cpp
@@ -1960,17 +1960,17 @@ TestApp::TestText(void)
   HRESULT hr;
 
   /* If these fail the cause is probably one or more of:
    * nsTextStore::GetText not sending eQueryTextContent
    * eQueryTextContent not handled by ContentEventHandler
    * 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()) {
     fail("TestText: GetFocusedStore returns null #1");
     return false;
   }
 
   // Get all text
--- a/widget/windows/IMMHandler.cpp
+++ b/widget/windows/IMMHandler.cpp
@@ -1892,17 +1892,17 @@ IMMHandler::DispatchCompositionChangeEve
     SetIMERelatedWindowsPos(aWindow, aContext);
     return;
   }
 
   nsRefPtr<nsWindow> kungFuDeathGrip(aWindow);
 
   nsIntPoint point(0, 0);
 
-  WidgetCompositionEvent event(true, NS_COMPOSITION_CHANGE, aWindow);
+  WidgetCompositionEvent event(true, eCompositionChange, aWindow);
 
   aWindow->InitEvent(event, &point);
 
   event.mRanges = CreateTextRangeArray();
   event.mData = mCompositionString;
 
   aWindow->DispatchWindowEvent(&event);
 
--- a/widget/windows/IMMHandler.h
+++ b/widget/windows/IMMHandler.h
@@ -348,17 +348,17 @@ protected:
    *  aLength can be null (default), but aOffset must not be null.
    *
    *  The aOffset value is offset in the contents.  So, when you need offset
    *  in the composition string, you need to subtract mCompositionStart from it.
    */
   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.
    *
    * @param aWindow     The window which has the composition.
    * @param aContext    Native IME context which has the composition.
    */
   void DispatchCompositionChangeEvent(nsWindow* aWindow,
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -1758,29 +1758,29 @@ TSFTextStore::FlushPendingActions()
         }
 
         action.mData.ReplaceSubstring(NS_LITERAL_STRING("\r\n"),
                                       NS_LITERAL_STRING("\n"));
 
         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;
         if (action.mRanges->IsEmpty()) {
           TextRange wholeRange;
           wholeRange.mStartOffset = 0;
           wholeRange.mEndOffset = compositionChange.mData.Length();
           wholeRange.mRangeType = NS_TEXTRANGE_RAWINPUT;
           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.
         if (compositionChange.CausesDOMTextEvent()) {
           mDeferClearingLockedContent = true;
         }
         DispatchEvent(compositionChange);
         // Be aware, the mWidget might already have been destroyed.
@@ -2471,17 +2471,17 @@ TSFTextStore::RecordCompositionUpdateAct
   }
 
   // Getting display attributes is *really* complicated!
   // We first get the context and the property objects to query for
   // attributes, but since a big range can have a variety of values for
   // 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<ITfProperty> attrPropetry;
   HRESULT hr = mContext->GetProperty(GUID_PROP_ATTRIBUTE,
                                      getter_AddRefs(attrPropetry));
   if (FAILED(hr) || !attrPropetry) {
     MOZ_LOG(sTextStoreLog, LogLevel::Error,
            ("TSF: 0x%p   TSFTextStore::RecordCompositionUpdateAction() FAILED "
             "due to mContext->GetProperty() failure", this));
@@ -2520,17 +2520,17 @@ TSFTextStore::RecordCompositionUpdateAct
   action->mData = mComposition.mString;
   // The ranges might already have been initialized, however, if this is
   // called again, that means we need to overwrite the ranges with current
   // information.
   action->mRanges->Clear();
 
   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;
   action->mRanges->AppendElement(newRange);
 
   nsRefPtr<ITfRange> range;
   while (S_OK == enumRanges->Next(1, getter_AddRefs(range), nullptr) && range) {
 
@@ -5430,18 +5430,18 @@ TSFTextStore::Content::ReplaceTextWith(L
   const nsDependentSubstring replacedString =
     GetSubstring(static_cast<uint32_t>(aStart),
                  static_cast<uint32_t>(aLength));
   if (aReplaceString != replacedString) {
     uint32_t firstDifferentOffset = mMinTextModifiedOffset;
     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());
       mComposition.mString.Replace(
         static_cast<uint32_t>(aStart - mComposition.mStart),
         static_cast<uint32_t>(aLength), aReplaceString);
       // TIP may set composition string twice or more times during a document
       // lock.  Therefore, we should compute the first difference offset with
--- a/widget/windows/TSFTextStore.h
+++ b/widget/windows/TSFTextStore.h
@@ -330,17 +330,17 @@ protected:
   {
   public:
     // nullptr if no composition is active, otherwise the current composition
     nsRefPtr<ITfCompositionView> mView;
 
     // 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;
 
     // The start of the current active composition, in ACP offsets
     LONG mStart;
 
     bool IsComposing() const