Bug 1259663 - Clean up WidgetMouseScrollEvent. r=masayuki
authorshundroid <ra24483@qb3.so-net.ne.jp>
Wed, 06 Apr 2016 16:44:11 +0900
changeset 291850 5448e34dc116967151f3f6a0271d8ae4a2304796
parent 291849 b0b19497c80c49c7f3fe259faf052fde16acf80c
child 291872 49d808d13f4fab71b49019905cce3ba6eb6bb31f
push id74699
push usermasayuki@d-toybox.com
push dateWed, 06 Apr 2016 09:39:32 +0000
treeherdermozilla-inbound@5448e34dc116 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1259663
milestone48.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 1259663 - Clean up WidgetMouseScrollEvent. r=masayuki MozReview-Commit-ID: F98luwO9y1N
dom/events/EventStateManager.cpp
dom/events/MouseScrollEvent.cpp
widget/MouseEvents.h
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2298,18 +2298,18 @@ EventStateManager::SendLineScrollEvent(n
   event.mFlags.mDefaultPrevented = aState.mDefaultPrevented;
   event.mFlags.mDefaultPreventedByContent = aState.mDefaultPreventedByContent;
   event.refPoint = aEvent->refPoint;
   event.widget = aEvent->widget;
   event.mTime = aEvent->mTime;
   event.mTimeStamp = aEvent->mTimeStamp;
   event.mModifiers = aEvent->mModifiers;
   event.buttons = aEvent->buttons;
-  event.isHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
-  event.delta = aDelta;
+  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 =
     event.DefaultPrevented() || status == nsEventStatus_eConsumeNoDefault;
   aState.mDefaultPreventedByContent = event.DefaultPreventedByContent();
@@ -2338,18 +2338,18 @@ EventStateManager::SendPixelScrollEvent(
   event.mFlags.mDefaultPrevented = aState.mDefaultPrevented;
   event.mFlags.mDefaultPreventedByContent = aState.mDefaultPreventedByContent;
   event.refPoint = aEvent->refPoint;
   event.widget = aEvent->widget;
   event.mTime = aEvent->mTime;
   event.mTimeStamp = aEvent->mTimeStamp;
   event.mModifiers = aEvent->mModifiers;
   event.buttons = aEvent->buttons;
-  event.isHorizontal = (aDeltaDirection == DELTA_DIRECTION_X);
-  event.delta = aPixelDelta;
+  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 =
     event.DefaultPrevented() || status == nsEventStatus_eConsumeNoDefault;
   aState.mDefaultPreventedByContent = event.DefaultPreventedByContent();
--- a/dom/events/MouseScrollEvent.cpp
+++ b/dom/events/MouseScrollEvent.cpp
@@ -24,17 +24,17 @@ MouseScrollEvent::MouseScrollEvent(Event
   } else {
     mEventIsInternal = true;
     mEvent->mTime = PR_Now();
     mEvent->refPoint.x = mEvent->refPoint.y = 0;
     static_cast<WidgetMouseEventBase*>(mEvent)->inputSource =
       nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 
-  mDetail = mEvent->AsMouseScrollEvent()->delta;
+  mDetail = mEvent->AsMouseScrollEvent()->mDelta;
 }
 
 NS_IMPL_ADDREF_INHERITED(MouseScrollEvent, MouseEvent)
 NS_IMPL_RELEASE_INHERITED(MouseScrollEvent, MouseEvent)
 
 NS_INTERFACE_MAP_BEGIN(MouseScrollEvent)
 NS_INTERFACE_MAP_END_INHERITING(MouseEvent)
 
@@ -55,24 +55,24 @@ MouseScrollEvent::InitMouseScrollEvent(c
                                        uint16_t aButton,
                                        EventTarget* aRelatedTarget,
                                        int32_t aAxis)
 {
   MouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable, aView, aDetail,
                              aScreenX, aScreenY, aClientX, aClientY,
                              aCtrlKey, aAltKey, aShiftKey, aMetaKey, aButton,
                              aRelatedTarget);
-  mEvent->AsMouseScrollEvent()->isHorizontal =
+  mEvent->AsMouseScrollEvent()->mIsHorizontal =
     (aAxis == nsIDOMMouseScrollEvent::HORIZONTAL_AXIS);
 }
 
 int32_t
 MouseScrollEvent::Axis()
 {
-  return mEvent->AsMouseScrollEvent()->isHorizontal ?
+  return mEvent->AsMouseScrollEvent()->mIsHorizontal ?
           static_cast<int32_t>(nsIDOMMouseScrollEvent::HORIZONTAL_AXIS) :
           static_cast<int32_t>(nsIDOMMouseScrollEvent::VERTICAL_AXIS);
 }
 
 } // namespace dom
 } // namespace mozilla
 
 using namespace mozilla;
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -378,33 +378,33 @@ public:
  * DOMMouseScroll and MozMousePixelScroll event.  These events are NOT hanbled
  * by ESM even if widget dispatches them.  Use new WidgetWheelEvent instead.
  ******************************************************************************/
 
 class WidgetMouseScrollEvent : public WidgetMouseEventBase
 {
 private:
   WidgetMouseScrollEvent()
-    : delta(0)
-    , isHorizontal(false)
+    : mDelta(0)
+    , mIsHorizontal(false)
   {
   }
 
 public:
   virtual WidgetMouseScrollEvent* AsMouseScrollEvent() override
   {
     return this;
   }
 
   WidgetMouseScrollEvent(bool aIsTrusted, EventMessage aMessage,
                          nsIWidget* aWidget)
     : WidgetMouseEventBase(aIsTrusted, aMessage, aWidget,
                            eMouseScrollEventClass)
-    , delta(0)
-    , isHorizontal(false)
+    , mDelta(0)
+    , mIsHorizontal(false)
   {
   }
 
   virtual WidgetEvent* Duplicate() const override
   {
     MOZ_ASSERT(mClass == eMouseScrollEventClass,
                "Duplicate() must be overridden by sub class");
     // Not copying widget, it is a weak reference.
@@ -416,29 +416,29 @@ public:
   }
 
   // The delta value of mouse scroll event.
   // If the event message is eLegacyMouseLineOrPageScroll, the value indicates
   // scroll amount in lines.  However, if the value is
   // nsIDOMUIEvent::SCROLL_PAGE_UP or nsIDOMUIEvent::SCROLL_PAGE_DOWN, the
   // value inducates one page scroll.  If the event message is
   // eLegacyMousePixelScroll, the value indicates scroll amount in pixels.
-  int32_t delta;
+  int32_t mDelta;
 
   // If this is true, it may cause to scroll horizontally.
   // Otherwise, vertically.
-  bool isHorizontal;
+  bool mIsHorizontal;
 
   void AssignMouseScrollEventData(const WidgetMouseScrollEvent& aEvent,
                                   bool aCopyTargets)
   {
     AssignMouseEventBaseData(aEvent, aCopyTargets);
 
-    delta = aEvent.delta;
-    isHorizontal = aEvent.isHorizontal;
+    mDelta = aEvent.mDelta;
+    mIsHorizontal = aEvent.mIsHorizontal;
   }
 };
 
 /******************************************************************************
  * mozilla::WidgetWheelEvent
  ******************************************************************************/
 
 class WidgetWheelEvent : public WidgetMouseEventBase