зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
9faac2d527
Коммит
23d55876c9
|
@ -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();
|
||||
}
|
||||
session->SetCanDrop(dropAllowed);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче