Commit 22cfd585 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Pass DOMEvent to call_event_handlers.

parent 8def42e7
......@@ -1073,7 +1073,7 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent)
return event;
}
static HRESULT create_event_from_nsevent(nsIDOMEvent *nsevent, DOMEvent **ret_event)
HRESULT create_event_from_nsevent(nsIDOMEvent *nsevent, DOMEvent **ret_event)
{
DOMEvent *event;
nsAString nsstr;
......@@ -1244,8 +1244,9 @@ static BOOL is_cp_event(cp_static_data_t *data, DISPID dispid)
return FALSE;
}
void call_event_handlers(HTMLEventObj *event_obj, EventTarget *event_target, eventid_t eid)
void call_event_handlers(HTMLEventObj *event_obj, EventTarget *event_target, DOMEvent *event)
{
const eventid_t eid = event->event_id;
handler_vector_t *handler_vector = get_handler_vector(event_target, eid, FALSE);
const BOOL cancelable = event_info[eid].flags & EVENT_CANCELABLE;
ConnectionPointContainer *cp_container = NULL;
......@@ -1418,7 +1419,7 @@ static void fire_event_obj(EventTarget *event_target, DOMEvent *event, HTMLEvent
IDispatchEx_AddRef(&event_target->dispex.IDispatchEx_iface);
for(i = 0; i < chain_cnt; i++) {
call_event_handlers(event_obj, target_chain[i], event->event_id);
call_event_handlers(event_obj, target_chain[i], event);
if(!(event_flags & EVENT_BUBBLES) || (event_obj && event_obj->cancel_bubble))
break;
}
......
......@@ -83,9 +83,10 @@ void bind_target_event(HTMLDocumentNode*,EventTarget*,const WCHAR*,IDispatch*) D
HRESULT ensure_doc_nsevent_handler(HTMLDocumentNode*,eventid_t) DECLSPEC_HIDDEN;
typedef struct HTMLEventObj HTMLEventObj;
void call_event_handlers(HTMLEventObj*,EventTarget*,eventid_t);
void call_event_handlers(HTMLEventObj*,EventTarget*,DOMEvent*);
HRESULT create_document_event_str(HTMLDocumentNode*,const WCHAR*,IDOMEvent**) DECLSPEC_HIDDEN;
HRESULT create_event_from_nsevent(nsIDOMEvent*,DOMEvent**) DECLSPEC_HIDDEN;
void init_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN;
void release_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN;
......
......@@ -181,16 +181,22 @@ static nsrefcnt NSAPI XMLHttpReqEventListener_Release(nsIDOMEventListener *iface
return ref;
}
static nsresult NSAPI XMLHttpReqEventListener_HandleEvent(nsIDOMEventListener *iface, nsIDOMEvent *event)
static nsresult NSAPI XMLHttpReqEventListener_HandleEvent(nsIDOMEventListener *iface, nsIDOMEvent *nsevent)
{
XMLHttpReqEventListener *This = impl_from_nsIDOMEventListener(iface);
DOMEvent *event;
HRESULT hres;
TRACE("(%p)\n", This);
if(!This->xhr)
return NS_OK;
call_event_handlers(NULL, &This->xhr->event_target, EVENTID_READYSTATECHANGE);
hres = create_event_from_nsevent(nsevent, &event);
if(SUCCEEDED(hres) ){
call_event_handlers(NULL, &This->xhr->event_target, event);
IDOMEvent_Release(&event->IDOMEvent_iface);
}
return NS_OK;
}
......
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