Commit 77cdf22f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLElement2::blur implementation.

parent 1c277a26
......@@ -776,8 +776,17 @@ static HRESULT WINAPI HTMLElement2_get_onresize(IHTMLElement2 *iface, VARIANT *p
static HRESULT WINAPI HTMLElement2_blur(IHTMLElement2 *iface)
{
HTMLElement *This = impl_from_IHTMLElement2(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
nsresult nsres;
TRACE("(%p)\n", This);
nsres = nsIDOMHTMLElement_Blur(This->nselem);
if(NS_FAILED(nsres)) {
ERR("Blur failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLElement2_addFilter(IHTMLElement2 *iface, IUnknown *pUnk)
......
......@@ -74,6 +74,7 @@ DEFINE_EXPECT(iframedoc_onreadystatechange);
DEFINE_EXPECT(img_onload);
DEFINE_EXPECT(img_onerror);
DEFINE_EXPECT(input_onfocus);
DEFINE_EXPECT(input_onblur);
DEFINE_EXPECT(form_onsubmit);
DEFINE_EXPECT(form_onclick);
DEFINE_EXPECT(submit_onclick);
......@@ -950,6 +951,17 @@ static HRESULT WINAPI input_onfocus(IDispatchEx *iface, DISPID id, LCID lcid, WO
EVENT_HANDLER_FUNC_OBJ(input_onfocus);
static HRESULT WINAPI input_onblur(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
{
CHECK_EXPECT(input_onblur);
test_event_args(&DIID_DispHTMLInputElement, id, wFlags, pdp, pvarRes, pei, pspCaller);
test_event_src("INPUT");
return S_OK;
}
EVENT_HANDLER_FUNC_OBJ(input_onblur);
static HRESULT WINAPI form_onsubmit(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
{
......@@ -1768,6 +1780,17 @@ static void test_focus(IHTMLDocument2 *doc)
CHECK_CALLED(input_onfocus);
ok(hres == S_OK, "focus failed: %08x\n", hres);
V_VT(&v) = VT_DISPATCH;
V_DISPATCH(&v) = (IDispatch*)&input_onblur_obj;
hres = IHTMLElement2_put_onblur(elem2, v);
ok(hres == S_OK, "put_onblur failed: %08x\n", hres);
SET_EXPECT(input_onblur);
hres = IHTMLElement2_blur(elem2);
pump_msgs(NULL);
CHECK_CALLED(input_onblur);
ok(hres == S_OK, "blur failed: %08x\n", hres);
if(!winetest_interactive)
ShowWindow(container_hwnd, SW_HIDE);
......
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