Commit c1079f25 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use bind_event in set_event_handler.

parent 7950f780
......@@ -1399,7 +1399,7 @@ static void remove_event_handler(EventTarget *event_target, eventid_t eid)
}
}
static HRESULT set_event_handler_disp(EventTarget *event_target, HTMLDocumentNode *doc, eventid_t eid, IDispatch *disp)
static HRESULT set_event_handler_disp(EventTarget *event_target, eventid_t eid, IDispatch *disp)
{
event_target_t *data;
......@@ -1417,10 +1417,11 @@ static HRESULT set_event_handler_disp(EventTarget *event_target, HTMLDocumentNod
data->event_table[eid]->handler_prop = disp;
IDispatch_AddRef(disp);
return ensure_doc_nsevent_handler(doc, eid);
bind_event(event_target, eid);
return S_OK;
}
HRESULT set_event_handler(EventTarget *event_target, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var)
HRESULT set_event_handler(EventTarget *event_target, eventid_t eid, VARIANT *var)
{
switch(V_VT(var)) {
case VT_NULL:
......@@ -1428,7 +1429,7 @@ HRESULT set_event_handler(EventTarget *event_target, HTMLDocumentNode *doc, even
return S_OK;
case VT_DISPATCH:
return set_event_handler_disp(event_target, doc, eid, V_DISPATCH(var));
return set_event_handler_disp(event_target, eid, V_DISPATCH(var));
case VT_BSTR: {
VARIANT *v;
......@@ -1562,7 +1563,7 @@ void bind_target_event(HTMLDocumentNode *doc, EventTarget *event_target, const W
return;
}
set_event_handler_disp(event_target, doc, eid, disp);
set_event_handler_disp(event_target, eid, disp);
}
void update_doc_cp_events(HTMLDocumentNode *doc, cp_static_data_t *cp)
......@@ -1597,7 +1598,7 @@ void check_event_attr(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
if(disp) {
hres = get_node(doc, (nsIDOMNode*)nselem, TRUE, &node);
if(SUCCEEDED(hres)) {
set_event_handler_disp(&node->event_target, node->doc, i, disp);
set_event_handler_disp(&node->event_target, i, disp);
node_release(node);
}
IDispatch_Release(disp);
......
......@@ -54,7 +54,7 @@ eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN;
void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN;
void release_event_target(event_target_t*) DECLSPEC_HIDDEN;
void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN;
HRESULT set_event_handler(EventTarget*,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
HRESULT set_event_handler(EventTarget*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
HRESULT get_event_handler(EventTarget*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
HRESULT attach_event(EventTarget*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
HRESULT detach_event(EventTarget*,BSTR,IDispatch*) DECLSPEC_HIDDEN;
......@@ -74,7 +74,7 @@ void detach_nsevent(HTMLDocumentNode*,const WCHAR*) DECLSPEC_HIDDEN;
static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
{
return set_event_handler(&node->event_target, node->doc, eid, var);
return set_event_handler(&node->event_target, eid, var);
}
static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
......
......@@ -95,7 +95,7 @@ static inline HRESULT set_window_event(HTMLWindow *window, eventid_t eid, VARIAN
return E_FAIL;
}
return set_event_handler(&window->inner_window->event_target, window->inner_window->doc, eid, var);
return set_event_handler(&window->inner_window->event_target, eid, var);
}
static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var)
......
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