mshtml: Don't use fire_event in postMessage.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-10-20 15:09:52 +02:00 committed by Alexandre Julliard
parent b271b48d5b
commit 9130720e85
3 changed files with 10 additions and 2 deletions

View File

@ -1132,7 +1132,7 @@ HRESULT create_document_event_str(HTMLDocumentNode *doc, const WCHAR *type, IDOM
return S_OK;
}
static HRESULT create_document_event(HTMLDocumentNode *doc, eventid_t event_id, DOMEvent **ret_event)
HRESULT create_document_event(HTMLDocumentNode *doc, eventid_t event_id, DOMEvent **ret_event)
{
nsIDOMEvent *nsevent;
DOMEvent *event;

View File

@ -88,6 +88,7 @@ HRESULT ensure_doc_nsevent_handler(HTMLDocumentNode*,eventid_t) DECLSPEC_HIDDEN;
void fire_event_obj(EventTarget*,DOMEvent*) DECLSPEC_HIDDEN;
HRESULT create_document_event(HTMLDocumentNode*,eventid_t,DOMEvent**) DECLSPEC_HIDDEN;
HRESULT create_document_event_str(HTMLDocumentNode*,const WCHAR*,IDOMEvent**) DECLSPEC_HIDDEN;
HRESULT create_event_from_nsevent(nsIDOMEvent*,DOMEvent**) DECLSPEC_HIDDEN;

View File

@ -2161,6 +2161,8 @@ static HRESULT WINAPI HTMLWindow6_get_maxConnectionsPerServer(IHTMLWindow6 *ifac
static HRESULT WINAPI HTMLWindow6_postMessage(IHTMLWindow6 *iface, BSTR msg, VARIANT targetOrigin)
{
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
DOMEvent *event;
HRESULT hres;
FIXME("(%p)->(%s %s) semi-stub\n", This, debugstr_w(msg), debugstr_variant(&targetOrigin));
@ -2169,7 +2171,12 @@ static HRESULT WINAPI HTMLWindow6_postMessage(IHTMLWindow6 *iface, BSTR msg, VAR
return E_FAIL;
}
fire_event(This->inner_window->doc, EVENTID_MESSAGE, TRUE, &This->inner_window->event_target, NULL);
hres = create_document_event(This->inner_window->doc, EVENTID_MESSAGE, &event);
if(FAILED(hres))
return hres;
fire_event_obj(&This->inner_window->event_target, event);
IDOMEvent_Release(&event->IDOMEvent_iface);
return S_OK;
}