Bug 526286 - Detaching a tab by dragging it down into its content area stopped working, r=enndeakin, sr=jonas

--HG--
extra : rebase_source : 7b04c1dc00bb1e55eba73222d185b37cbbb125be
This commit is contained in:
Olli Pettay 2009-11-05 16:39:18 +02:00
parent 71866f28cb
commit 2c424b3794
2 changed files with 3 additions and 19 deletions

View File

@ -328,24 +328,7 @@ nsContentAreaDragDrop::DragOver(nsIDOMDragEvent* inEvent)
}
}
nsCOMPtr<nsIDOMNSEvent> e = do_QueryInterface(inEvent);
NS_ENSURE_STATE(e);
nsCOMPtr<nsIDOMEventTarget> target;
e->GetOriginalTarget(getter_AddRefs(target));
nsCOMPtr<nsINode> node = do_QueryInterface(target);
if (!node) {
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(target);
if (win) {
node = do_QueryInterface(win->GetExtantDocument());
}
}
PRBool isChrome =
node ? nsContentUtils::IsChromeDoc(node->GetOwnerDoc()) : PR_FALSE;
if (isChrome) {
session->SetCanDrop(dropAllowed);
} else if (dropAllowed) {
inEvent->PreventDefault();
}
return NS_OK;
}

View File

@ -3133,7 +3133,8 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
!(aEvent->flags & NS_EVENT_FLAG_NO_DEFAULT_CALLED_IN_CONTENT));
}
} else if (aEvent->message == NS_DRAGDROP_OVER && !isChromeDoc) {
dragSession->SetCanDrop(PR_FALSE);
// No one called preventDefault(), so handle drop only in chrome.
dragSession->SetOnlyChromeDrop(PR_TRUE);
}
// now set the drop effect in the initial dataTransfer. This ensures