Bug 895274 part.10 Rename NS_KEY_UP to eKeyUp r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 29 Aug 2015 08:58:27 +0900
changeset 294227 83b87aa188ab9c744697b87eb0c47c8a13d5babc
parent 294226 6e12f5164cb9f833ec9cbb958131aadb530e164c
child 294228 4a2797061277a5a2a3ba878144431a3b2f50392f
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.10 Rename NS_KEY_UP to eKeyUp r=smaug
dom/base/TextInputProcessor.cpp
dom/base/nsContentUtils.cpp
dom/events/Event.cpp
dom/events/EventNameList.h
dom/events/EventStateManager.cpp
dom/events/KeyboardEvent.cpp
dom/events/WheelHandlingHelper.cpp
dom/html/HTMLButtonElement.cpp
dom/html/HTMLInputElement.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
editor/libeditor/nsEditorEventListener.cpp
gfx/layers/apz/src/APZCTreeManager.cpp
layout/base/AccessibleCaretEventHub.cpp
layout/base/TouchCaret.cpp
layout/base/nsPresShell.cpp
layout/xul/nsButtonBoxFrame.cpp
widget/EventMessageList.h
widget/TextEventDispatcher.cpp
widget/TextEventDispatcher.h
widget/WidgetEventImpl.cpp
widget/android/nsWindow.cpp
widget/cocoa/TextInputHandler.mm
widget/gonk/nsAppShell.cpp
widget/gtk/nsGtkKeyUtils.cpp
widget/gtk/nsWindow.cpp
widget/nsBaseWidget.cpp
widget/qt/nsWindow.cpp
widget/windows/KeyboardLayout.cpp
--- a/dom/base/TextInputProcessor.cpp
+++ b/dom/base/TextInputProcessor.cpp
@@ -915,18 +915,17 @@ TextInputProcessor::KeyupInternal(const 
   nsRefPtr<TextEventDispatcher> kungfuDeathGrip(mDispatcher);
   rv = IsValidStateForComposition();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   nsEventStatus status = aDoDefault ? nsEventStatus_eIgnore :
                                       nsEventStatus_eConsumeNoDefault;
-  mDispatcher->DispatchKeyboardEvent(NS_KEY_UP, keyEvent, status,
-                                     GetDispatchTo());
+  mDispatcher->DispatchKeyboardEvent(eKeyUp, keyEvent, status, GetDispatchTo());
   aDoDefault = (status != nsEventStatus_eConsumeNoDefault);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TextInputProcessor::GetModifierState(const nsAString& aModifierKeyName,
                                      bool* aActive)
 {
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -7721,17 +7721,17 @@ nsContentUtils::SendKeyEvent(nsIWidget* 
   // get the widget to send the event to
   if (!aWidget)
     return NS_ERROR_FAILURE;
 
   EventMessage msg;
   if (aType.EqualsLiteral("keydown"))
     msg = NS_KEY_DOWN;
   else if (aType.EqualsLiteral("keyup"))
-    msg = NS_KEY_UP;
+    msg = eKeyUp;
   else if (aType.EqualsLiteral("keypress"))
     msg = eKeyPress;
   else
     return NS_ERROR_FAILURE;
 
   WidgetKeyboardEvent event(true, msg, aWidget);
   event.modifiers = GetWidgetModifiers(aModifiers);
 
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -773,17 +773,17 @@ Event::GetEventPopupControlState(WidgetE
       case eKeyPress:
         // return key on focused button. see note at NS_MOUSE_CLICK.
         if (key == nsIDOMKeyEvent::DOM_VK_RETURN) {
           abuse = openAllowed;
         } else if (PopupAllowedForEvent("keypress")) {
           abuse = openControlled;
         }
         break;
-      case NS_KEY_UP :
+      case eKeyUp:
         // space key on focused button. see note at NS_MOUSE_CLICK.
         if (key == nsIDOMKeyEvent::DOM_VK_SPACE) {
           abuse = openAllowed;
         } else if (PopupAllowedForEvent("keyup")) {
           abuse = openControlled;
         }
         break;
       case NS_KEY_DOWN :
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -230,17 +230,17 @@ EVENT(keydown,
       NS_KEY_DOWN,
       EventNameType_HTMLXUL,
       eKeyboardEventClass)
 EVENT(keypress,
       eKeyPress,
       EventNameType_HTMLXUL,
       eKeyboardEventClass)
 EVENT(keyup,
-      NS_KEY_UP,
+      eKeyUp,
       EventNameType_HTMLXUL,
       eKeyboardEventClass)
 NON_IDL_EVENT(mozbrowserbeforekeydown,
               NS_KEY_BEFORE_DOWN,
               EventNameType_None,
               eBeforeAfterKeyboardEventClass)
 NON_IDL_EVENT(mozbrowserafterkeydown,
               NS_KEY_AFTER_DOWN,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -682,17 +682,17 @@ EventStateManager::PreHandleEvent(nsPres
                         eAccessKeyProcessingNormal, modifierMask);
       }
     }
     // then fall through...
   case NS_KEY_BEFORE_DOWN:
   case NS_KEY_DOWN:
   case NS_KEY_AFTER_DOWN:
   case NS_KEY_BEFORE_UP:
-  case NS_KEY_UP:
+  case eKeyUp:
   case NS_KEY_AFTER_UP:
     {
       nsIContent* content = GetFocusedContent();
       if (content)
         mCurrentTargetContent = content;
 
       // NOTE: Don't refer TextComposition::IsComposing() since DOM Level 3
       //       Events defines that KeyboardEvent.isComposing is true when it's
@@ -3301,17 +3301,17 @@ EventStateManager::PostHandleEvent(nsPre
     }
   case NS_DRAGDROP_EXIT:
      // make sure to fire the enter and exit_synth events after the
      // NS_DRAGDROP_EXIT event, otherwise we'll clean up too early
     GenerateDragDropEnterExit(presContext, aEvent->AsDragEvent());
     break;
 
   case NS_KEY_BEFORE_UP:
-  case NS_KEY_UP:
+  case eKeyUp:
   case NS_KEY_AFTER_UP:
     break;
 
   case eKeyPress:
     {
       WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
       PostHandleKeyboardEvent(keyEvent, *aStatus, dispatchedToContentProcess);
     }
--- a/dom/events/KeyboardEvent.cpp
+++ b/dom/events/KeyboardEvent.cpp
@@ -152,17 +152,17 @@ KeyboardEvent::CharCode()
     return mEvent->AsKeyboardEvent()->charCode;
   }
 
   switch (mEvent->mMessage) {
   case NS_KEY_BEFORE_DOWN:
   case NS_KEY_DOWN:
   case NS_KEY_AFTER_DOWN:
   case NS_KEY_BEFORE_UP:
-  case NS_KEY_UP:
+  case eKeyUp:
   case NS_KEY_AFTER_UP:
     return 0;
   case eKeyPress:
     return mEvent->AsKeyboardEvent()->charCode;
   default:
     break;
   }
   return 0;
@@ -198,17 +198,17 @@ KeyboardEvent::Which()
     return mInitializedWhichValue;
   }
 
   switch (mEvent->mMessage) {
     case NS_KEY_BEFORE_DOWN:
     case NS_KEY_DOWN:
     case NS_KEY_AFTER_DOWN:
     case NS_KEY_BEFORE_UP:
-    case NS_KEY_UP:
+    case eKeyUp:
     case NS_KEY_AFTER_UP:
       return KeyCode();
     case eKeyPress:
       //Special case for 4xp bug 62878.  Try to make value of which
       //more closely mirror the values that 4.x gave for RETURN and BACKSPACE
       {
         uint32_t keyCode = mEvent->AsKeyboardEvent()->keyCode;
         if (keyCode == NS_VK_RETURN || keyCode == NS_VK_BACK) {
--- a/dom/events/WheelHandlingHelper.cpp
+++ b/dom/events/WheelHandlingHelper.cpp
@@ -203,17 +203,17 @@ WheelTransaction::OnEvent(WidgetEvent* a
         // checked later
         if (!sMouseMoved && OutOfTime(sTime, GetIgnoreMoveDelayTime())) {
           sMouseMoved = PR_IntervalToMilliseconds(PR_IntervalNow());
         }
       }
       return;
     }
     case eKeyPress:
-    case NS_KEY_UP:
+    case eKeyUp:
     case NS_KEY_DOWN:
     case NS_MOUSE_BUTTON_UP:
     case NS_MOUSE_BUTTON_DOWN:
     case NS_MOUSE_DOUBLECLICK:
     case NS_MOUSE_CLICK:
     case NS_CONTEXTMENU:
     case NS_DRAGDROP_DROP:
       EndTransaction();
--- a/dom/html/HTMLButtonElement.cpp
+++ b/dom/html/HTMLButtonElement.cpp
@@ -278,25 +278,25 @@ HTMLButtonElement::PostHandleEvent(Event
     // the pending ones that were created during the handler
     // will be flushed or forgoten.
     mForm->OnSubmitClickEnd();
   }
 
   if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
     switch (aVisitor.mEvent->mMessage) {
       case eKeyPress:
-      case NS_KEY_UP:
+      case eKeyUp:
         {
           // For backwards compat, trigger buttons with space or enter
           // (bug 25300)
           WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
           if ((keyEvent->keyCode == NS_VK_RETURN &&
                eKeyPress == aVisitor.mEvent->mMessage) ||
               (keyEvent->keyCode == NS_VK_SPACE &&
-               NS_KEY_UP == aVisitor.mEvent->mMessage)) {
+               eKeyUp == aVisitor.mEvent->mMessage)) {
             nsEventStatus status = nsEventStatus_eIgnore;
 
             WidgetMouseEvent event(aVisitor.mEvent->mFlags.mIsTrusted,
                                    NS_MOUSE_CLICK, nullptr,
                                    WidgetMouseEvent::eReal);
             event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD;
             EventDispatcher::Dispatch(static_cast<nsIContent*>(this),
                                       aVisitor.mPresContext, &event, nullptr,
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -3249,17 +3249,17 @@ HTMLInputElement::PreHandleEvent(EventCh
         // Our frame's nested <input type=text> will be invalidated when it
         // loses focus, but since we are also native themed we need to make
         // sure that our entire area is repainted since any focus highlight
         // from the theme should be removed from us (the repainting of the
         // sub-area occupied by the anon text control is not enough to do
         // that).
         frame->InvalidateFrame();
       }
-    } else if (aVisitor.mEvent->mMessage == NS_KEY_UP) {
+    } else if (aVisitor.mEvent->mMessage == eKeyUp) {
       WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
       if ((keyEvent->keyCode == NS_VK_UP || keyEvent->keyCode == NS_VK_DOWN) &&
           !(keyEvent->IsShift() || keyEvent->IsControl() ||
             keyEvent->IsAlt() || keyEvent->IsMeta() ||
             keyEvent->IsAltGraph() || keyEvent->IsFn() ||
             keyEvent->IsOS())) {
         // The up/down arrow key events fire 'change' events when released
         // so that at the end of a series of up/down arrow key repeat events
@@ -3770,24 +3770,24 @@ HTMLInputElement::PostHandleEvent(EventC
                 }
               }
             }
           }
           break;
         }
 
         case eKeyPress:
-        case NS_KEY_UP:
+        case eKeyUp:
         {
           // For backwards compat, trigger checks/radios/buttons with
           // space or enter (bug 25300)
           WidgetKeyboardEvent* keyEvent = aVisitor.mEvent->AsKeyboardEvent();
           if ((aVisitor.mEvent->mMessage == eKeyPress &&
                keyEvent->keyCode == NS_VK_RETURN) ||
-              (aVisitor.mEvent->mMessage == NS_KEY_UP &&
+              (aVisitor.mEvent->mMessage == eKeyUp &&
                keyEvent->keyCode == NS_VK_SPACE)) {
             switch(mType) {
               case NS_FORM_INPUT_CHECKBOX:
               case NS_FORM_INPUT_RADIO:
               {
                 // Checkbox and Radio try to submit on Enter press
                 if (keyEvent->keyCode != NS_VK_SPACE) {
                   MaybeSubmitForm(aVisitor.mPresContext);
@@ -3931,17 +3931,17 @@ HTMLInputElement::PostHandleEvent(EventC
                   newValue = value - std::max(step, (maximum - minimum) / Decimal(10));
                   break;
               }
               SetValueOfRangeForUserEvent(newValue);
               aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
             }
           }
 
-        } break; // eKeyPress || NS_KEY_UP
+        } break; // eKeyPress || eKeyUp
 
         case NS_MOUSE_BUTTON_DOWN:
         case NS_MOUSE_BUTTON_UP:
         case NS_MOUSE_DOUBLECLICK:
         {
           // cancel all of these events for buttons
           //XXXsmaug Why?
           WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -1824,17 +1824,17 @@ CocoaEventTypeForEvent(const WidgetGUIEv
       return NPCocoaEventMouseMoved;
     }
     case NS_MOUSE_BUTTON_DOWN:
       return NPCocoaEventMouseDown;
     case NS_MOUSE_BUTTON_UP:
       return NPCocoaEventMouseUp;
     case NS_KEY_DOWN:
       return NPCocoaEventKeyDown;
-    case NS_KEY_UP:
+    case eKeyUp:
       return NPCocoaEventKeyUp;
     case NS_FOCUS_CONTENT:
     case NS_BLUR_CONTENT:
       return NPCocoaEventFocusChanged;
     case NS_MOUSE_SCROLL:
       return NPCocoaEventScrollWheel;
     default:
       return (NPCocoaEventType)0;
@@ -1901,17 +1901,17 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* 
         cocoaEvent.data.mouse.deltaX = wheelEvent->lineOrPageDeltaX;
         cocoaEvent.data.mouse.deltaY = wheelEvent->lineOrPageDeltaY;
       } else {
         NS_WARNING("NS_MOUSE_SCROLL is not a WidgetWheelEvent? (could be, haven't checked)");
       }
       break;
     }
     case NS_KEY_DOWN:
-    case NS_KEY_UP:
+    case eKeyUp:
     {
       WidgetKeyboardEvent* keyEvent = anEvent->AsKeyboardEvent();
 
       // That keyEvent->mPluginTextEventString is non-empty is a signal that we should
       // create a text event for the plugin, instead of a key event.
       if (anEvent->mMessage == NS_KEY_DOWN &&
           !keyEvent->mPluginTextEventString.IsEmpty()) {
         cocoaEvent.type = NPCocoaEventTextInput;
@@ -2292,17 +2292,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
               // Handle NS_KEY_DOWN for modifier key presses
               // For non-modifiers we get eKeyPress
               if (gdkEvent->is_modifier)
                 event.type = XKeyPress;
               break;
             case eKeyPress:
               event.type = XKeyPress;
               break;
-            case NS_KEY_UP:
+            case eKeyUp:
               event.type = KeyRelease;
               break;
             default:
               break;
             }
 #endif
 
           // Information that could be obtained from pluginEvent but we may not
--- a/editor/libeditor/nsEditorEventListener.cpp
+++ b/editor/libeditor/nsEditorEventListener.cpp
@@ -392,17 +392,17 @@ nsEditorEventListener::HandleEvent(nsIDO
     }
 #ifdef HANDLE_NATIVE_TEXT_DIRECTION_SWITCH
     // keydown
     case NS_KEY_DOWN: {
       nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aEvent);
       return KeyDown(keyEvent);
     }
     // keyup
-    case NS_KEY_UP: {
+    case eKeyUp: {
       nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aEvent);
       return KeyUp(keyEvent);
     }
 #endif // #ifdef HANDLE_NATIVE_TEXT_DIRECTION_SWITCH
     // keypress
     case eKeyPress: {
       nsCOMPtr<nsIDOMKeyEvent> keyEvent = do_QueryInterface(aEvent);
       return KeyPress(keyEvent);
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -882,17 +882,17 @@ APZCTreeManager::UpdateWheelTransaction(
      }
 
      ScreenIntPoint point =
        ViewAs<ScreenPixel>(aEvent.refPoint, PixelCastJustification::LayoutDeviceToScreenForUntransformedEvent);
      txn->OnMouseMove(point);
      return;
    }
    case eKeyPress:
-   case NS_KEY_UP:
+   case eKeyUp:
    case NS_KEY_DOWN:
    case NS_MOUSE_BUTTON_UP:
    case NS_MOUSE_BUTTON_DOWN:
    case NS_MOUSE_DOUBLECLICK:
    case NS_MOUSE_CLICK:
    case NS_CONTEXTMENU:
    case NS_DRAGDROP_DROP:
      txn->EndTransaction();
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -605,17 +605,17 @@ AccessibleCaretEventHub::HandleTouchEven
 
   return rv;
 }
 
 nsEventStatus
 AccessibleCaretEventHub::HandleKeyboardEvent(WidgetKeyboardEvent* aEvent)
 {
   switch (aEvent->mMessage) {
-  case NS_KEY_UP:
+  case eKeyUp:
   case NS_KEY_DOWN:
   case eKeyPress:
     mManager->OnKeyboardEvent();
     break;
 
   default:
     break;
   }
--- a/layout/base/TouchCaret.cpp
+++ b/layout/base/TouchCaret.cpp
@@ -778,17 +778,17 @@ TouchCaret::HandleEvent(WidgetEvent* aEv
     case NS_MOUSE_MOVE:
       status = HandleMouseMoveEvent(aEvent->AsMouseEvent());
       break;
     case NS_TOUCH_CANCEL:
       mTouchesId.Clear();
       SetState(TOUCHCARET_NONE);
       LaunchExpirationTimer();
       break;
-    case NS_KEY_UP:
+    case eKeyUp:
     case NS_KEY_DOWN:
     case eKeyPress:
     case NS_WHEEL_WHEEL:
     case NS_WHEEL_START:
     case NS_WHEEL_STOP:
       // Disable touch caret while key/wheel event is received.
       TOUCHCARET_LOG("Receive key/wheel event %d", aEvent->mMessage);
       SetVisibility(false);
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -6904,17 +6904,17 @@ void
 PresShell::DispatchAfterKeyboardEvent(nsINode* aTarget,
                                       const WidgetKeyboardEvent& aEvent,
                                       bool aEmbeddedCancelled)
 {
   MOZ_ASSERT(aTarget);
   MOZ_ASSERT(BeforeAfterKeyboardEventEnabled());
 
   if (NS_WARN_IF(aEvent.mMessage != NS_KEY_DOWN &&
-                 aEvent.mMessage != NS_KEY_UP)) {
+                 aEvent.mMessage != eKeyUp)) {
     return;
   }
 
   // Build up a target chain. Each item in the chain will receive an after event.
   nsAutoTArray<nsCOMPtr<Element>, 5> chain;
   bool targetIsIframe = false;
   BuildTargetChainForBeforeAfterKeyboardEvent(aTarget, chain, targetIsIframe);
   DispatchAfterKeyboardEventInternal(chain, aEvent, aEmbeddedCancelled);
@@ -6941,17 +6941,17 @@ PresShell::HandleKeyboardEvent(nsINode* 
   if (aEvent.mMessage == eKeyPress ||
       !BeforeAfterKeyboardEventEnabled()) {
     EventDispatcher::Dispatch(aTarget, mPresContext,
                               &aEvent, nullptr, aStatus, aEventCB);
     return;
   }
 
   MOZ_ASSERT(aTarget);
-  MOZ_ASSERT(aEvent.mMessage == NS_KEY_DOWN || aEvent.mMessage == NS_KEY_UP);
+  MOZ_ASSERT(aEvent.mMessage == NS_KEY_DOWN || aEvent.mMessage == eKeyUp);
 
   // Build up a target chain. Each item in the chain will receive a before event.
   nsAutoTArray<nsCOMPtr<Element>, 5> chain;
   bool targetIsIframe = false;
   BuildTargetChainForBeforeAfterKeyboardEvent(aTarget, chain, targetIsIframe);
 
   // Dispatch before events. If each item in the chain consumes the before
   // event and doesn't prevent the default action, we will go further to
@@ -7633,33 +7633,33 @@ PresShell::HandleEvent(nsIFrame* aFrame,
         }
       }
 
       if (aEvent->mMessage == NS_KEY_DOWN) {
         NS_IF_RELEASE(gKeyDownTarget);
         NS_IF_ADDREF(gKeyDownTarget = eventTarget);
       }
       else if ((aEvent->mMessage == eKeyPress ||
-                aEvent->mMessage == NS_KEY_UP) &&
+                aEvent->mMessage == eKeyUp) &&
                gKeyDownTarget) {
         // If a different element is now focused for the keypress/keyup event
         // than what was focused during the keydown event, check if the new
         // focused element is not in a chrome document any more, and if so,
         // retarget the event back at the keydown target. This prevents a
         // content area from grabbing the focus from chrome in-between key
         // events.
         if (eventTarget) {
           bool keyDownIsChrome = nsContentUtils::IsChromeDoc(gKeyDownTarget->GetComposedDoc());
           if (keyDownIsChrome != nsContentUtils::IsChromeDoc(eventTarget->GetComposedDoc()) ||
               (keyDownIsChrome && TabParent::GetFrom(eventTarget))) {
             eventTarget = gKeyDownTarget;
           }
         }
 
-        if (aEvent->mMessage == NS_KEY_UP) {
+        if (aEvent->mMessage == eKeyUp) {
           NS_RELEASE(gKeyDownTarget);
         }
       }
 
       mCurrentEventFrame = nullptr;
       nsIDocument* targetDoc = eventTarget ? eventTarget->OwnerDoc() : nullptr;
       if (targetDoc && targetDoc != mDocument) {
         PopCurrentEventInfo();
@@ -7840,46 +7840,46 @@ PresShell::HandleEventInternal(WidgetEve
     bool touchIsNew = false;
     bool isHandlingUserInput = false;
 
     // XXX How about IME events and input events for plugins?
     if (aEvent->mFlags.mIsTrusted) {
       switch (aEvent->mMessage) {
       case eKeyPress:
       case NS_KEY_DOWN:
-      case NS_KEY_UP: {
+      case eKeyUp: {
         nsIDocument* doc = GetCurrentEventContent() ?
                            mCurrentEventContent->OwnerDoc() : nullptr;
         auto keyCode = aEvent->AsKeyboardEvent()->keyCode;
         if (keyCode == NS_VK_ESCAPE) {
           nsIDocument* root = nsContentUtils::GetRootDocument(doc);
           if (root && root->IsFullScreenDoc()) {
             // Prevent default action on ESC key press when exiting
             // DOM fullscreen mode. This prevents the browser ESC key
             // handler from stopping all loads in the document, which
             // would cause <video> loads to stop.
             aEvent->mFlags.mDefaultPrevented = true;
             aEvent->mFlags.mOnlyChromeDispatch = true;
 
             // The event listeners in chrome can prevent this ESC behavior by
             // calling prevent default on the preceding keydown/press events.
             if (!mIsLastChromeOnlyEscapeKeyConsumed &&
-                aEvent->mMessage == NS_KEY_UP) {
+                aEvent->mMessage == eKeyUp) {
               // ESC key released while in DOM fullscreen mode.
               // Fully exit all browser windows and documents from
               // fullscreen mode.
               nsIDocument::AsyncExitFullscreen(nullptr);
             }
           }
           nsCOMPtr<nsIDocument> pointerLockedDoc =
             do_QueryReferent(EventStateManager::sPointerLockedDoc);
           if (!mIsLastChromeOnlyEscapeKeyConsumed && pointerLockedDoc) {
             aEvent->mFlags.mDefaultPrevented = true;
             aEvent->mFlags.mOnlyChromeDispatch = true;
-            if (aEvent->mMessage == NS_KEY_UP) {
+            if (aEvent->mMessage == eKeyUp) {
               nsIDocument::UnlockPointer();
             }
           }
         }
         if (keyCode != NS_VK_ESCAPE && keyCode != NS_VK_SHIFT &&
             keyCode != NS_VK_CONTROL && keyCode != NS_VK_ALT &&
             keyCode != NS_VK_WIN && keyCode != NS_VK_META) {
           // Allow keys other than ESC and modifiers be marked as a
@@ -7975,19 +7975,19 @@ PresShell::HandleEventInternal(WidgetEve
         rv = manager->PostHandleEvent(mPresContext, aEvent,
                                       GetCurrentEventFrame(), aStatus);
       }
     }
 
     switch (aEvent->mMessage) {
     case eKeyPress:
     case NS_KEY_DOWN:
-    case NS_KEY_UP: {
+    case eKeyUp: {
       if (aEvent->AsKeyboardEvent()->keyCode == NS_VK_ESCAPE) {
-        if (aEvent->mMessage == NS_KEY_UP) {
+        if (aEvent->mMessage == eKeyUp) {
           // Reset this flag after key up is handled.
           mIsLastChromeOnlyEscapeKeyConsumed = false;
         } else {
           if (aEvent->mFlags.mOnlyChromeDispatch &&
               aEvent->mFlags.mDefaultPreventedByChrome) {
             mIsLastChromeOnlyEscapeKeyConsumed = true;
           }
         }
--- a/layout/xul/nsButtonBoxFrame.cpp
+++ b/layout/xul/nsButtonBoxFrame.cpp
@@ -139,17 +139,17 @@ nsButtonBoxFrame::HandleEvent(nsPresCont
           MouseClicked(aPresContext, aEvent);
           *aEventStatus = nsEventStatus_eConsumeNoDefault;
         }
       }
       break;
     }
 #endif
 
-    case NS_KEY_UP: {
+    case eKeyUp: {
       WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
       if (!keyEvent) {
         break;
       }
       if (NS_VK_SPACE == keyEvent->keyCode) {
         mIsHandlingKeyEvent = false;
         // only activate on keyup if we're already in the :hover:active state
         NS_ASSERTION(mContent->IsElement(), "How do we have a non-element?");
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -15,17 +15,17 @@ NS_EVENT_MESSAGE(eVoidEvent,            
 // EventListenerManager.
 NS_EVENT_MESSAGE(eAllEvents,            1)
 
 NS_EVENT_MESSAGE(eWindowEventFirst,     100)
 // Widget may be destroyed
 NS_EVENT_MESSAGE(eWindowClose,          eWindowEventFirst + 1)
 
 NS_EVENT_MESSAGE(eKeyPress,             eWindowEventFirst + 31)
-NS_EVENT_MESSAGE(NS_KEY_UP,             eWindowEventFirst + 32)
+NS_EVENT_MESSAGE(eKeyUp,                eWindowEventFirst + 32)
 NS_EVENT_MESSAGE(NS_KEY_DOWN,           eWindowEventFirst + 33)
 
 NS_EVENT_MESSAGE(NS_KEY_BEFORE_DOWN,    eWindowEventFirst + 34)
 NS_EVENT_MESSAGE(NS_KEY_AFTER_DOWN,     eWindowEventFirst + 35)
 NS_EVENT_MESSAGE(NS_KEY_BEFORE_UP,      eWindowEventFirst + 36)
 NS_EVENT_MESSAGE(NS_KEY_AFTER_UP,       eWindowEventFirst + 37)
 
 NS_EVENT_MESSAGE(NS_RESIZE_EVENT,       eWindowEventFirst + 60)
--- a/widget/TextEventDispatcher.cpp
+++ b/widget/TextEventDispatcher.cpp
@@ -314,17 +314,17 @@ TextEventDispatcher::DispatchKeyboardEve
 bool
 TextEventDispatcher::DispatchKeyboardEventInternal(
                        EventMessage aMessage,
                        const WidgetKeyboardEvent& aKeyboardEvent,
                        nsEventStatus& aStatus,
                        DispatchTo aDispatchTo,
                        uint32_t aIndexOfKeypress)
 {
-  MOZ_ASSERT(aMessage == NS_KEY_DOWN || aMessage == NS_KEY_UP ||
+  MOZ_ASSERT(aMessage == NS_KEY_DOWN || aMessage == eKeyUp ||
              aMessage == eKeyPress, "Invalid aMessage value");
   nsresult rv = GetState();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
 
   // If the key shouldn't cause keypress events, don't this patch them.
   if (aMessage == eKeyPress && !aKeyboardEvent.ShouldCauseKeypressEvents()) {
@@ -351,19 +351,19 @@ TextEventDispatcher::DispatchKeyboardEve
   if (aStatus == nsEventStatus_eConsumeNoDefault) {
     // If the key event should be dispatched as consumed event, marking it here.
     // This is useful to prevent double action.  E.g., when the key was already
     // handled by system, our chrome shouldn't handle it.
     keyEvent.mFlags.mDefaultPrevented = true;
   }
 
   // Corrects each member for the specific key event type.
-  if (aMessage == NS_KEY_DOWN || aMessage == NS_KEY_UP) {
+  if (aMessage == NS_KEY_DOWN || aMessage == eKeyUp) {
     MOZ_ASSERT(!aIndexOfKeypress,
-      "aIndexOfKeypress must be 0 for either NS_KEY_DOWN or NS_KEY_UP");
+      "aIndexOfKeypress must be 0 for either NS_KEY_DOWN or eKeyUp");
     // charCode of keydown and keyup should be 0.
     keyEvent.charCode = 0;
   } else if (keyEvent.mKeyNameIndex != KEY_NAME_INDEX_USE_STRING) {
     MOZ_ASSERT(!aIndexOfKeypress,
       "aIndexOfKeypress must be 0 for eKeyPress of non-printable key");
     // If keypress event isn't caused by printable key, its charCode should
     // be 0.
     keyEvent.charCode = 0;
@@ -376,17 +376,17 @@ TextEventDispatcher::DispatchKeyboardEve
       keyEvent.mKeyValue.IsEmpty() ? 0 : keyEvent.mKeyValue[aIndexOfKeypress];
     keyEvent.charCode = static_cast<uint32_t>(ch);
     if (ch) {
       keyEvent.mKeyValue.Assign(ch);
     } else {
       keyEvent.mKeyValue.Truncate();
     }
   }
-  if (aMessage == NS_KEY_UP) {
+  if (aMessage == eKeyUp) {
     // mIsRepeat of keyup event must be false.
     keyEvent.mIsRepeat = false;
   }
   // mIsComposing should be initialized later.
   keyEvent.mIsComposing = false;
   // XXX Currently, we don't support to dispatch key event with native key
   //     event information.
   keyEvent.mNativeKeyEvent = nullptr;
--- a/widget/TextEventDispatcher.h
+++ b/widget/TextEventDispatcher.h
@@ -198,17 +198,17 @@ public:
     // the event may be sent to a child process when it has focus.  If there is
     // no child process, the event may be handled synchronously.
     eDispatchToCurrentProcess = 1
   };
 
   /**
    * DispatchKeyboardEvent() maybe dispatches aKeyboardEvent.
    *
-   * @param aMessage        Must be NS_KEY_DOWN or NS_KEY_UP.
+   * @param aMessage        Must be NS_KEY_DOWN or eKeyUp.
    *                        Use MaybeDispatchKeypressEvents() for dispatching
    *                        eKeyPress.
    * @param aKeyboardEvent  A keyboard event.
    * @param aStatus         If dispatching event should be marked as consumed,
    *                        set nsEventStatus_eConsumeNoDefault.  Otherwise,
    *                        set nsEventStatus_eIgnore.  After dispatching
    *                        a event and it's consumed this returns
    *                        nsEventStatus_eConsumeNoDefault.
@@ -330,17 +330,17 @@ private:
    *                        an error.  Otherwise, returns NS_OK even if aStatus
    *                        is nsEventStatus_eConsumeNoDefault.
    */
   nsresult StartCompositionAutomaticallyIfNecessary(nsEventStatus& aStatus);
 
   /**
    * DispatchKeyboardEventInternal() maybe dispatches aKeyboardEvent.
    *
-   * @param aMessage        Must be NS_KEY_DOWN, NS_KEY_UP or eKeyPress.
+   * @param aMessage        Must be NS_KEY_DOWN, eKeyUp or eKeyPress.
    * @param aKeyboardEvent  A keyboard event.  If aMessage is eKeyPress and
    *                        the event is for second or later character, its
    *                        mKeyValue should be empty string.
    * @param aStatus         If dispatching event should be marked as consumed,
    *                        set nsEventStatus_eConsumeNoDefault.  Otherwise,
    *                        set nsEventStatus_eIgnore.  After dispatching
    *                        a event and it's consumed this returns
    *                        nsEventStatus_eConsumeNoDefault.
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -116,17 +116,17 @@ WidgetEvent::HasDragEventMessage() const
 }
 
 bool
 WidgetEvent::HasKeyEventMessage() const
 {
   switch (mMessage) {
     case NS_KEY_DOWN:
     case eKeyPress:
-    case NS_KEY_UP:
+    case eKeyUp:
     case NS_KEY_BEFORE_DOWN:
     case NS_KEY_BEFORE_UP:
     case NS_KEY_AFTER_DOWN:
     case NS_KEY_AFTER_UP:
       return true;
     default:
       return false;
   }
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1468,17 +1468,17 @@ nsWindow::InitKeyEvent(WidgetKeyboardEve
             charCode = key.BaseUnicodeChar();
         }
         event.isChar = (charCode >= ' ');
         event.charCode = event.isChar ? charCode : 0;
         event.keyCode = (event.charCode > 0) ? 0 : domKeyCode;
         event.mPluginEvent.Clear();
     } else {
 #ifdef DEBUG
-        if (event.mMessage != NS_KEY_DOWN && event.mMessage != NS_KEY_UP) {
+        if (event.mMessage != NS_KEY_DOWN && event.mMessage != eKeyUp) {
             ALOG("InitKeyEvent: unexpected event.mMessage %d", event.mMessage);
         }
 #endif // DEBUG
 
         // Flash will want a pluginEvent for keydown and keyup events.
         ANPKeyActions action = event.mMessage == NS_KEY_DOWN
                              ? kDown_ANPKeyAction
                              : kUp_ANPKeyAction;
@@ -1578,17 +1578,17 @@ nsWindow::OnKeyEvent(AndroidGeckoEvent *
     nsRefPtr<nsWindow> kungFuDeathGrip(this);
     RemoveIMEComposition();
     EventMessage msg;
     switch (ae->Action()) {
     case AKEY_EVENT_ACTION_DOWN:
         msg = NS_KEY_DOWN;
         break;
     case AKEY_EVENT_ACTION_UP:
-        msg = NS_KEY_UP;
+        msg = eKeyUp;
         break;
     case AKEY_EVENT_ACTION_MULTIPLE:
         // Keys with multiple action are handled in Java,
         // and we should never see one here
         MOZ_CRASH("Cannot handle key with multiple action");
     default:
         ALOG("Unknown key action event!");
         return;
@@ -1696,17 +1696,17 @@ nsWindow::RemoveIMEComposition()
  */
 void
 nsWindow::SendIMEDummyKeyEvents()
 {
     WidgetKeyboardEvent downEvent(true, NS_KEY_DOWN, this);
     MOZ_ASSERT(downEvent.keyCode == 0);
     DispatchEvent(&downEvent);
 
-    WidgetKeyboardEvent upEvent(true, NS_KEY_UP, this);
+    WidgetKeyboardEvent upEvent(true, eKeyUp, this);
     MOZ_ASSERT(upEvent.keyCode == 0);
     DispatchEvent(&upEvent);
 }
 
 void
 nsWindow::OnIMEEvent(AndroidGeckoEvent *ae)
 {
     MOZ_ASSERT(!mIMEMaskSelectionUpdate);
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -222,17 +222,17 @@ GetNativeKeyEventType(NSEvent* aNativeEv
   }
 }
 
 static const char*
 GetGeckoKeyEventType(const WidgetEvent& aEvent)
 {
   switch (aEvent.mMessage) {
     case NS_KEY_DOWN:    return "NS_KEY_DOWN";
-    case NS_KEY_UP:      return "NS_KEY_UP";
+    case eKeyUp:         return "eKeyUp";
     case eKeyPress:      return "eKeyPress";
     default:             return "not key event";
   }
 }
 
 static const char*
 GetRangeTypeName(uint32_t aRangeType)
 {
@@ -1657,17 +1657,17 @@ TextInputHandler::HandleKeyUpEvent(NSEve
     return;
   }
 
   // if we don't have any characters we can't generate a keyUp event
   if (IsIMEComposing()) {
     return;
   }
 
-  WidgetKeyboardEvent keyupEvent(true, NS_KEY_UP, mWidget);
+  WidgetKeyboardEvent keyupEvent(true, eKeyUp, mWidget);
   InitKeyEvent(aNativeEvent, keyupEvent);
 
   DispatchEvent(keyupEvent);
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 void
@@ -2001,17 +2001,17 @@ TextInputHandler::DispatchKeyEventForFla
      this, aNativeEvent, GetNativeKeyEventType(aNativeEvent),
      GetKeyNameForNativeKeyCode([aNativeEvent keyCode]), [aNativeEvent keyCode],
      TrueOrFalse(aDispatchKeyDown), TrueOrFalse(IsIMEComposing())));
 
   if ([aNativeEvent type] != NSFlagsChanged || IsIMEComposing()) {
     return;
   }
 
-  EventMessage message = aDispatchKeyDown ? NS_KEY_DOWN : NS_KEY_UP;
+  EventMessage message = aDispatchKeyDown ? NS_KEY_DOWN : eKeyUp;
 
   // Fire a key event.
   WidgetKeyboardEvent keyEvent(true, message, mWidget);
   InitKeyEvent(aNativeEvent, keyEvent);
 
   // Attach a plugin event, in case keyEvent gets dispatched to a plugin.  Only
   // one field is needed -- the type.  The other fields can be constructed as
   // the need arises.  But Gecko doesn't have anything equivalent to the
@@ -3914,17 +3914,17 @@ TextInputHandlerBase::AttachNativeKeyEve
   }
 
   MOZ_LOG(gLog, LogLevel::Info,
     ("%p TextInputHandlerBase::AttachNativeKeyEvent, key=0x%X, char=0x%X, "
      "mod=0x%X", this, aKeyEvent.keyCode, aKeyEvent.charCode,
      aKeyEvent.modifiers));
 
   NSEventType eventType;
-  if (aKeyEvent.mMessage == NS_KEY_UP) {
+  if (aKeyEvent.mMessage == eKeyUp) {
     eventType = NSKeyUp;
   } else {
     eventType = NSKeyDown;
   }
 
   static const uint32_t sModifierFlagMap[][2] = {
     { MODIFIER_SHIFT,    NSShiftKeyMask },
     { MODIFIER_CONTROL,  NSControlKeyMask },
--- a/widget/gonk/nsAppShell.cpp
+++ b/widget/gonk/nsAppShell.cpp
@@ -345,17 +345,17 @@ KeyEventDispatcher::DispatchKeyDownEvent
     if (status != nsEventStatus_eConsumeNoDefault) {
         DispatchKeyEventInternal(eKeyPress);
     }
 }
 
 void
 KeyEventDispatcher::DispatchKeyUpEvent()
 {
-    DispatchKeyEventInternal(NS_KEY_UP);
+    DispatchKeyEventInternal(eKeyUp);
 }
 
 class SwitchEventRunnable : public nsRunnable {
 public:
     SwitchEventRunnable(hal::SwitchEvent& aEvent) : mEvent(aEvent)
     {}
 
     NS_IMETHOD Run()
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -980,17 +980,17 @@ KeymapWrapper::InitKeyEvent(WidgetKeyboa
          ((aGdkKeyEvent->type == GDK_KEY_PRESS) ?
                "GDK_KEY_PRESS" : "GDK_KEY_RELEASE"),
          gdk_keyval_name(aGdkKeyEvent->keyval),
          aGdkKeyEvent->keyval, aGdkKeyEvent->state,
          aGdkKeyEvent->hardware_keycode,
          GetBoolName(aGdkKeyEvent->is_modifier),
          ((aKeyEvent.mMessage == NS_KEY_DOWN) ? "NS_KEY_DOWN" :
                (aKeyEvent.mMessage == eKeyPress) ? "eKeyPress" :
-                                                   "NS_KEY_UP"),
+                                                   "eKeyUp"),
          GetBoolName(aKeyEvent.IsShift()), GetBoolName(aKeyEvent.IsControl()),
          GetBoolName(aKeyEvent.IsAlt()), GetBoolName(aKeyEvent.IsMeta())));
 
     if (aKeyEvent.mMessage == eKeyPress) {
         keymapWrapper->InitKeypressEvent(aKeyEvent, aGdkKeyEvent);
     }
 
     // The transformations above and in gdk for the keyval are not invertible
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3103,17 +3103,17 @@ nsWindow::OnKeyReleaseEvent(GdkEventKey 
 {
     LOGFOCUS(("OnKeyReleaseEvent [%p]\n", (void *)this));
 
     if (mIMContext && mIMContext->OnKeyEvent(this, aEvent)) {
         return TRUE;
     }
 
     // send the key event as a key up event
-    WidgetKeyboardEvent event(true, NS_KEY_UP, this);
+    WidgetKeyboardEvent event(true, eKeyUp, this);
     KeymapWrapper::InitKeyEvent(event, aEvent);
 
     nsEventStatus status = DispatchInputEvent(&event);
 
     // If the event was consumed, return.
     if (status == nsEventStatus_eConsumeNoDefault) {
         return TRUE;
     }
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -2641,17 +2641,17 @@ case _value: eventName.AssignLiteral(_na
     _ASSIGN_eventName(NS_FORM_SELECTED,"NS_FORM_SELECTED");
     _ASSIGN_eventName(NS_FORM_CHANGE,"NS_FORM_CHANGE");
     _ASSIGN_eventName(NS_FORM_RESET,"NS_FORM_RESET");
     _ASSIGN_eventName(NS_FORM_SUBMIT,"NS_FORM_SUBMIT");
     _ASSIGN_eventName(NS_IMAGE_ABORT,"NS_IMAGE_ABORT");
     _ASSIGN_eventName(NS_LOAD_ERROR,"NS_LOAD_ERROR");
     _ASSIGN_eventName(NS_KEY_DOWN,"NS_KEY_DOWN");
     _ASSIGN_eventName(eKeyPress,"eKeyPress");
-    _ASSIGN_eventName(NS_KEY_UP,"NS_KEY_UP");
+    _ASSIGN_eventName(eKeyUp,"eKeyUp");
     _ASSIGN_eventName(NS_MOUSE_ENTER_WIDGET,"NS_MOUSE_ENTER_WIDGET");
     _ASSIGN_eventName(NS_MOUSE_EXIT_WIDGET,"NS_MOUSE_EXIT_WIDGET");
     _ASSIGN_eventName(NS_MOUSE_BUTTON_DOWN,"NS_MOUSE_BUTTON_DOWN");
     _ASSIGN_eventName(NS_MOUSE_BUTTON_UP,"NS_MOUSE_BUTTON_UP");
     _ASSIGN_eventName(NS_MOUSE_CLICK,"NS_MOUSE_CLICK");
     _ASSIGN_eventName(NS_MOUSE_DOUBLECLICK,"NS_MOUSE_DBLCLICK");
     _ASSIGN_eventName(NS_MOUSE_MOVE,"NS_MOUSE_MOVE");
     _ASSIGN_eventName(NS_LOAD,"NS_LOAD");
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -1239,17 +1239,17 @@ nsWindow::keyReleaseEvent(QKeyEvent* aEv
     UserActivity();
 
     if (IsContextMenuKeyEvent(aEvent)) {
         // er, what do we do here? DoDefault or NoDefault?
         return nsEventStatus_eConsumeDoDefault;
     }
 
     // send the key event as a key up event
-    WidgetKeyboardEvent event(true, NS_KEY_UP, this);
+    WidgetKeyboardEvent event(true, eKeyUp, this);
     InitKeyEvent(event, aEvent);
 
     if (aEvent->key() == Qt::Key_AltGr) {
         sAltGrModifier = false;
     }
 
     // unset the key down flag
     ClearKeyDownFlag(event.keyCode);
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -1145,17 +1145,17 @@ NativeKey::InitKeyEvent(WidgetKeyboardEv
 
   switch (aKeyEvent.mMessage) {
     case NS_KEY_DOWN:
       aKeyEvent.keyCode = mDOMKeyCode;
       // Unique id for this keydown event and its associated keypress.
       sUniqueKeyEventId++;
       aKeyEvent.mUniqueId = sUniqueKeyEventId;
       break;
-    case NS_KEY_UP:
+    case eKeyUp:
       aKeyEvent.keyCode = mDOMKeyCode;
       // Set defaultPrevented of the key event if the VK_MENU is not a system
       // key release, so that the menu bar does not trigger.  This helps avoid
       // triggering the menu bar for ALT key accelerators used in assistive
       // technologies such as Window-Eyes and ZoomText or for switching open
       // state of IME.
       aKeyEvent.mFlags.mDefaultPrevented =
         (mOriginalVirtualKeyCode == VK_MENU && mMsg.message != WM_SYSKEYUP);
@@ -1380,17 +1380,17 @@ NativeKey::HandleAppCommandMessage() con
     if (mWidget->Destroyed()) {
       return true;
     }
   }
 
   // Dispatch a keyup event if the command is caused by pressing a key and
   // the key isn't mapped to a virtual keycode.
   if (dispatchKeyEvent && !mVirtualKeyCode) {
-    WidgetKeyboardEvent keyupEvent(true, NS_KEY_UP, mWidget);
+    WidgetKeyboardEvent keyupEvent(true, eKeyUp, mWidget);
     InitKeyEvent(keyupEvent, mModKeyState);
     // NOTE: Ignore if the keyup event is consumed because keyup event
     //       represents just a physical key event state change.
     DispatchKeyEvent(keyupEvent, &mMsg);
     if (mWidget->Destroyed()) {
       return true;
     }
   }
@@ -1658,17 +1658,17 @@ NativeKey::HandleKeyUpMessage(bool* aEve
   }
 
   // Ignore [shift+]alt+space so the OS can handle it.
   if (mModKeyState.IsAlt() && !mModKeyState.IsControl() &&
       mVirtualKeyCode == VK_SPACE) {
     return false;
   }
 
-  WidgetKeyboardEvent keyupEvent(true, NS_KEY_UP, mWidget);
+  WidgetKeyboardEvent keyupEvent(true, eKeyUp, mWidget);
   InitKeyEvent(keyupEvent, mModKeyState);
   if (aEventDispatched) {
     *aEventDispatched = true;
   }
   return DispatchKeyEvent(keyupEvent, &mMsg);
 }
 
 bool