Jacek Caban : mshtml: Added IDOMMouseEvent:: buttons property implementation.

Alexandre Julliard julliard at winehq.org
Thu Feb 15 14:42:29 CST 2018


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Feb 15 17:05:07 2018 +0100

mshtml: Added IDOMMouseEvent::buttons property implementation.

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

---

 dlls/mshtml/htmlevent.c     | 13 +++++++++++--
 dlls/mshtml/tests/events.js |  1 +
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index 382ed6d..094ae05 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -1515,8 +1515,17 @@ static HRESULT WINAPI DOMMouseEvent_getModifierState(IDOMMouseEvent *iface, BSTR
 static HRESULT WINAPI DOMMouseEvent_get_buttons(IDOMMouseEvent *iface, USHORT *p)
 {
     DOMEvent *This = impl_from_IDOMMouseEvent(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    UINT16 r;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsres = nsIDOMMouseEvent_GetButtons(This->mouse_event, &r);
+    if(NS_FAILED(nsres))
+        return E_FAIL;
+
+    *p = r;
+    return S_OK;
 }
 
 static HRESULT WINAPI DOMMouseEvent_get_fromElement(IDOMMouseEvent *iface, IHTMLElement **p)
diff --git a/dlls/mshtml/tests/events.js b/dlls/mshtml/tests/events.js
index fe21efe..9fe4895 100644
--- a/dlls/mshtml/tests/events.js
+++ b/dlls/mshtml/tests/events.js
@@ -642,6 +642,7 @@ function test_mouse_event() {
     ok(e.shiftKey === false, "shiftKey = " + e.shiftKey);
     ok(e.metaKey === false, "metaKey = " + e.metaKey);
     ok(e.button === 1, "button = " + e.button);
+    ok(e.buttons === 0, "buttons = " + e.buttons);
 
     e.initMouseEvent("test", false, false, window, 9, 8, 7, 6, 5, true, true, true, true, 127, document);
     ok(e.type === "test", "type = " + e.type);




More information about the wine-cvs mailing list