Bug 1256589 part.2 Move the implementation of StopImmediatePropagation() from dom::Event to WidgetEvent r=smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 17 Mar 2016 11:57:42 +0900
changeset 343712 e67b968789b51c08ca4b9ccbea37462d7b509f0c
parent 343711 0e5743583f80b3e9e09397f49bd438bfe0f49d06
child 343713 2f8d49412e32eec4a0a8f599984d057637f491a1
push id13674
push usermasayuki@d-toybox.com
push dateWed, 23 Mar 2016 04:52:25 +0000
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;
   }
 
   /**