mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 18:07:31 +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
|
// static
|
||||||
already_AddRefed<DataTransfer>
|
already_AddRefed<DataTransfer>
|
||||||
DataTransfer::Constructor(const GlobalObject& aGlobal,
|
DataTransfer::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
|
||||||
const nsAString& aEventType, bool aIsExternal,
|
|
||||||
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(),
|
RefPtr<DataTransfer> transfer = new DataTransfer(aGlobal.GetAsSupports(),
|
||||||
eventMessage, aIsExternal,
|
eCopy, /* is external */ false, /* clipboard type */ -1);
|
||||||
-1);
|
transfer->mEffectAllowed = nsIDragService::DRAGDROP_ACTION_NONE;
|
||||||
return transfer.forget();
|
return transfer.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,8 +115,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
static already_AddRefed<DataTransfer>
|
static already_AddRefed<DataTransfer>
|
||||||
Constructor(const GlobalObject& aGlobal, const nsAString& aEventType,
|
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
|
||||||
bool aIsExternal, ErrorResult& aRv);
|
|
||||||
|
|
||||||
void GetDropEffect(nsString& aDropEffect)
|
void GetDropEffect(nsString& aDropEffect)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
* http://www.whatwg.org/specs/web-apps/current-work/#the-datatransfer-interface
|
* http://www.whatwg.org/specs/web-apps/current-work/#the-datatransfer-interface
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[ChromeConstructor(DOMString eventType, boolean isExternal)]
|
[Constructor]
|
||||||
interface DataTransfer {
|
interface DataTransfer {
|
||||||
attribute DOMString dropEffect;
|
attribute DOMString dropEffect;
|
||||||
attribute DOMString effectAllowed;
|
attribute DOMString effectAllowed;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue