Commit f8f8964a authored by Zhenbo Li's avatar Zhenbo Li Committed by Alexandre Julliard

mshtml: Added IHTMLFormElement::target property implementation.

parent fbc4d3f1
...@@ -286,15 +286,36 @@ static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDis ...@@ -286,15 +286,36 @@ static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDis
static HRESULT WINAPI HTMLFormElement_put_target(IHTMLFormElement *iface, BSTR v) static HRESULT WINAPI HTMLFormElement_put_target(IHTMLFormElement *iface, BSTR v)
{ {
HTMLFormElement *This = impl_from_IHTMLFormElement(iface); HTMLFormElement *This = impl_from_IHTMLFormElement(iface);
FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v)); nsAString str;
return E_NOTIMPL; nsresult nsres;
TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v));
nsAString_InitDepend(&str, v);
nsres = nsIDOMHTMLFormElement_SetTarget(This->nsform, &str);
nsAString_Finish(&str);
if (NS_FAILED(nsres)) {
ERR("Set Target(%s) failed: %08x\n", wine_dbgstr_w(v), nsres);
return E_FAIL;
}
return S_OK;
} }
static HRESULT WINAPI HTMLFormElement_get_target(IHTMLFormElement *iface, BSTR *p) static HRESULT WINAPI HTMLFormElement_get_target(IHTMLFormElement *iface, BSTR *p)
{ {
HTMLFormElement *This = impl_from_IHTMLFormElement(iface); HTMLFormElement *This = impl_from_IHTMLFormElement(iface);
FIXME("(%p)->(%p)\n", This, p); nsAString str;
return E_NOTIMPL; nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&str, NULL);
nsres = nsIDOMHTMLFormElement_GetTarget(This->nsform, &str);
return return_nsstr(nsres, &str, p);
} }
static HRESULT WINAPI HTMLFormElement_put_name(IHTMLFormElement *iface, BSTR v) static HRESULT WINAPI HTMLFormElement_put_name(IHTMLFormElement *iface, BSTR v)
......
...@@ -3775,6 +3775,27 @@ static void _test_form_reset(unsigned line, IUnknown *unk) ...@@ -3775,6 +3775,27 @@ static void _test_form_reset(unsigned line, IUnknown *unk)
IHTMLFormElement_Release(form); IHTMLFormElement_Release(form);
} }
static void test_form_target(IUnknown *unk)
{
IHTMLFormElement *form = get_form_iface(unk);
HRESULT hres;
BSTR str;
static const char target[] = "_blank";
str = a2bstr(target);
hres = IHTMLFormElement_put_target(form, str);
ok(hres == S_OK, "put_target(%s) failed: %08x\n", target, hres);
SysFreeString(str);
hres = IHTMLFormElement_get_target(form, &str);
ok(hres == S_OK, "get_target failed: %08x\n", hres);
ok(!strcmp_wa(str, target), "Expected %s, got %s\n", target, wine_dbgstr_w(str));
SysFreeString(str);
IHTMLFormElement_Release(form);
}
#define test_meta_name(a,b) _test_meta_name(__LINE__,a,b) #define test_meta_name(a,b) _test_meta_name(__LINE__,a,b)
static void _test_meta_name(unsigned line, IUnknown *unk, const char *exname) static void _test_meta_name(unsigned line, IUnknown *unk, const char *exname)
{ {
...@@ -7342,6 +7363,7 @@ static void test_elems2(IHTMLDocument2 *doc) ...@@ -7342,6 +7363,7 @@ static void test_elems2(IHTMLDocument2 *doc)
test_form_encoding((IUnknown*)elem, "multipart/form-data"); test_form_encoding((IUnknown*)elem, "multipart/form-data");
test_form_elements((IUnknown*)elem); test_form_elements((IUnknown*)elem);
test_form_reset((IUnknown*)elem); test_form_reset((IUnknown*)elem);
test_form_target((IUnknown*)elem);
IHTMLElement_Release(elem); IHTMLElement_Release(elem);
} }
......
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