Bug 541520, don't fire dragleave on successful drop, but do fire it when drop fails or is cancelled, r=jonas,smichaud

This commit is contained in:
Neil Deakin 2010-02-01 10:11:08 -05:00
parent 4a555e66d7
commit 40511b2e0e
2 changed files with 2 additions and 2 deletions

View File

@ -1133,7 +1133,6 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
KillClickHoldTimer();
break;
#endif
case NS_DRAGDROP_DROP:
case NS_DRAGDROP_OVER:
// NS_DRAGDROP_DROP is fired before NS_DRAGDROP_DRAGDROP so send
// the enter/exit events before NS_DRAGDROP_DROP.
@ -3629,7 +3628,6 @@ nsEventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
}
break;
case NS_DRAGDROP_DROP:
case NS_DRAGDROP_EXIT:
{
//This is actually the window mouse exit event.

View File

@ -5941,6 +5941,8 @@ static BOOL keyUpAlreadySentKeyDown = NO;
// the |canDrop| property of the Drag Session.
PRBool canDrop = PR_FALSE;
if (!NS_SUCCEEDED(dragSession->GetCanDrop(&canDrop)) || !canDrop) {
[self doDragAction:NS_DRAGDROP_EXIT sender:aSender];
nsCOMPtr<nsIDOMNode> sourceNode;
dragSession->GetSourceNode(getter_AddRefs(sourceNode));
if (!sourceNode) {