Jacek Caban : mshtml: Added IDOMUIEvent::initUIEvent implementation.

Alexandre Julliard julliard at winehq.org
Tue Feb 6 15:55:48 CST 2018


Module: wine
Branch: master
Commit: f5a0252670e3d1687f2fafa5a3a6fd450b4e14c9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f5a0252670e3d1687f2fafa5a3a6fd450b4e14c9

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Feb  6 00:09:09 2018 +0100

mshtml: Added IDOMUIEvent::initUIEvent implementation.

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

---

 dlls/mshtml/htmlevent.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index 88b9e85..b788b2e 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -1219,8 +1219,31 @@ static HRESULT WINAPI DOMUIEvent_initUIEvent(IDOMUIEvent *iface, BSTR type, VARI
         VARIANT_BOOL cancelable, IHTMLWindow2 *view, LONG detail)
 {
     DOMEvent *This = impl_from_IDOMUIEvent(iface);
-    FIXME("(%p)->(%s %x %x %p %x)\n", This, debugstr_w(type), can_bubble, cancelable, view, detail);
-    return E_NOTIMPL;
+    nsAString type_str;
+    nsresult nsres;
+    HRESULT hres;
+
+    TRACE("(%p)->(%s %x %x %p %x)\n", This, debugstr_w(type), can_bubble, cancelable, view, detail);
+
+    if(This->target) {
+        TRACE("called on already dispatched event\n");
+        return S_OK;
+    }
+
+    hres = IDOMEvent_initEvent(&This->IDOMEvent_iface, type, can_bubble, cancelable);
+    if(FAILED(hres))
+        return hres;
+
+    nsAString_InitDepend(&type_str, type);
+    nsres = nsIDOMUIEvent_InitUIEvent(This->ui_event, &type_str, can_bubble, cancelable,
+                                      NULL /* FIXME */, detail);
+    nsAString_Finish(&type_str);
+    if(NS_FAILED(nsres)) {
+        FIXME("InitUIEvent failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    return S_OK;
 }
 
 static const IDOMUIEventVtbl DOMUIEventVtbl = {




More information about the wine-cvs mailing list