Bug 1162050 - Remove draggesture and eLegacyDragDrop from comments in EventStateManager.cpp/.h. r=enn

MozReview-Commit-ID: FXErW3vo36q

--HG--
extra : rebase_source : b57895e5e15f641ce679b0f3082868c397b635c9
This commit is contained in:
Jimmy Wang 2016-05-27 15:43:17 -04:00
Родитель 39278a5bb6
Коммит 81ebc7d712
2 изменённых файлов: 6 добавлений и 13 удалений

Просмотреть файл

@ -710,8 +710,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
} }
break; break;
case eDragOver: case eDragOver:
// eDrop is fired before eLegacyDragDrop so send the enter/exit events // Send the enter/exit events before eDrop.
// before eDrop.
GenerateDragDropEnterExit(aPresContext, aEvent->AsDragEvent()); GenerateDragDropEnterExit(aPresContext, aEvent->AsDragEvent());
break; break;
@ -1784,9 +1783,7 @@ EventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
// Set the current target to the content for the mouse down // Set the current target to the content for the mouse down
mCurrentTargetContent = targetContent; mCurrentTargetContent = targetContent;
// Dispatch both the dragstart and draggesture events to the DOM. For // Dispatch the dragstart event to the DOM.
// 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; nsEventStatus status = nsEventStatus_eIgnore;
EventDispatcher::Dispatch(targetContent, aPresContext, &startEvent, EventDispatcher::Dispatch(targetContent, aPresContext, &startEvent,
nullptr, &status); nullptr, &status);
@ -1803,7 +1800,7 @@ EventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
} }
// now that the dataTransfer has been updated in the dragstart and // 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. // change during the drag.
dataTransfer->SetReadOnly(); dataTransfer->SetReadOnly();
@ -1816,10 +1813,6 @@ EventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
} }
} }
// 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 // Reset mCurretTargetContent to what it was
mCurrentTargetContent = targetBeforeEvent; mCurrentTargetContent = targetBeforeEvent;
} }
@ -1924,7 +1917,7 @@ EventStateManager::DoDefaultDragStart(nsPresContext* aPresContext,
if (!dragService) if (!dragService)
return false; 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 // First, check if a drag session already exists. This means that the drag
// service was called directly within a draggesture handler. In this case, // service was called directly within a draggesture handler. In this case,

Просмотреть файл

@ -855,11 +855,11 @@ protected:
nsIContent** aTargetNode); 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 * drag for aDataTransfer if it contains any data. Returns true if a drag has
* started. * started.
* *
* aDragEvent - the dragstart/draggesture event * aDragEvent - the dragstart event
* aDataTransfer - the data transfer that holds the data to be dragged * aDataTransfer - the data transfer that holds the data to be dragged
* aDragTarget - the target of the drag * aDragTarget - the target of the drag
* aSelection - the selection to be dragged * aSelection - the selection to be dragged