Bug 1259661 part.10 Clean up some nits of WidgetMouseEvent definition r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 10 May 2016 21:57:16 +0900
changeset 366162 11194cb04c74fa6667ab4dad83024eca05f888dc
parent 366161 9f79558ba09f3655b253b2905cbcaf524014965a
child 366163 4c31267f1548a995a402f09ad2bfa041706881c4
push id17909
push usermasayuki@d-toybox.com
push dateThu, 12 May 2016 03:02:36 +0000
reviewerssmaug
bugs1259661
milestone49.0a1
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;