Commit 71cae1fc authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLEventObj::get_returnValue implementation.

parent 985d8afc
......@@ -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)
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment