Commit 3d3574eb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Pass the right 'this' argument to event handlers.

parent 28d918f5
......@@ -296,7 +296,7 @@ static dispex_data_t *get_dispex_data(DispatchEx *This)
return This->data->data;
}
void call_disp_func(HTMLDocument *doc, IDispatch *disp)
void call_disp_func(HTMLDocument *doc, IDispatch *disp, IDispatch *this_obj)
{
DISPID named_arg = DISPID_THIS;
VARIANTARG arg;
......@@ -313,7 +313,7 @@ void call_disp_func(HTMLDocument *doc, IDispatch *disp)
}
V_VT(&arg) = VT_DISPATCH;
V_DISPATCH(&arg) = (IDispatch*)HTMLWINDOW2(doc->window);
V_DISPATCH(&arg) = this_obj;
VariantInit(&res);
memset(&ei, 0, sizeof(ei));
......
......@@ -436,7 +436,7 @@ void fire_event(HTMLDocument *doc, eventid_t eid, nsIDOMNode *target)
event_obj = doc->window->event = create_event();
TRACE("%s >>>\n", debugstr_w(event_info[eid].name));
call_disp_func(doc, node->event_target->event_table[eid]);
call_disp_func(doc, node->event_target->event_table[eid], (IDispatch*)HTMLDOMNODE(node));
TRACE("%s <<<\n", debugstr_w(event_info[eid].name));
}
......@@ -462,7 +462,7 @@ void fire_event(HTMLDocument *doc, eventid_t eid, nsIDOMNode *target)
event_obj = doc->window->event = create_event();
TRACE("doc %s >>>\n", debugstr_w(event_info[eid].name));
call_disp_func(doc, doc->event_target->event_table[eid]);
call_disp_func(doc, doc->event_target->event_table[eid], (IDispatch*)HTMLDOC(doc));
TRACE("doc %s <<<\n", debugstr_w(event_info[eid].name));
}
......
......@@ -655,7 +655,7 @@ HRESULT clear_task_timer(HTMLDocument*,BOOL,DWORD);
HRESULT get_typeinfo(tid_t,ITypeInfo**);
void release_typelib(void);
void call_disp_func(HTMLDocument*,IDispatch*);
void call_disp_func(HTMLDocument*,IDispatch*,IDispatch*);
const char *debugstr_variant(const VARIANT*);
......
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