mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1135627 - Add implementation of DragEvent constructor. r=jdm r=smaug
This commit is contained in:
parent
4da8d623df
commit
f3a3ed962d
@ -131,6 +131,26 @@ DragEvent::GetDataTransfer()
|
||||
return dragEvent->dataTransfer;
|
||||
}
|
||||
|
||||
// static
|
||||
already_AddRefed<DragEvent>
|
||||
DragEvent::Constructor(const GlobalObject& aGlobal,
|
||||
const nsAString& aType,
|
||||
const DragEventInit& aParam,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<EventTarget> t = do_QueryInterface(aGlobal.GetAsSupports());
|
||||
nsRefPtr<DragEvent> e = new DragEvent(t, nullptr, nullptr);
|
||||
bool trusted = e->Init(t);
|
||||
aRv = e->InitDragEvent(aType, aParam.mBubbles, aParam.mCancelable,
|
||||
aParam.mView, aParam.mDetail, aParam.mScreenX,
|
||||
aParam.mScreenY, aParam.mClientX, aParam.mClientY,
|
||||
aParam.mCtrlKey, aParam.mAltKey, aParam.mShiftKey,
|
||||
aParam.mMetaKey, aParam.mButton, aParam.mRelatedTarget,
|
||||
aParam.mDataTransfer);
|
||||
e->SetTrusted(trusted);
|
||||
return e.forget();
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
@ -48,6 +48,11 @@ public:
|
||||
DataTransfer* aDataTransfer,
|
||||
ErrorResult& aError);
|
||||
|
||||
static already_AddRefed<DragEvent> Constructor(const GlobalObject& aGlobal,
|
||||
const nsAString& aType,
|
||||
const DragEventInit& aParam,
|
||||
ErrorResult& aRv);
|
||||
|
||||
protected:
|
||||
~DragEvent() {}
|
||||
};
|
||||
|
@ -824,6 +824,21 @@ while (testWheelProps.length) {
|
||||
}
|
||||
}
|
||||
|
||||
// DragEvent
|
||||
|
||||
try {
|
||||
e = new DragEvent();
|
||||
} catch(exp) {
|
||||
ex = true;
|
||||
}
|
||||
ok(ex, "DragEvent: First parameter is required!");
|
||||
ex = false;
|
||||
|
||||
e = new DragEvent("hello");
|
||||
is(e.type, "hello", "DragEvent: Wrong event type!");
|
||||
document.dispatchEvent(e);
|
||||
is(receivedEvent, e, "DragEvent: Wrong event!");
|
||||
|
||||
// TransitionEvent
|
||||
e = new TransitionEvent("hello", { propertyName: "color", elapsedTime: 3.5, pseudoElement: "", foobar: "baz" })
|
||||
is("propertyName" in e, true, "Transition events have propertyName property");
|
||||
|
@ -4,6 +4,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
[Constructor(DOMString type, optional DragEventInit eventInitDict)]
|
||||
interface DragEvent : MouseEvent
|
||||
{
|
||||
readonly attribute DataTransfer? dataTransfer;
|
||||
@ -26,3 +27,8 @@ interface DragEvent : MouseEvent
|
||||
EventTarget? aRelatedTarget,
|
||||
DataTransfer? aDataTransfer);
|
||||
};
|
||||
|
||||
dictionary DragEventInit : MouseEventInit
|
||||
{
|
||||
DataTransfer? dataTransfer = null;
|
||||
};
|
||||
|
@ -2220,9 +2220,6 @@
|
||||
[DataTransferItem interface: operation getAsFile()]
|
||||
expected: FAIL
|
||||
|
||||
[DragEvent interface object length]
|
||||
expected: FAIL
|
||||
|
||||
[Window interface: existence and properties of interface prototype object]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -6,42 +6,3 @@
|
||||
[DragEvent should have all of the inherited init*Event methods]
|
||||
expected: FAIL
|
||||
|
||||
[initMouseEvent should not throw]
|
||||
expected: FAIL
|
||||
|
||||
[initUIEvent should not throw]
|
||||
expected: FAIL
|
||||
|
||||
[initEvent should not throw]
|
||||
expected: FAIL
|
||||
|
||||
[DragEvent constructor with null as the dataTransfer parameter should be able to fire the event]
|
||||
expected: FAIL
|
||||
|
||||
[DragEvent constructor with undefined as the dataTransfer parameter should be able to fire the event]
|
||||
expected: FAIL
|
||||
|
||||
[initMouseEvent should be able to fire the event]
|
||||
expected: FAIL
|
||||
|
||||
[initUIEvent should be able to fire the event]
|
||||
expected: FAIL
|
||||
|
||||
[initEvent should be able to fire the event]
|
||||
expected: FAIL
|
||||
|
||||
[DragEvent constructor with null as the dataTransfer parameter should give null as the dataTransfer]
|
||||
expected: FAIL
|
||||
|
||||
[DragEvent constructor with undefined as the dataTransfer parameter should give null as the dataTransfer]
|
||||
expected: FAIL
|
||||
|
||||
[initMouseEvent should give null as the dataTransfer]
|
||||
expected: FAIL
|
||||
|
||||
[initUIEvent should give null as the dataTransfer]
|
||||
expected: FAIL
|
||||
|
||||
[initEvent should give null as the dataTransfer]
|
||||
expected: FAIL
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user