Bug 1259660 - Cleaned up WidgetMouseEventBase by renaming WidgetMouseEventBase::buttons to WidgetMouseEventBase::mButtons r=masayuki
authorSrujana Peddinti <srujana.htt121@gmail.com>
Sun, 21 Apr 2019 19:42:37 +0000
changeset 470314 89c2646562d42c496b592e42948caff37aad719b
parent 470313 2049f94666461e2eff7e67f026730a4932c98788
child 470315 912e85a1cbdf90ce1cd853462ae938e1a3fd935f
push id35898
push usershindli@mozilla.com
push dateMon, 22 Apr 2019 09:39:21 +0000
treeherdermozilla-central@43c7c3f10a71 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1259660
milestone68.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 1259660 - Cleaned up WidgetMouseEventBase by renaming WidgetMouseEventBase::buttons to WidgetMouseEventBase::mButtons r=masayuki Renamed all class member instances from WidgetMouseEventBase::buttons to WidgetMouseEventBase::mButtons Differential Revision: https://phabricator.services.mozilla.com/D25297
dom/base/nsContentUtils.cpp
dom/events/EventStateManager.cpp
dom/events/IMEContentObserver.cpp
dom/events/MouseEvent.cpp
dom/events/PointerEvent.cpp
dom/events/PointerEventHandler.cpp
dom/html/HTMLInputElement.cpp
dom/ipc/CoalescedMouseData.cpp
widget/InputData.cpp
widget/MouseEvents.h
widget/cocoa/SwipeTracker.mm
widget/cocoa/nsChildView.mm
widget/gtk/nsGtkKeyUtils.cpp
widget/nsGUIEventIPC.h
widget/windows/KeyboardLayout.cpp
widget/windows/nsWindow.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -7965,19 +7965,19 @@ nsresult nsContentUtils::SendMouseEvent(
                          aIsWidgetEventSynthesized
                              ? WidgetMouseEvent::eSynthesized
                              : WidgetMouseEvent::eReal,
                          contextMenuKey ? WidgetMouseEvent::eContextMenuKey
                                         : WidgetMouseEvent::eNormal);
   event.pointerId = aIdentifier;
   event.mModifiers = GetWidgetModifiers(aModifiers);
   event.button = aButton;
-  event.buttons = aButtons != nsIDOMWindowUtils::MOUSE_BUTTONS_NOT_SPECIFIED
-                      ? aButtons
-                      : msg == eMouseUp ? 0 : GetButtonsFlagForButton(aButton);
+  event.mButtons = aButtons != nsIDOMWindowUtils::MOUSE_BUTTONS_NOT_SPECIFIED
+                       ? aButtons
+                       : msg == eMouseUp ? 0 : GetButtonsFlagForButton(aButton);
   event.pressure = aPressure;
   event.inputSource = aInputSourceArg;
   event.mClickCount = aClickCount;
   event.mTime = PR_IntervalNow();
   event.mFlags.mIsSynthesizedForTests = aIsDOMEventSynthesized;
   event.mExitFrom = exitFrom;
 
   nsPresContext* presContext = aPresShell->GetPresContext();
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -1608,17 +1608,17 @@ void EventStateManager::BeginTrackingDra
                                     getter_AddRefs(mGestureDownContent));
 
     mGestureDownFrameOwner = inDownFrame->GetContent();
     if (!mGestureDownFrameOwner) {
       mGestureDownFrameOwner = mGestureDownContent;
     }
   }
   mGestureModifiers = inDownEvent->mModifiers;
-  mGestureDownButtons = inDownEvent->buttons;
+  mGestureDownButtons = inDownEvent->mButtons;
 
   if (inDownEvent->mMessage != eMouseTouchDrag &&
       Prefs::ClickHoldContextMenu()) {
     // fire off a timer to track click-hold
     CreateClickHoldTimer(aPresContext, inDownFrame, inDownEvent);
   }
 }
 
@@ -1656,17 +1656,17 @@ void EventStateManager::FillInEventFromG
                "Incorrect widget in event");
 
   // Set the coordinates in the new event to the coordinates of
   // the old event, adjusted for the fact that the widget might be
   // different
   aEvent->mRefPoint =
       mGestureDownPoint - aEvent->mWidget->WidgetToScreenOffset();
   aEvent->mModifiers = mGestureModifiers;
-  aEvent->buttons = mGestureDownButtons;
+  aEvent->mButtons = mGestureDownButtons;
 }
 
 void EventStateManager::MaybeFirePointerCancel(WidgetInputEvent* aEvent) {
   RefPtr<PresShell> presShell = mPresContext->GetPresShell();
   AutoWeakFrame targetFrame = mCurrentTarget;
 
   if (!PointerEventHandler::IsPointerEventEnabled() || !presShell ||
       !targetFrame) {
@@ -2298,17 +2298,17 @@ void EventStateManager::SendLineScrollEv
   WidgetMouseScrollEvent event(aEvent->IsTrusted(),
                                eLegacyMouseLineOrPageScroll, aEvent->mWidget);
   event.mFlags.mDefaultPrevented = aState.mDefaultPrevented;
   event.mFlags.mDefaultPreventedByContent = aState.mDefaultPreventedByContent;
   event.mRefPoint = aEvent->mRefPoint;
   event.mTime = aEvent->mTime;
   event.mTimeStamp = aEvent->mTimeStamp;
   event.mModifiers = aEvent->mModifiers;
-  event.buttons = aEvent->buttons;
+  event.mButtons = aEvent->mButtons;
   event.mIsHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
   event.mDelta = aDelta;
   event.inputSource = aEvent->inputSource;
 
   nsEventStatus status = nsEventStatus_eIgnore;
   EventDispatcher::Dispatch(targetContent, aTargetFrame->PresContext(), &event,
                             nullptr, &status);
   aState.mDefaultPrevented =
@@ -2334,17 +2334,17 @@ void EventStateManager::SendPixelScrollE
   WidgetMouseScrollEvent event(aEvent->IsTrusted(), eLegacyMousePixelScroll,
                                aEvent->mWidget);
   event.mFlags.mDefaultPrevented = aState.mDefaultPrevented;
   event.mFlags.mDefaultPreventedByContent = aState.mDefaultPreventedByContent;
   event.mRefPoint = aEvent->mRefPoint;
   event.mTime = aEvent->mTime;
   event.mTimeStamp = aEvent->mTimeStamp;
   event.mModifiers = aEvent->mModifiers;
-  event.buttons = aEvent->buttons;
+  event.mButtons = aEvent->mButtons;
   event.mIsHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
   event.mDelta = aPixelDelta;
   event.inputSource = aEvent->inputSource;
 
   nsEventStatus status = nsEventStatus_eIgnore;
   EventDispatcher::Dispatch(targetContent, aTargetFrame->PresContext(), &event,
                             nullptr, &status);
   aState.mDefaultPrevented =
@@ -4090,17 +4090,17 @@ static void CreateMouseOrPointerWidgetEv
     aNewEvent =
         new WidgetMouseEvent(aMouseEvent->IsTrusted(), aMessage,
                              aMouseEvent->mWidget, WidgetMouseEvent::eReal);
     aNewEvent->mRelatedTarget = aRelatedContent;
   }
   aNewEvent->mRefPoint = aMouseEvent->mRefPoint;
   aNewEvent->mModifiers = aMouseEvent->mModifiers;
   aNewEvent->button = aMouseEvent->button;
-  aNewEvent->buttons = aMouseEvent->buttons;
+  aNewEvent->mButtons = aMouseEvent->mButtons;
   aNewEvent->pressure = aMouseEvent->pressure;
   aNewEvent->mPluginEvent = aMouseEvent->mPluginEvent;
   aNewEvent->inputSource = aMouseEvent->inputSource;
   aNewEvent->pointerId = aMouseEvent->pointerId;
 }
 
 nsIFrame* EventStateManager::DispatchMouseOrPointerEvent(
     WidgetMouseEvent* aMouseEvent, EventMessage aMessage,
@@ -4855,17 +4855,17 @@ nsresult EventStateManager::InitAndDispa
   MOZ_ASSERT(aMouseUpContent || aCurrentTarget || aOverrideClickTarget);
 
   WidgetMouseEvent event(aMouseUpEvent->IsTrusted(), aMessage,
                          aMouseUpEvent->mWidget, WidgetMouseEvent::eReal);
 
   event.mRefPoint = aMouseUpEvent->mRefPoint;
   event.mClickCount = aMouseUpEvent->mClickCount;
   event.mModifiers = aMouseUpEvent->mModifiers;
-  event.buttons = aMouseUpEvent->buttons;
+  event.mButtons = aMouseUpEvent->mButtons;
   event.mTime = aMouseUpEvent->mTime;
   event.mTimeStamp = aMouseUpEvent->mTimeStamp;
   event.mFlags.mOnlyChromeDispatch =
       aNoContentDispatch && !aMouseUpEvent->mUseLegacyNonPrimaryDispatch;
   event.mFlags.mNoContentDispatch = aNoContentDispatch;
   event.button = aMouseUpEvent->button;
   event.pointerId = aMouseUpEvent->pointerId;
   event.inputSource = aMouseUpEvent->inputSource;
--- a/dom/events/IMEContentObserver.cpp
+++ b/dom/events/IMEContentObserver.cpp
@@ -831,17 +831,17 @@ bool IMEContentObserver::OnMouseButtonEv
   IMENotification notification(NOTIFY_IME_OF_MOUSE_BUTTON_EVENT);
   notification.mMouseButtonEventData.mEventMessage = aMouseEvent->mMessage;
   notification.mMouseButtonEventData.mOffset = charAtPt.mReply.mOffset;
   notification.mMouseButtonEventData.mCursorPos.Set(
       charAtPt.mRefPoint.ToUnknownPoint());
   notification.mMouseButtonEventData.mCharRect.Set(
       charAtPt.mReply.mRect.ToUnknownRect());
   notification.mMouseButtonEventData.mButton = aMouseEvent->button;
-  notification.mMouseButtonEventData.mButtons = aMouseEvent->buttons;
+  notification.mMouseButtonEventData.mButtons = aMouseEvent->mButtons;
   notification.mMouseButtonEventData.mModifiers = aMouseEvent->mModifiers;
 
   nsresult rv = IMEStateManager::NotifyIME(notification, mWidget);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
 
   bool consumed = (rv == NS_SUCCESS_EVENT_CONSUMED);
--- a/dom/events/MouseEvent.cpp
+++ b/dom/events/MouseEvent.cpp
@@ -108,17 +108,17 @@ void MouseEvent::InitMouseEvent(const ns
     default:
       MOZ_CRASH("There is no space to store the modifiers");
   }
 }
 
 void MouseEvent::InitializeExtraMouseEventDictionaryMembers(
     const MouseEventInit& aParam) {
   InitModifiers(aParam);
-  mEvent->AsMouseEventBase()->buttons = aParam.mButtons;
+  mEvent->AsMouseEventBase()->mButtons = aParam.mButtons;
   mMovementPoint.x = aParam.mMovementX;
   mMovementPoint.y = aParam.mMovementY;
 }
 
 already_AddRefed<MouseEvent> MouseEvent::Constructor(
     const GlobalObject& aGlobal, const nsAString& aType,
     const MouseEventInit& aParam, ErrorResult& aRv) {
   nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
@@ -173,17 +173,17 @@ int16_t MouseEvent::Button() {
 uint16_t MouseEvent::Buttons() {
   switch (mEvent->mClass) {
     case eMouseEventClass:
     case eMouseScrollEventClass:
     case eWheelEventClass:
     case eDragEventClass:
     case ePointerEventClass:
     case eSimpleGestureEventClass:
-      return mEvent->AsMouseEventBase()->buttons;
+      return mEvent->AsMouseEventBase()->mButtons;
     default:
       MOZ_CRASH("Tried to get mouse buttons for non-mouse event!");
   }
 }
 
 already_AddRefed<EventTarget> MouseEvent::GetRelatedTarget() {
   nsCOMPtr<EventTarget> relatedTarget;
   switch (mEvent->mClass) {
--- a/dom/events/PointerEvent.cpp
+++ b/dom/events/PointerEvent.cpp
@@ -94,17 +94,17 @@ already_AddRefed<PointerEvent> PointerEv
   widgetEvent->mHeight = aParam.mHeight;
   widgetEvent->pressure = aParam.mPressure;
   widgetEvent->tangentialPressure = aParam.mTangentialPressure;
   widgetEvent->tiltX = aParam.mTiltX;
   widgetEvent->tiltY = aParam.mTiltY;
   widgetEvent->twist = aParam.mTwist;
   widgetEvent->inputSource = ConvertStringToPointerType(aParam.mPointerType);
   widgetEvent->mIsPrimary = aParam.mIsPrimary;
-  widgetEvent->buttons = aParam.mButtons;
+  widgetEvent->mButtons = aParam.mButtons;
 
   if (!aParam.mCoalescedEvents.IsEmpty()) {
     e->mCoalescedEvents.AppendElements(aParam.mCoalescedEvents);
   }
   e->SetTrusted(trusted);
   e->SetComposed(aParam.mComposed);
   return e.forget();
 }
@@ -169,17 +169,17 @@ float PointerEvent::Pressure(CallerType 
   }
 
   // According to [1], we should use 0.5 when it is in active buttons state and
   // 0 otherwise for devices that don't support pressure. And a pointerup event
   // always reports 0, so we don't need to spoof that.
   //
   // [1] https://www.w3.org/TR/pointerevents/#dom-pointerevent-pressure
   float spoofedPressure = 0.0;
-  if (mEvent->AsPointerEvent()->buttons) {
+  if (mEvent->AsPointerEvent()->mButtons) {
     spoofedPressure = 0.5;
   }
 
   return spoofedPressure;
 }
 
 float PointerEvent::TangentialPressure(CallerType aCallerType) {
   return ShouldResistFingerprinting(aCallerType)
--- a/dom/events/PointerEventHandler.cpp
+++ b/dom/events/PointerEventHandler.cpp
@@ -441,19 +441,19 @@ void PointerEventHandler::InitPointerEve
   MOZ_ASSERT(aMouseEvent);
   aPointerEvent->pointerId = aMouseEvent->pointerId;
   aPointerEvent->inputSource = aMouseEvent->inputSource;
   aPointerEvent->mMessage = aMessage;
   aPointerEvent->button = aMouseEvent->mMessage == eMouseMove
                               ? WidgetMouseEvent::eNoButton
                               : aMouseEvent->button;
 
-  aPointerEvent->buttons = aMouseEvent->buttons;
+  aPointerEvent->mButtons = aMouseEvent->mButtons;
   aPointerEvent->pressure =
-      aPointerEvent->buttons
+      aPointerEvent->mButtons
           ? aMouseEvent->pressure ? aMouseEvent->pressure : 0.5f
           : 0.0f;
 }
 
 /* static */
 void PointerEventHandler::InitPointerEventFromTouch(
     WidgetPointerEvent* aPointerEvent, WidgetTouchEvent* aTouchEvent,
     mozilla::dom::Touch* aTouch, bool aIsPrimary) {
@@ -475,17 +475,17 @@ void PointerEventHandler::InitPointerEve
   aPointerEvent->mWidth = aTouch->RadiusX(CallerType::System);
   aPointerEvent->mHeight = aTouch->RadiusY(CallerType::System);
   aPointerEvent->tiltX = aTouch->tiltX;
   aPointerEvent->tiltY = aTouch->tiltY;
   aPointerEvent->mTime = aTouchEvent->mTime;
   aPointerEvent->mTimeStamp = aTouchEvent->mTimeStamp;
   aPointerEvent->mFlags = aTouchEvent->mFlags;
   aPointerEvent->button = button;
-  aPointerEvent->buttons = buttons;
+  aPointerEvent->mButtons = buttons;
   aPointerEvent->inputSource = MouseEvent_Binding::MOZ_SOURCE_TOUCH;
 }
 
 /* static */
 void PointerEventHandler::DispatchPointerFromMouseOrTouch(
     PresShell* aShell, nsIFrame* aFrame, nsIContent* aContent,
     WidgetGUIEvent* aEvent, bool aDontRetargetEvents, nsEventStatus* aStatus,
     nsIContent** aTargetContent) {
@@ -505,21 +505,21 @@ void PointerEventHandler::DispatchPointe
     }
     int16_t button = mouseEvent->button;
     switch (mouseEvent->mMessage) {
       case eMouseMove:
         button = WidgetMouseEvent::eNoButton;
         pointerMessage = ePointerMove;
         break;
       case eMouseUp:
-        pointerMessage = mouseEvent->buttons ? ePointerMove : ePointerUp;
+        pointerMessage = mouseEvent->mButtons ? ePointerMove : ePointerUp;
         break;
       case eMouseDown:
         pointerMessage =
-            mouseEvent->buttons &
+            mouseEvent->mButtons &
                     ~nsContentUtils::GetButtonsFlagForButton(button)
                 ? ePointerMove
                 : ePointerDown;
         break;
       default:
         return;
     }
 
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -4186,17 +4186,17 @@ void HTMLInputElement::PostHandleEventFo
       if (nsIPresShell::GetCapturingContent()) {
         break;  // don't start drag if someone else is already capturing
       }
       WidgetInputEvent* inputEvent = aVisitor.mEvent->AsInputEvent();
       if (IgnoreInputEventWithModifier(inputEvent, true)) {
         break;  // ignore
       }
       if (aVisitor.mEvent->mMessage == eMouseDown) {
-        if (aVisitor.mEvent->AsMouseEvent()->buttons ==
+        if (aVisitor.mEvent->AsMouseEvent()->mButtons ==
             WidgetMouseEvent::eLeftButtonFlag) {
           StartRangeThumbDrag(inputEvent);
         } else if (mIsDraggingRange) {
           CancelRangeThumbDrag();
         }
       } else {
         if (aVisitor.mEvent->AsTouchEvent()->mTouches.Length() == 1) {
           StartRangeThumbDrag(inputEvent);
--- a/dom/ipc/CoalescedMouseData.cpp
+++ b/dom/ipc/CoalescedMouseData.cpp
@@ -23,17 +23,17 @@ void CoalescedMouseData::Coalesce(const 
     MOZ_ASSERT(!mCoalescedInputEvent->mCoalescedWidgetEvents);
   } else {
     MOZ_ASSERT(mGuid == aGuid);
     MOZ_ASSERT(mInputBlockId == aInputBlockId);
     MOZ_ASSERT(mCoalescedInputEvent->mModifiers == aEvent.mModifiers);
     MOZ_ASSERT(mCoalescedInputEvent->mReason == aEvent.mReason);
     MOZ_ASSERT(mCoalescedInputEvent->inputSource == aEvent.inputSource);
     MOZ_ASSERT(mCoalescedInputEvent->button == aEvent.button);
-    MOZ_ASSERT(mCoalescedInputEvent->buttons == aEvent.buttons);
+    MOZ_ASSERT(mCoalescedInputEvent->mButtons == aEvent.mButtons);
     mCoalescedInputEvent->mTimeStamp = aEvent.mTimeStamp;
     mCoalescedInputEvent->mRefPoint = aEvent.mRefPoint;
     mCoalescedInputEvent->pressure = aEvent.pressure;
     mCoalescedInputEvent->AssignPointerHelperData(aEvent);
   }
 
   if (aEvent.mMessage == eMouseMove &&
       PointerEventHandler::IsPointerEventEnabled()) {
@@ -57,17 +57,17 @@ bool CoalescedMouseData::CanCoalesce(con
                                      const ScrollableLayerGuid& aGuid,
                                      const uint64_t& aInputBlockId) {
   MOZ_ASSERT(aEvent.mMessage == eMouseMove);
   return !mCoalescedInputEvent ||
          (mCoalescedInputEvent->mModifiers == aEvent.mModifiers &&
           mCoalescedInputEvent->inputSource == aEvent.inputSource &&
           mCoalescedInputEvent->pointerId == aEvent.pointerId &&
           mCoalescedInputEvent->button == aEvent.button &&
-          mCoalescedInputEvent->buttons == aEvent.buttons && mGuid == aGuid &&
+          mCoalescedInputEvent->mButtons == aEvent.mButtons && mGuid == aGuid &&
           mInputBlockId == aInputBlockId);
 }
 
 void CoalescedMouseMoveFlusher::WillRefresh(mozilla::TimeStamp aTime) {
   MOZ_ASSERT(mRefreshDriver);
   mTabChild->FlushAllCoalescedMouseData();
   mTabChild->ProcessPendingCoalescedMouseDataAndDispatchEvents();
 }
--- a/widget/InputData.cpp
+++ b/widget/InputData.cpp
@@ -278,17 +278,17 @@ MouseInput::MouseInput(MouseType aType, 
       mHandledByAPZ(false) {}
 
 MouseInput::MouseInput(const WidgetMouseEventBase& aMouseEvent)
     : InputData(MOUSE_INPUT, aMouseEvent.mTime, aMouseEvent.mTimeStamp,
                 aMouseEvent.mModifiers),
       mType(MOUSE_NONE),
       mButtonType(NONE),
       mInputSource(aMouseEvent.inputSource),
-      mButtons(aMouseEvent.buttons),
+      mButtons(aMouseEvent.mButtons),
       mHandledByAPZ(aMouseEvent.mFlags.mHandledByAPZ) {
   MOZ_ASSERT(NS_IsMainThread(),
              "Can only copy from WidgetTouchEvent on main thread");
 
   mButtonType = NONE;
 
   switch (aMouseEvent.button) {
     case WidgetMouseEventBase::eLeftButton:
@@ -406,17 +406,17 @@ WidgetMouseEvent MouseInput::ToWidgetMou
     case MouseInput::RIGHT_BUTTON:
       event.button = WidgetMouseEventBase::eRightButton;
       break;
     case MouseInput::NONE:
     default:
       break;
   }
 
-  event.buttons = mButtons;
+  event.mButtons = mButtons;
   event.mModifiers = modifiers;
   event.mTime = mTime;
   event.mTimeStamp = mTimeStamp;
   event.mFlags.mHandledByAPZ = mHandledByAPZ;
   event.mRefPoint = RoundedToInt(ViewAs<LayoutDevicePixel>(
       mOrigin,
       PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent));
   event.mClickCount = clickCount;
@@ -471,17 +471,17 @@ bool PanGestureInput::IsMomentum() const
 WidgetWheelEvent PanGestureInput::ToWidgetWheelEvent(nsIWidget* aWidget) const {
   WidgetWheelEvent wheelEvent(true, eWheel, aWidget);
   wheelEvent.mModifiers = this->modifiers;
   wheelEvent.mTime = mTime;
   wheelEvent.mTimeStamp = mTimeStamp;
   wheelEvent.mRefPoint = RoundedToInt(ViewAs<LayoutDevicePixel>(
       mPanStartPoint,
       PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent));
-  wheelEvent.buttons = 0;
+  wheelEvent.mButtons = 0;
   wheelEvent.mDeltaMode = WheelEvent_Binding::DOM_DELTA_PIXEL;
   wheelEvent.mMayHaveMomentum = true;  // pan inputs may have momentum
   wheelEvent.mIsMomentum = IsMomentum();
   wheelEvent.mLineOrPageDeltaX = mLineOrPageDeltaX;
   wheelEvent.mLineOrPageDeltaY = mLineOrPageDeltaY;
   wheelEvent.mDeltaX = mPanDisplacement.x;
   wheelEvent.mDeltaY = mPanDisplacement.y;
   wheelEvent.mFlags.mHandledByAPZ = mHandledByAPZ;
@@ -685,17 +685,17 @@ WidgetWheelEvent ScrollWheelInput::ToWid
     nsIWidget* aWidget) const {
   WidgetWheelEvent wheelEvent(true, eWheel, aWidget);
   wheelEvent.mModifiers = this->modifiers;
   wheelEvent.mTime = mTime;
   wheelEvent.mTimeStamp = mTimeStamp;
   wheelEvent.mRefPoint = RoundedToInt(ViewAs<LayoutDevicePixel>(
       mOrigin,
       PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent));
-  wheelEvent.buttons = 0;
+  wheelEvent.mButtons = 0;
   wheelEvent.mDeltaMode = DeltaModeForDeltaType(mDeltaType);
   wheelEvent.mMayHaveMomentum = mMayHaveMomentum;
   wheelEvent.mIsMomentum = mIsMomentum;
   wheelEvent.mDeltaX = mDeltaX;
   wheelEvent.mDeltaY = mDeltaY;
   wheelEvent.mLineOrPageDeltaX = mLineOrPageDeltaX;
   wheelEvent.mLineOrPageDeltaY = mLineOrPageDeltaY;
   wheelEvent.mAllowToOverrideSystemScrollSpeed =
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -91,29 +91,29 @@ class WidgetPointerHelper {
 class WidgetMouseEventBase : public WidgetInputEvent {
  private:
   friend class dom::PBrowserParent;
   friend class dom::PBrowserChild;
 
  protected:
   WidgetMouseEventBase()
       : button(0),
-        buttons(0),
+        mButtons(0),
         pressure(0),
         hitCluster(false)
         // Including MouseEventBinding.h here leads to an include loop, so
         // we have to hardcode MouseEvent_Binding::MOZ_SOURCE_MOUSE.
         ,
         inputSource(/* MouseEvent_Binding::MOZ_SOURCE_MOUSE = */ 1) {}
 
   WidgetMouseEventBase(bool aIsTrusted, EventMessage aMessage,
                        nsIWidget* aWidget, EventClassID aEventClassID)
       : WidgetInputEvent(aIsTrusted, aMessage, aWidget, aEventClassID),
         button(0),
-        buttons(0),
+        mButtons(0),
         pressure(0),
         hitCluster(false)
         // Including MouseEventBinding.h here leads to an include loop, so
         // we have to hardcode MouseEvent_Binding::MOZ_SOURCE_MOUSE.
         ,
         inputSource(/* MouseEvent_Binding::MOZ_SOURCE_MOUSE = */ 1) {}
 
  public:
@@ -143,41 +143,43 @@ class WidgetMouseEventBase : public Widg
     e4thButtonFlag = 0x08,
     // typicall, "forward" button being right side of 5-button
     // mice, see "buttons" attribute document of DOM3 Events.
     e5thButtonFlag = 0x10
   };
 
   // Flags of all pressed buttons at the event fired.
   // This is set at any mouse event, don't be confused with |button|.
-  int16_t buttons;
+  int16_t mButtons;
 
   // Finger or touch pressure of event. It ranges between 0.0 and 1.0.
   float pressure;
   // Touch near a cluster of links (true)
   bool hitCluster;
 
   // Possible values a in MouseEvent
   uint16_t inputSource;
 
   // ID of the canvas HitRegion
   nsString region;
 
-  bool IsLeftButtonPressed() const { return !!(buttons & eLeftButtonFlag); }
-  bool IsRightButtonPressed() const { return !!(buttons & eRightButtonFlag); }
-  bool IsMiddleButtonPressed() const { return !!(buttons & eMiddleButtonFlag); }
-  bool Is4thButtonPressed() const { return !!(buttons & e4thButtonFlag); }
-  bool Is5thButtonPressed() const { return !!(buttons & e5thButtonFlag); }
+  bool IsLeftButtonPressed() const { return !!(mButtons & eLeftButtonFlag); }
+  bool IsRightButtonPressed() const { return !!(mButtons & eRightButtonFlag); }
+  bool IsMiddleButtonPressed() const {
+    return !!(mButtons & eMiddleButtonFlag);
+  }
+  bool Is4thButtonPressed() const { return !!(mButtons & e4thButtonFlag); }
+  bool Is5thButtonPressed() const { return !!(mButtons & e5thButtonFlag); }
 
   void AssignMouseEventBaseData(const WidgetMouseEventBase& aEvent,
                                 bool aCopyTargets) {
     AssignInputEventData(aEvent, aCopyTargets);
 
     button = aEvent.button;
-    buttons = aEvent.buttons;
+    mButtons = aEvent.mButtons;
     pressure = aEvent.pressure;
     hitCluster = aEvent.hitCluster;
     inputSource = aEvent.inputSource;
   }
 
   /**
    * Returns true if left click event.
    */
--- a/widget/cocoa/SwipeTracker.mm
+++ b/widget/cocoa/SwipeTracker.mm
@@ -178,17 +178,17 @@ void SwipeTracker::UnregisterFromRefresh
     EventMessage aMsg, nsIWidget* aWidget, const LayoutDeviceIntPoint& aPosition,
     const TimeStamp& aTimeStamp) {
   // XXX Why isn't this initialized with nsCocoaUtils::InitInputEvent()?
   WidgetSimpleGestureEvent geckoEvent(true, aMsg, aWidget);
   geckoEvent.mModifiers = 0;
   // XXX How about geckoEvent.mTime?
   geckoEvent.mTimeStamp = aTimeStamp;
   geckoEvent.mRefPoint = aPosition;
-  geckoEvent.buttons = 0;
+  geckoEvent.mButtons = 0;
   return geckoEvent;
 }
 
 bool SwipeTracker::SendSwipeEvent(EventMessage aMsg, uint32_t aDirection, double aDelta,
                                   const TimeStamp& aTimeStamp) {
   WidgetSimpleGestureEvent geckoEvent =
       CreateSwipeGestureEvent(aMsg, &mWidget, mEventPosition, aTimeStamp);
   geckoEvent.mDirection = aDirection;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -4582,33 +4582,33 @@ static gfx::IntPoint GetIntegerDeltaForE
   nsCocoaUtils::InitInputEvent(*outGeckoEvent, aMouseEvent);
 
   // convert point to view coordinate system
   NSPoint locationInWindow = nsCocoaUtils::EventLocationForWindow(aMouseEvent, [self window]);
 
   outGeckoEvent->mRefPoint = [self convertWindowCoordinates:locationInWindow];
 
   WidgetMouseEventBase* mouseEvent = outGeckoEvent->AsMouseEventBase();
-  mouseEvent->buttons = 0;
+  mouseEvent->mButtons = 0;
   NSUInteger mouseButtons = [NSEvent pressedMouseButtons];
 
   if (mouseButtons & 0x01) {
-    mouseEvent->buttons |= WidgetMouseEvent::eLeftButtonFlag;
+    mouseEvent->mButtons |= WidgetMouseEvent::eLeftButtonFlag;
   }
   if (mouseButtons & 0x02) {
-    mouseEvent->buttons |= WidgetMouseEvent::eRightButtonFlag;
+    mouseEvent->mButtons |= WidgetMouseEvent::eRightButtonFlag;
   }
   if (mouseButtons & 0x04) {
-    mouseEvent->buttons |= WidgetMouseEvent::eMiddleButtonFlag;
+    mouseEvent->mButtons |= WidgetMouseEvent::eMiddleButtonFlag;
   }
   if (mouseButtons & 0x08) {
-    mouseEvent->buttons |= WidgetMouseEvent::e4thButtonFlag;
+    mouseEvent->mButtons |= WidgetMouseEvent::e4thButtonFlag;
   }
   if (mouseButtons & 0x10) {
-    mouseEvent->buttons |= WidgetMouseEvent::e5thButtonFlag;
+    mouseEvent->mButtons |= WidgetMouseEvent::e5thButtonFlag;
   }
 
   switch ([aMouseEvent type]) {
     case NSLeftMouseDown:
     case NSLeftMouseUp:
     case NSLeftMouseDragged:
     case NSRightMouseDown:
     case NSRightMouseUp:
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -1045,39 +1045,39 @@ void KeymapWrapper::InitInputEvent(Widge
     case eDragEventClass:
     case eSimpleGestureEventClass:
       break;
     default:
       return;
   }
 
   WidgetMouseEventBase& mouseEvent = *aInputEvent.AsMouseEventBase();
-  mouseEvent.buttons = 0;
+  mouseEvent.mButtons = 0;
   if (aModifierState & GDK_BUTTON1_MASK) {
-    mouseEvent.buttons |= WidgetMouseEvent::eLeftButtonFlag;
+    mouseEvent.mButtons |= WidgetMouseEvent::eLeftButtonFlag;
   }
   if (aModifierState & GDK_BUTTON3_MASK) {
-    mouseEvent.buttons |= WidgetMouseEvent::eRightButtonFlag;
+    mouseEvent.mButtons |= WidgetMouseEvent::eRightButtonFlag;
   }
   if (aModifierState & GDK_BUTTON2_MASK) {
-    mouseEvent.buttons |= WidgetMouseEvent::eMiddleButtonFlag;
+    mouseEvent.mButtons |= WidgetMouseEvent::eMiddleButtonFlag;
   }
 
   if (doLog) {
     MOZ_LOG(
         gKeymapWrapperLog, LogLevel::Debug,
-        ("%p InitInputEvent, aInputEvent has buttons, "
-         "aInputEvent.buttons=0x%04X (Left: %s, Right: %s, Middle: %s, "
+        ("%p InitInputEvent, aInputEvent has mButtons, "
+         "aInputEvent.mButtons=0x%04X (Left: %s, Right: %s, Middle: %s, "
          "4th (BACK): %s, 5th (FORWARD): %s)",
-         keymapWrapper, mouseEvent.buttons,
-         GetBoolName(mouseEvent.buttons & WidgetMouseEvent::eLeftButtonFlag),
-         GetBoolName(mouseEvent.buttons & WidgetMouseEvent::eRightButtonFlag),
-         GetBoolName(mouseEvent.buttons & WidgetMouseEvent::eMiddleButtonFlag),
-         GetBoolName(mouseEvent.buttons & WidgetMouseEvent::e4thButtonFlag),
-         GetBoolName(mouseEvent.buttons & WidgetMouseEvent::e5thButtonFlag)));
+         keymapWrapper, mouseEvent.mButtons,
+         GetBoolName(mouseEvent.mButtons & WidgetMouseEvent::eLeftButtonFlag),
+         GetBoolName(mouseEvent.mButtons & WidgetMouseEvent::eRightButtonFlag),
+         GetBoolName(mouseEvent.mButtons & WidgetMouseEvent::eMiddleButtonFlag),
+         GetBoolName(mouseEvent.mButtons & WidgetMouseEvent::e4thButtonFlag),
+         GetBoolName(mouseEvent.mButtons & WidgetMouseEvent::e5thButtonFlag)));
   }
 }
 
 /* static */
 uint32_t KeymapWrapper::ComputeDOMKeyCode(const GdkEventKey* aGdkKeyEvent) {
   // If the keyval indicates it's a modifier key, we should use unshifted
   // key's modifier keyval.
   guint keyval = aGdkKeyEvent->keyval;
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -127,28 +127,28 @@ struct ParamTraits<mozilla::WidgetInputE
 
 template <>
 struct ParamTraits<mozilla::WidgetMouseEventBase> {
   typedef mozilla::WidgetMouseEventBase paramType;
 
   static void Write(Message* aMsg, const paramType& aParam) {
     WriteParam(aMsg, static_cast<const mozilla::WidgetInputEvent&>(aParam));
     WriteParam(aMsg, aParam.button);
-    WriteParam(aMsg, aParam.buttons);
+    WriteParam(aMsg, aParam.mButtons);
     WriteParam(aMsg, aParam.pressure);
     WriteParam(aMsg, aParam.hitCluster);
     WriteParam(aMsg, aParam.inputSource);
   }
 
   static bool Read(const Message* aMsg, PickleIterator* aIter,
                    paramType* aResult) {
     return ReadParam(aMsg, aIter,
                      static_cast<mozilla::WidgetInputEvent*>(aResult)) &&
            ReadParam(aMsg, aIter, &aResult->button) &&
-           ReadParam(aMsg, aIter, &aResult->buttons) &&
+           ReadParam(aMsg, aIter, &aResult->mButtons) &&
            ReadParam(aMsg, aIter, &aResult->pressure) &&
            ReadParam(aMsg, aIter, &aResult->hitCluster) &&
            ReadParam(aMsg, aIter, &aResult->inputSource);
   }
 };
 
 template <>
 struct ParamTraits<mozilla::WidgetWheelEvent> {
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -911,31 +911,31 @@ void ModifierKeyState::InitInputEvent(Wi
 void ModifierKeyState::InitMouseEvent(WidgetInputEvent& aMouseEvent) const {
   NS_ASSERTION(aMouseEvent.mClass == eMouseEventClass ||
                    aMouseEvent.mClass == eWheelEventClass ||
                    aMouseEvent.mClass == eDragEventClass ||
                    aMouseEvent.mClass == eSimpleGestureEventClass,
                "called with non-mouse event");
 
   WidgetMouseEventBase& mouseEvent = *aMouseEvent.AsMouseEventBase();
-  mouseEvent.buttons = 0;
+  mouseEvent.mButtons = 0;
   if (::GetKeyState(VK_LBUTTON) < 0) {
-    mouseEvent.buttons |= WidgetMouseEvent::eLeftButtonFlag;
+    mouseEvent.mButtons |= WidgetMouseEvent::eLeftButtonFlag;
   }
   if (::GetKeyState(VK_RBUTTON) < 0) {
-    mouseEvent.buttons |= WidgetMouseEvent::eRightButtonFlag;
+    mouseEvent.mButtons |= WidgetMouseEvent::eRightButtonFlag;
   }
   if (::GetKeyState(VK_MBUTTON) < 0) {
-    mouseEvent.buttons |= WidgetMouseEvent::eMiddleButtonFlag;
+    mouseEvent.mButtons |= WidgetMouseEvent::eMiddleButtonFlag;
   }
   if (::GetKeyState(VK_XBUTTON1) < 0) {
-    mouseEvent.buttons |= WidgetMouseEvent::e4thButtonFlag;
+    mouseEvent.mButtons |= WidgetMouseEvent::e4thButtonFlag;
   }
   if (::GetKeyState(VK_XBUTTON2) < 0) {
-    mouseEvent.buttons |= WidgetMouseEvent::e5thButtonFlag;
+    mouseEvent.mButtons |= WidgetMouseEvent::e5thButtonFlag;
   }
 }
 
 bool ModifierKeyState::IsShift() const {
   return (mModifiers & MODIFIER_SHIFT) != 0;
 }
 
 bool ModifierKeyState::IsControl() const {
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -4248,17 +4248,17 @@ bool nsWindow::DispatchMouseEvent(EventM
 
   event.button = aButton;
   event.inputSource = aInputSource;
   if (aPointerInfo) {
     // Mouse events from Windows WM_POINTER*. Fill more information in
     // WidgetMouseEvent.
     event.AssignPointerHelperData(*aPointerInfo);
     event.pressure = aPointerInfo->mPressure;
-    event.buttons = aPointerInfo->mButtons;
+    event.mButtons = aPointerInfo->mButtons;
   } else {
     // If we get here the mouse events must be from non-touch sources, so
     // convert it to pointer events as well
     event.convertToPointer = true;
     event.pointerId = pointerId;
   }
 
   bool insideMovementThreshold =