Commit 7c2ec67d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Expose IDOMCustomEvent to scripts.

parent 757c3025
......@@ -2211,6 +2211,18 @@ static dispex_static_data_t DOMKeyboardEvent_dispex = {
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)
{
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.destroy = DOMCustomEvent_destroy;
event = &custom_event->event;
dispex_data = &DOMCustomEvent_dispex;
}else if(!event) {
event = heap_alloc_zero(sizeof(*event));
if(!event)
......
......@@ -769,6 +769,20 @@ function test_keyboard_event() {
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() {
document.body.innerHTML = '<div><img></img></div>';
var div = document.body.firstChild;
......@@ -822,6 +836,7 @@ var tests = [
test_ui_event,
test_mouse_event,
test_keyboard_event,
test_custom_event,
test_error_event,
test_detached_img_error_event,
test_time_stamp,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment