mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-29 17:31:07 +00:00
Bug 1351193 - Added new DataTransfer constructor
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user