Bug 1256589 part.2 Move the implementation of StopImmediatePropagation() from dom::Event to WidgetEvent r=smaug
MozReview-Commit-ID: ERTfIhS8bBi
--- 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;
}
/**