Jacek Caban : mshtml: Added IHTMLEventObj::get_returnValue implementation.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue May 5 09:50:51 CDT 2015
Module: wine
Branch: master
Commit: 71cae1fcebb6d0cb78279e81b28caf663c5a9b2a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=71cae1fcebb6d0cb78279e81b28caf663c5a9b2a
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon May 4 19:14:25 2015 +0200
mshtml: Added IHTMLEventObj::get_returnValue implementation.
---
dlls/mshtml/htmlevent.c | 7 ++++---
dlls/mshtml/tests/events.c | 11 +++++++++++
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index 30ce6b1..1687aba 100644
--- a/dlls/mshtml/htmlevent.c
+++ b/dlls/mshtml/htmlevent.c
@@ -265,6 +265,7 @@ typedef struct {
HTMLDOMNode *target;
const event_info_t *type;
nsIDOMEvent *nsevent;
+ VARIANT return_value;
BOOL prevent_default;
BOOL cancel_bubble;
} HTMLEventObj;
@@ -469,6 +470,7 @@ static HRESULT WINAPI HTMLEventObj_put_returnValue(IHTMLEventObj *iface, VARIANT
return DISP_E_BADVARTYPE;
}
+ This->return_value = v;
if(!V_BOOL(&v))
This->prevent_default = TRUE;
return S_OK;
@@ -478,10 +480,9 @@ static HRESULT WINAPI HTMLEventObj_get_returnValue(IHTMLEventObj *iface, VARIANT
{
HTMLEventObj *This = impl_from_IHTMLEventObj(iface);
- FIXME("(%p)->(%p)\n", This, p);
+ TRACE("(%p)->(%p)\n", This, p);
- V_VT(p) = VT_EMPTY;
- return S_OK;
+ return VariantCopy(p, &This->return_value);
}
static HRESULT WINAPI HTMLEventObj_put_cancelBubble(IHTMLEventObj *iface, VARIANT_BOOL v)
diff --git a/dlls/mshtml/tests/events.c b/dlls/mshtml/tests/events.c
index e3e7f72..11a91da 100644
--- a/dlls/mshtml/tests/events.c
+++ b/dlls/mshtml/tests/events.c
@@ -1057,6 +1057,7 @@ static HRESULT WINAPI submit_onclick_setret(IDispatchEx *iface, DISPID id, LCID
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
{
IHTMLEventObj *event;
+ VARIANT v;
HRESULT hres;
CHECK_EXPECT(submit_onclick_setret);
@@ -1068,10 +1069,20 @@ static HRESULT WINAPI submit_onclick_setret(IDispatchEx *iface, DISPID id, LCID
ok(hres == S_OK, "get_event failed: %08x\n", hres);
ok(event != NULL, "event == NULL\n");
+ V_VT(&v) = VT_ERROR;
+ hres = IHTMLEventObj_get_returnValue(event, &v);
+ ok(hres == S_OK, "get_returnValue failed: %08x\n", hres);
+ ok(V_VT(&v) == VT_EMPTY, "V_VT(returnValue) = %d\n", V_VT(&v));
+
hres = IHTMLEventObj_put_returnValue(event, onclick_event_retval);
ok(hres == S_OK, "put_returnValue failed: %08x\n", hres);
IHTMLEventObj_Release(event);
+ V_VT(&v) = VT_ERROR;
+ hres = IHTMLEventObj_get_returnValue(event, &v);
+ ok(hres == S_OK, "get_returnValue failed: %08x\n", hres);
+ ok(VarCmp(&v, &onclick_event_retval, 0, 0) == VARCMP_EQ, "unexpected returnValue\n");
+
*pvarRes = onclick_retval;
return S_OK;
}
More information about the wine-cvs
mailing list