From 5896677d9e28f79305810d2af3d398fd4efbda6c Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 15 Feb 2018 17:05:07 +0100 Subject: [PATCH] mshtml: Added IDOMMouseEvent::buttons property implementation. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- 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 382ed6d2ba4..094ae053416 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 fe21efe131f..9fe4895bf1d 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); -- 2.11.4.GIT