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

mshtml: Don't use fire_event to dispatch document and frame element readystatechange event.

parent fdf21a53
...@@ -1472,26 +1472,6 @@ void fire_event_obj(EventTarget *event_target, DOMEvent *event) ...@@ -1472,26 +1472,6 @@ void fire_event_obj(EventTarget *event_target, DOMEvent *event)
heap_free(target_chain); heap_free(target_chain);
} }
void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, EventTarget *target, nsIDOMEvent *nsevent)
{
DOMEvent *event;
HRESULT hres;
if(nsevent)
hres = create_event_from_nsevent(nsevent, &event);
else
hres = create_document_event(doc, eid, &event);
if(FAILED(hres))
return;
if(!set_event)
event->no_event_obj = TRUE;
fire_event_obj(target, event);
IDOMEvent_Release(&event->IDOMEvent_iface);
}
HRESULT dispatch_event(HTMLDOMNode *node, const WCHAR *event_name, VARIANT *event_var, VARIANT_BOOL *cancelled) HRESULT dispatch_event(HTMLDOMNode *node, const WCHAR *event_name, VARIANT *event_var, VARIANT_BOOL *cancelled)
{ {
HTMLEventObj *event_obj = NULL; HTMLEventObj *event_obj = NULL;
......
...@@ -73,7 +73,6 @@ typedef struct { ...@@ -73,7 +73,6 @@ typedef struct {
void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN; void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN;
void release_event_target(EventTarget*) DECLSPEC_HIDDEN; void release_event_target(EventTarget*) DECLSPEC_HIDDEN;
void fire_event(HTMLDocumentNode*,eventid_t,BOOL,EventTarget*,nsIDOMEvent*) DECLSPEC_HIDDEN;
HRESULT set_event_handler(EventTarget*,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 get_event_handler(EventTarget*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
HRESULT attach_event(EventTarget*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN; HRESULT attach_event(EventTarget*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
......
...@@ -443,17 +443,28 @@ HRESULT set_moniker(HTMLOuterWindow *window, IMoniker *mon, IUri *nav_uri, IBind ...@@ -443,17 +443,28 @@ HRESULT set_moniker(HTMLOuterWindow *window, IMoniker *mon, IUri *nav_uri, IBind
static void notif_readystate(HTMLOuterWindow *window) static void notif_readystate(HTMLOuterWindow *window)
{ {
DOMEvent *event;
HRESULT hres;
window->readystate_pending = FALSE; window->readystate_pending = FALSE;
if(window->doc_obj && window->doc_obj->basedoc.window == window) if(window->doc_obj && window->doc_obj->basedoc.window == window)
call_property_onchanged(&window->doc_obj->basedoc.cp_container, DISPID_READYSTATE); call_property_onchanged(&window->doc_obj->basedoc.cp_container, DISPID_READYSTATE);
fire_event(window->base.inner_window->doc, EVENTID_READYSTATECHANGE, FALSE, hres = create_document_event(window->base.inner_window->doc, EVENTID_READYSTATECHANGE, &event);
&window->base.inner_window->doc->node.event_target, NULL); if(SUCCEEDED(hres)) {
event->no_event_obj = TRUE;
fire_event_obj(&window->base.inner_window->doc->node.event_target, event);
IDOMEvent_Release(&event->IDOMEvent_iface);
}
if(window->frame_element) if(window->frame_element) {
fire_event(window->frame_element->element.node.doc, EVENTID_READYSTATECHANGE, hres = create_document_event(window->frame_element->element.node.doc, EVENTID_READYSTATECHANGE, &event);
TRUE, &window->frame_element->element.node.event_target, NULL); if(SUCCEEDED(hres)) {
fire_event_obj(&window->frame_element->element.node.event_target, event);
IDOMEvent_Release(&event->IDOMEvent_iface);
}
}
} }
typedef struct { typedef struct {
......
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