mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 10:57:34 +09:00
Bug 1351193 - Added new DataTransfer constructor
This commit is contained in:
parent
b2c7373dba
commit
6e67c59787
3 changed files with 5 additions and 17 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue