Bug 1162050 - Remove draggesture and eLegacyDragDrop from comments in EventStateManager.cpp/.h.
MozReview-Commit-ID: FXErW3vo36q
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -705,18 +705,17 @@ EventStateManager::PreHandleEvent(nsPres
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
- // before eDrop.
+ // Send the enter/exit events before eDrop.
GenerateDragDropEnterExit(aPresContext, aEvent->AsDragEvent());
break;
case eKeyPress:
{
WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
int32_t modifierMask = 0;
@@ -1779,52 +1778,46 @@ EventStateManager::GenerateDragGesture(n
// reset on the very next event to the correct frame).
// Hold onto old target content through the event and reset after.
nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
// Set the current target to the content for the mouse down
mCurrentTargetContent = targetContent;
- // 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.
+ // Dispatch the dragstart event to the DOM.
nsEventStatus status = nsEventStatus_eIgnore;
EventDispatcher::Dispatch(targetContent, aPresContext, &startEvent,
nullptr, &status);
WidgetDragEvent* event = &startEvent;
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);
}
// now that the dataTransfer has been updated in the dragstart and
- // draggesture events, make it readonly so that the data doesn't
+ // draggesture events, make it read only so that the data doesn't
// change during the drag.
dataTransfer->SetReadOnly();
if (status != nsEventStatus_eConsumeNoDefault) {
bool dragStarted = DoDefaultDragStart(aPresContext, event, dataTransfer,
targetContent, selection);
if (dragStarted) {
sActiveESM = nullptr;
aEvent->StopPropagation();
}
}
- // Note that frame event handling doesn't care about eLegacyDragGesture,
- // which is just as well since we don't really know which frame to
- // send it to
-
// Reset mCurretTargetContent to what it was
mCurrentTargetContent = targetBeforeEvent;
}
// Now flush all pending notifications, for better responsiveness
// while dragging.
FlushPendingEvents(aPresContext);
}
@@ -1919,17 +1912,17 @@ EventStateManager::DoDefaultDragStart(ns
nsIContent* aDragTarget,
nsISelection* aSelection)
{
nsCOMPtr<nsIDragService> dragService =
do_GetService("@mozilla.org/widget/dragservice;1");
if (!dragService)
return false;
- // Default handling for the draggesture/dragstart event.
+ // Default handling for the dragstart event.
//
// First, check if a drag session already exists. This means that the drag
// service was called directly within a draggesture handler. In this case,
// don't do anything more, as it is assumed that the handler is managing
// drag and drop manually. Make sure to return true to indicate that a drag
// began.
nsCOMPtr<nsIDragSession> dragSession;
dragService->GetCurrentSession(getter_AddRefs(dragSession));
--- a/dom/events/EventStateManager.h
+++ b/dom/events/EventStateManager.h
@@ -850,21 +850,21 @@ protected:
*/
void DetermineDragTargetAndDefaultData(nsPIDOMWindowOuter* aWindow,
nsIContent* aSelectionTarget,
dom::DataTransfer* aDataTransfer,
nsISelection** aSelection,
nsIContent** aTargetNode);
/*
- * Perform the default handling for the dragstart/draggesture event and set up a
+ * Perform the default handling for the dragstart event and set up a
* drag for aDataTransfer if it contains any data. Returns true if a drag has
* started.
*
- * aDragEvent - the dragstart/draggesture event
+ * aDragEvent - the dragstart event
* aDataTransfer - the data transfer that holds the data to be dragged
* aDragTarget - the target of the drag
* aSelection - the selection to be dragged
*/
bool DoDefaultDragStart(nsPresContext* aPresContext,
WidgetDragEvent* aDragEvent,
dom::DataTransfer* aDataTransfer,
nsIContent* aDragTarget,