Bug 1162050 - Remove use of eLegacyDragGesture from EventStateManager.cpp.
MozReview-Commit-ID: F4a52Yw5ri3
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -697,17 +697,17 @@ EventStateManager::PreHandleEvent(nsPres
GenerateDragGesture(aPresContext, mouseEvent);
UpdateCursor(aPresContext, aEvent, mCurrentTarget, aStatus);
GenerateMouseEnterExit(mouseEvent);
// Flush pending layout changes, so that later mouse move events
// will go to the right nodes.
FlushPendingEvents(aPresContext);
break;
}
- case eLegacyDragGesture:
+ case eDragStart:
if (Prefs::ClickHoldContextMenu()) {
// an external drag gesture event came in, not generated internally
// by Gecko. Make sure we get rid of the click-hold timer.
KillClickHoldTimer();
}
break;
case eDragOver:
// eDrop is fired before eLegacyDragDrop so send the enter/exit events
@@ -1761,22 +1761,18 @@ EventStateManager::GenerateDragGesture(n
sLastDragOverFrame = nullptr;
nsCOMPtr<nsIWidget> widget = mCurrentTarget->GetNearestWidget();
// get the widget from the target frame
WidgetDragEvent startEvent(aEvent->IsTrusted(), eDragStart, widget);
FillInEventFromGestureDown(&startEvent);
- WidgetDragEvent gestureEvent(aEvent->IsTrusted(),
- eLegacyDragGesture, widget);
- FillInEventFromGestureDown(&gestureEvent);
-
- startEvent.mDataTransfer = gestureEvent.mDataTransfer = dataTransfer;
- startEvent.inputSource = gestureEvent.inputSource = aEvent->inputSource;
+ startEvent.mDataTransfer = dataTransfer;
+ startEvent.inputSource = aEvent->inputSource;
// Dispatch to the DOM. By setting mCurrentTarget we are faking
// out the ESM and telling it that the current target frame is
// actually where the mouseDown occurred, otherwise it will use
// the frame the mouse is currently over which may or may not be
// the same. (Note: saari and I have decided that we don't have
// to reset |mCurrentTarget| when we're through because no one
// else is doing anything more with this event and it will get
@@ -1791,22 +1787,16 @@ EventStateManager::GenerateDragGesture(n
// Dispatch both the dragstart and draggesture events to the DOM. For
// elements in an editor, only fire the draggesture event so that the
// editor code can handle it but content doesn't see a dragstart.
nsEventStatus status = nsEventStatus_eIgnore;
EventDispatcher::Dispatch(targetContent, aPresContext, &startEvent,
nullptr, &status);
WidgetDragEvent* event = &startEvent;
- if (status != nsEventStatus_eConsumeNoDefault) {
- status = nsEventStatus_eIgnore;
- EventDispatcher::Dispatch(targetContent, aPresContext, &gestureEvent,
- nullptr, &status);
- event = &gestureEvent;
- }
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
// Emit observer event to allow addons to modify the DataTransfer object.
if (observerService) {
observerService->NotifyObservers(dataTransfer,
"on-datatransfer-available",
nullptr);