Jacek Caban : mshtml: Don't use fire_event in postMessage.

Alexandre Julliard julliard at winehq.org
Fri Oct 20 15:09:37 CDT 2017


Module: wine
Branch: master
Commit: 9130720e85a874a1b3881b25a02f3410ef13ca7f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9130720e85a874a1b3881b25a02f3410ef13ca7f

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Oct 20 15:09:52 2017 +0200

mshtml: Don't use fire_event in postMessage.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmlevent.c  | 2 +-
 dlls/mshtml/htmlevent.h  | 1 +
 dlls/mshtml/htmlwindow.c | 9 ++++++++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index 8167694..6533bb9 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -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;
diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h
index 1d99604..d8717d5 100644
--- a/dlls/mshtml/htmlevent.h
+++ b/dlls/mshtml/htmlevent.h
@@ -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;
 
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index df181d6..5dc50cc 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -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;
 }
 




More information about the wine-cvs mailing list