Bug 1259661 part.10 Clean up some nits of WidgetMouseEvent definition r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 10 May 2016 21:57:16 +0900
changeset 338112 ea5f22cee4e9144cc6fa918c889d19a08bbb87a4
parent 338111 45f9098ac7f716df57a204d919a497a5b6283ebd
child 338113 c3f5e6079284a7b7053c41f05d0fe06ff031db03
child 338147 f940ea93119c2bcaf1010e58b0bec75c99a10c7b
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1259661
milestone49.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 1259661 part.10 Clean up some nits of WidgetMouseEvent definition r=smaug MozReview-Commit-ID: 9e4F8gOmRpZ
widget/MouseEvents.h
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -169,21 +169,22 @@ public:
     return mMessage == eMouseClick && button == eLeftButton;
   }
 };
 
 /******************************************************************************
  * mozilla::WidgetMouseEvent
  ******************************************************************************/
 
-class WidgetMouseEvent : public WidgetMouseEventBase, public WidgetPointerHelper
+class WidgetMouseEvent : public WidgetMouseEventBase
+                       , public WidgetPointerHelper
 {
 private:
-  friend class mozilla::dom::PBrowserParent;
-  friend class mozilla::dom::PBrowserChild;
+  friend class dom::PBrowserParent;
+  friend class dom::PBrowserChild;
 
 public:
   typedef bool ReasonType;
   enum Reason : ReasonType
   {
     eReal,
     eSynthesized
   };
@@ -207,18 +208,21 @@ protected:
     : mReason(eReal)
     , mContextMenuTrigger(eNormal)
     , mExitFrom(eChild)
     , mIgnoreRootScrollFrame(false)
     , mClickCount(0)
   {
   }
 
-  WidgetMouseEvent(bool aIsTrusted, EventMessage aMessage, nsIWidget* aWidget,
-                   EventClassID aEventClassID, Reason aReason)
+  WidgetMouseEvent(bool aIsTrusted,
+                   EventMessage aMessage,
+                   nsIWidget* aWidget,
+                   EventClassID aEventClassID,
+                   Reason aReason)
     : WidgetMouseEventBase(aIsTrusted, aMessage, aWidget, aEventClassID)
     , mReason(aReason)
     , mContextMenuTrigger(eNormal)
     , mExitFrom(eChild)
     , mIgnoreRootScrollFrame(false)
     , mClickCount(0)
   {
   }
@@ -262,26 +266,38 @@ public:
     WidgetMouseEvent* result =
       new WidgetMouseEvent(false, mMessage, nullptr,
                            mReason, mContextMenuTrigger);
     result->AssignMouseEventData(*this, true);
     result->mFlags = mFlags;
     return result;
   }
 
+  // mReason indicates the reason why the event is fired:
+  // - Representing mouse operation.
+  // - Synthesized for emulating mousemove event when the content under the
+  //   mouse cursor is scrolled.
   Reason mReason;
 
+  // mContextMenuTrigger is valid only when mMessage is eContextMenu.
+  // This indicates if the context menu event is caused by context menu key or
+  // other reasons (typically, a click of right mouse button).
   ContextMenuTrigger mContextMenuTrigger;
 
+  // mExitFrom is valid only when mMessage is eMouseExitFromWidget.
+  // This indicates if the mouse cursor exits from a top level widget or
+  // a child widget.
   ExitFrom mExitFrom;
 
   // Whether the event should ignore scroll frame bounds during dispatch.
   bool mIgnoreRootScrollFrame;
 
-  /// The number of mouse clicks.
+  // mClickCount may be non-zero value when mMessage is eMouseDown, eMouseUp,
+  // eMouseClick or eMouseDoubleClick. The number is count of mouse clicks.
+  // Otherwise, this must be 0.
   uint32_t mClickCount;
 
   void AssignMouseEventData(const WidgetMouseEvent& aEvent, bool aCopyTargets)
   {
     AssignMouseEventBaseData(aEvent, aCopyTargets);
     AssignPointerHelperData(aEvent);
 
     mIgnoreRootScrollFrame = aEvent.mIgnoreRootScrollFrame;