зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1153518, allow drops on editors when the source is a remote browser, r=ehsan
This commit is contained in:
Родитель
f746c45281
Коммит
ec3b6406c8
|
@ -70,4 +70,6 @@ LOCAL_INCLUDES += [
|
|||
'/layout/xul',
|
||||
]
|
||||
|
||||
include('/ipc/chromium/chromium-config.mozbuild')
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
|
|
@ -59,6 +59,8 @@
|
|||
#include "nsIBidiKeyboard.h" // for nsIBidiKeyboard
|
||||
#endif
|
||||
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
|
||||
class nsPresContext;
|
||||
|
||||
using namespace mozilla;
|
||||
|
@ -985,6 +987,14 @@ nsEditorEventListener::CanDrop(nsIDOMDragEvent* aEvent)
|
|||
return true;
|
||||
}
|
||||
|
||||
// If the source node is a remote browser, treat this as coming from a
|
||||
// different document and allow the drop.
|
||||
nsCOMPtr<nsIContent> sourceContent = do_QueryInterface(sourceNode);
|
||||
TabParent* tp = TabParent::GetFrom(sourceContent);
|
||||
if (tp) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsRefPtr<Selection> selection = mEditor->GetSelection();
|
||||
if (!selection) {
|
||||
return false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче