Bug 1256589 part.2 Move the implementation of StopImmediatePropagation() from dom::Event to WidgetEvent r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 17 Mar 2016 11:57:42 +0900
changeset 289986 e8b19f55d829528f41f25a08dc8b1d18cfbbfb2b
parent 289985 87b0d12a4d1c1c046b67098aad80c9089ae6f7a9
child 289987 93b3ea492ea730775bd5c8023195a3e0a1504019
push id18337
push usercbook@mozilla.com
push dateWed, 23 Mar 2016 15:30:25 +0000
treeherderfx-team@67ac681f7e53 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1256589
milestone48.0a1
Bug 1256589 part.2 Move the implementation of StopImmediatePropagation() from dom::Event to WidgetEvent r=smaug MozReview-Commit-ID: ERTfIhS8bBi
dom/events/Event.cpp
widget/BasicEvents.h
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -468,18 +468,17 @@ Event::StopPropagation()
 {
   mEvent->StopPropagation();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 Event::StopImmediatePropagation()
 {
-  mEvent->StopPropagation();
-  mEvent->mFlags.mImmediatePropagationStopped = true;
+  mEvent->StopImmediatePropagation();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 Event::StopCrossProcessForwarding()
 {
   mEvent->mFlags.mNoCrossProcessBoundaryForwarding = true;
   return NS_OK;
--- a/widget/BasicEvents.h
+++ b/widget/BasicEvents.h
@@ -132,16 +132,21 @@ public:
 
   /**
    * Helper methods for methods of DOM Event.
    */
   inline void StopPropagation()
   {
     mPropagationStopped = true;
   }
+  inline void StopImmediatePropagation()
+  {
+    StopPropagation();
+    mImmediatePropagationStopped = true;
+  }
 
   inline void Clear()
   {
     SetRawFlags(0);
   }
   // Get if either the instance's bit or the aOther's bit is true, the
   // instance's bit becomes true.  In other words, this works like:
   // eventFlags |= aOther;
@@ -315,16 +320,17 @@ public:
     currentTarget = aCopyTargets ? aEvent.currentTarget : nullptr;
     originalTarget = aCopyTargets ? aEvent.originalTarget : nullptr;
   }
 
   /**
    * Helper methods for methods of DOM Event.
    */
   void StopPropagation() { mFlags.StopPropagation(); }
+  void StopImmediatePropagation() { mFlags.StopImmediatePropagation(); }
 
   void PreventDefault()
   {
     mFlags.mDefaultPrevented = true;
     mFlags.mDefaultPreventedByChrome = true;
   }
 
   /**