summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-07-20 07:46:50 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-07-20 07:46:50 +0200
commit9454cd4141977deab81daafc40416469508155b5 (patch)
tree32ff9e7a34831c2f538fd1f68b5613e1da133754
parent1ef8b01c52fdf51404c6a6b27201123322d17e81 (diff)
downloadUXP-9454cd4141977deab81daafc40416469508155b5.tar
UXP-9454cd4141977deab81daafc40416469508155b5.tar.gz
UXP-9454cd4141977deab81daafc40416469508155b5.tar.lz
UXP-9454cd4141977deab81daafc40416469508155b5.tar.xz
UXP-9454cd4141977deab81daafc40416469508155b5.zip
Bug 1351193 - Added new DataTransfer constructor
-rw-r--r--dom/events/DataTransfer.cpp17
-rw-r--r--dom/events/DataTransfer.h3
-rw-r--r--dom/webidl/DataTransfer.webidl2
3 files changed, 5 insertions, 17 deletions
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>
-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<nsIAtom> eventTypeAtom = NS_Atomize(onEventType);
- if (!eventTypeAtom) {
- aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
- return nullptr;
- }
-
- EventMessage eventMessage = nsContentUtils::GetEventMessage(eventTypeAtom);
RefPtr<DataTransfer> 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<DataTransfer>
- Constructor(const GlobalObject& aGlobal, const nsAString& aEventType,
- bool aIsExternal, ErrorResult& aRv);
+ Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
void GetDropEffect(nsString& aDropEffect)
{
diff --git a/dom/webidl/DataTransfer.webidl b/dom/webidl/DataTransfer.webidl
index 206d80804..dd44e1ddc 100644
--- a/dom/webidl/DataTransfer.webidl
+++ b/dom/webidl/DataTransfer.webidl
@@ -7,7 +7,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/#the-datatransfer-interface
*/
-[ChromeConstructor(DOMString eventType, boolean isExternal)]
+[Constructor]
interface DataTransfer {
attribute DOMString dropEffect;
attribute DOMString effectAllowed;