mshtml: Expose IDOMCustomEvent to scripts.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
757c3025c1
commit
7c2ec67d1e
|
@ -2211,6 +2211,18 @@ static dispex_static_data_t DOMKeyboardEvent_dispex = {
|
||||||
DOMKeyboardEvent_iface_tids
|
DOMKeyboardEvent_iface_tids
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const tid_t DOMCustomEvent_iface_tids[] = {
|
||||||
|
IDOMEvent_tid,
|
||||||
|
IDOMCustomEvent_tid,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
static dispex_static_data_t DOMCustomEvent_dispex = {
|
||||||
|
NULL,
|
||||||
|
DispDOMCustomEvent_tid,
|
||||||
|
DOMCustomEvent_iface_tids
|
||||||
|
};
|
||||||
|
|
||||||
static BOOL check_event_iface(nsIDOMEvent *event, REFIID riid)
|
static BOOL check_event_iface(nsIDOMEvent *event, REFIID riid)
|
||||||
{
|
{
|
||||||
nsISupports *iface;
|
nsISupports *iface;
|
||||||
|
@ -2243,6 +2255,7 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, eventid_t event_id)
|
||||||
custom_event->event.query_interface = DOMCustomEvent_query_interface;
|
custom_event->event.query_interface = DOMCustomEvent_query_interface;
|
||||||
custom_event->event.destroy = DOMCustomEvent_destroy;
|
custom_event->event.destroy = DOMCustomEvent_destroy;
|
||||||
event = &custom_event->event;
|
event = &custom_event->event;
|
||||||
|
dispex_data = &DOMCustomEvent_dispex;
|
||||||
}else if(!event) {
|
}else if(!event) {
|
||||||
event = heap_alloc_zero(sizeof(*event));
|
event = heap_alloc_zero(sizeof(*event));
|
||||||
if(!event)
|
if(!event)
|
||||||
|
|
|
@ -769,6 +769,20 @@ function test_keyboard_event() {
|
||||||
next_test();
|
next_test();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_custom_event() {
|
||||||
|
var e = document.createEvent("CustomEvent");
|
||||||
|
|
||||||
|
ok(e.detail === undefined, "detail = " + e.detail);
|
||||||
|
|
||||||
|
e.initCustomEvent("test", true, false, 123);
|
||||||
|
ok(e.type === "test", "type = " + e.type);
|
||||||
|
ok(e.bubbles === true, "bubbles = " + e.bubbles);
|
||||||
|
ok(e.cancelable === false, "cancelable = " + e.cancelable);
|
||||||
|
ok(e.detail === 123, "detail = " + e.detail);
|
||||||
|
|
||||||
|
next_test();
|
||||||
|
}
|
||||||
|
|
||||||
function test_error_event() {
|
function test_error_event() {
|
||||||
document.body.innerHTML = '<div><img></img></div>';
|
document.body.innerHTML = '<div><img></img></div>';
|
||||||
var div = document.body.firstChild;
|
var div = document.body.firstChild;
|
||||||
|
@ -822,6 +836,7 @@ var tests = [
|
||||||
test_ui_event,
|
test_ui_event,
|
||||||
test_mouse_event,
|
test_mouse_event,
|
||||||
test_keyboard_event,
|
test_keyboard_event,
|
||||||
|
test_custom_event,
|
||||||
test_error_event,
|
test_error_event,
|
||||||
test_detached_img_error_event,
|
test_detached_img_error_event,
|
||||||
test_time_stamp,
|
test_time_stamp,
|
||||||
|
|
Loading…
Reference in New Issue