From 9454cd4141977deab81daafc40416469508155b5 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 20 Jul 2018 07:46:50 +0200 Subject: Bug 1351193 - Added new DataTransfer constructor --- dom/events/DataTransfer.cpp | 17 +++-------------- dom/events/DataTransfer.h | 3 +-- 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'dom/events') diff --git a/dom/events/DataTransfer.cpp b/dom/events/DataTransfer.cpp index 2c6ecdd56..45c72e662 100644 --- a/dom/events/DataTransfer.cpp +++ b/dom/events/DataTransfer.cpp @@ -161,22 +161,11 @@ DataTransfer::~DataTransfer() // static already_AddRefed -DataTransfer::Constructor(const GlobalObject& aGlobal, - const nsAString& aEventType, bool aIsExternal, - ErrorResult& aRv) +DataTransfer::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv) { - nsAutoCString onEventType("on"); - AppendUTF16toUTF8(aEventType, onEventType); - nsCOMPtr eventTypeAtom = NS_Atomize(onEventType); - if (!eventTypeAtom) { - aRv.Throw(NS_ERROR_OUT_OF_MEMORY); - return nullptr; - } - - EventMessage eventMessage = nsContentUtils::GetEventMessage(eventTypeAtom); RefPtr transfer = new DataTransfer(aGlobal.GetAsSupports(), - eventMessage, aIsExternal, - -1); + eCopy, /* is external */ false, /* clipboard type */ -1); + transfer->mEffectAllowed = nsIDragService::DRAGDROP_ACTION_NONE; return transfer.forget(); } diff --git a/dom/events/DataTransfer.h b/dom/events/DataTransfer.h index 7c6b0b8c1..344593ed0 100644 --- a/dom/events/DataTransfer.h +++ b/dom/events/DataTransfer.h @@ -115,8 +115,7 @@ public: } static already_AddRefed - Constructor(const GlobalObject& aGlobal, const nsAString& aEventType, - bool aIsExternal, ErrorResult& aRv); + Constructor(const GlobalObject& aGlobal, ErrorResult& aRv); void GetDropEffect(nsString& aDropEffect) { -- cgit v1.2.3