mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1351193 - Part 1: Added new DataTransfer constructor, r=nika
Deleted the old Chrome DataTransfer constructor because it was only used for some tests which can be easily changed. Added a new constructor that is not Chrome Only. MozReview-Commit-ID: HjcgafSiWfM
This commit is contained in:
parent
535f1df913
commit
61c5f540ba
@ -197,22 +197,12 @@ 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);
|
||||
RefPtr<nsAtom> 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();
|
||||
}
|
||||
|
||||
|
@ -119,8 +119,7 @@ public:
|
||||
}
|
||||
|
||||
static already_AddRefed<DataTransfer>
|
||||
Constructor(const GlobalObject& aGlobal, const nsAString& aEventType,
|
||||
bool aIsExternal, ErrorResult& aRv);
|
||||
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
|
||||
|
||||
/**
|
||||
* The actual effect that will be used, and should always be one of the
|
||||
|
@ -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;
|
||||
|
@ -1,4 +0,0 @@
|
||||
[datatransfer-constructor-001.html]
|
||||
[Verify DataTransfer constructor]
|
||||
expected: FAIL
|
||||
|
Loading…
Reference in New Issue
Block a user