Bug 1323976 - Part 1: Add eNoButton to WidgetMouseEventBase::buttonType. r=smaug
authorStone Shih <sshih@mozilla.com>
Thu, 12 Jan 2017 17:53:38 +0800
changeset 374956 3c73edc36d1858d97cb4dbc87c5f11f1c7e42dd0
parent 374955 02057c9d45e530d17acd76769bdf53558747936b
child 374957 3eb75c153034bda2340ff22e7ca7efa93d3dcdf4
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1323976
milestone53.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 1323976 - Part 1: Add eNoButton to WidgetMouseEventBase::buttonType. r=smaug MozReview-Commit-ID: FYUhdfKj5wT
layout/base/PresShell.cpp
widget/MouseEvents.h
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -6915,17 +6915,17 @@ DispatchPointerFromMouseOrTouch(PresShel
     //    dispatched to DOM.
     if (!mouseEvent->convertToPointer ||
         !aEvent->IsAllowedToDispatchDOMEvent()) {
       return NS_OK;
     }
     int16_t button = mouseEvent->button;
     switch (mouseEvent->mMessage) {
     case eMouseMove:
-      button = -1;
+      button = WidgetMouseEvent::eNoButton;
       pointerMessage = ePointerMove;
       break;
     case eMouseUp:
       pointerMessage = mouseEvent->buttons ? ePointerMove : ePointerUp;
       break;
     case eMouseDown:
       pointerMessage =
         mouseEvent->buttons & ~nsContentUtils::GetButtonsFlagForButton(button) ?
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -116,16 +116,17 @@ public:
     MOZ_CRASH("WidgetMouseEventBase must not be most-subclass");
   }
 
   /// The possible related target
   nsCOMPtr<nsISupports> relatedTarget;
 
   enum buttonType
   {
+    eNoButton     = -1,
     eLeftButton   = 0,
     eMiddleButton = 1,
     eRightButton  = 2
   };
   // Pressed button ID of mousedown or mouseup event.
   // This is set only when pressing a button causes the event.
   int16_t button;