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

mshtml: Pass EventTarget to get_event_handler.

parent f2659775
...@@ -1462,18 +1462,20 @@ HRESULT set_event_handler(EventTarget *event_target, HTMLDocumentNode *doc, even ...@@ -1462,18 +1462,20 @@ HRESULT set_event_handler(EventTarget *event_target, HTMLDocumentNode *doc, even
return S_OK; return S_OK;
} }
HRESULT get_event_handler(DispatchEx *dispex, event_target_t **event_target, eventid_t eid, VARIANT *var) HRESULT get_event_handler(EventTarget *event_target, eventid_t eid, VARIANT *var)
{ {
event_target_t *data;
VARIANT *v; VARIANT *v;
HRESULT hres; HRESULT hres;
hres = dispex_get_dprop_ref(dispex, event_info[eid].attr_name, FALSE, &v); hres = dispex_get_dprop_ref(&event_target->dispex, event_info[eid].attr_name, FALSE, &v);
if(SUCCEEDED(hres) && V_VT(v) != VT_EMPTY) if(SUCCEEDED(hres) && V_VT(v) != VT_EMPTY)
return VariantCopy(var, v); return VariantCopy(var, v);
if(*event_target && (*event_target)->event_table[eid] && (*event_target)->event_table[eid]->handler_prop) { data = get_event_target_data(event_target, FALSE);
if(data && data->event_table[eid] && data->event_table[eid]->handler_prop) {
V_VT(var) = VT_DISPATCH; V_VT(var) = VT_DISPATCH;
V_DISPATCH(var) = (*event_target)->event_table[eid]->handler_prop; V_DISPATCH(var) = data->event_table[eid]->handler_prop;
IDispatch_AddRef(V_DISPATCH(var)); IDispatch_AddRef(V_DISPATCH(var));
}else { }else {
V_VT(var) = VT_NULL; V_VT(var) = VT_NULL;
......
...@@ -55,7 +55,7 @@ void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN; ...@@ -55,7 +55,7 @@ void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN;
void release_event_target(event_target_t*) DECLSPEC_HIDDEN; void release_event_target(event_target_t*) DECLSPEC_HIDDEN;
void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) 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*,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
HRESULT get_event_handler(DispatchEx*,event_target_t**,eventid_t,VARIANT*) DECLSPEC_HIDDEN; HRESULT get_event_handler(EventTarget*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
HRESULT attach_event(event_target_t**,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN; HRESULT attach_event(event_target_t**,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN; HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN;
HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN; HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
...@@ -85,7 +85,7 @@ static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT * ...@@ -85,7 +85,7 @@ static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *
static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
{ {
return get_event_handler(&node->event_target.dispex, get_node_event_target(node), eid, var); return get_event_handler(&node->event_target, eid, var);
} }
static inline HRESULT set_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var) static inline HRESULT set_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var)
......
...@@ -105,7 +105,7 @@ static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIAN ...@@ -105,7 +105,7 @@ static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIAN
return E_FAIL; return E_FAIL;
} }
return get_event_handler(&window->inner_window->event_target.dispex, &window->inner_window->doc->body_event_target, eid, var); return get_event_handler(&window->inner_window->event_target, eid, var);
} }
static void detach_inner_window(HTMLInnerWindow *window) static void detach_inner_window(HTMLInnerWindow *window)
......
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