mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 04:49:47 +00:00
mshtml: Added IHTMLFormElement::target property implementation.
This commit is contained in:
parent
fbc4d3f160
commit
f8f8964afe
|
@ -286,15 +286,36 @@ static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDis
|
|||
static HRESULT WINAPI HTMLFormElement_put_target(IHTMLFormElement *iface, BSTR v)
|
||||
{
|
||||
HTMLFormElement *This = impl_from_IHTMLFormElement(iface);
|
||||
FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
nsAString str;
|
||||
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)
|
||||
{
|
||||
HTMLFormElement *This = impl_from_IHTMLFormElement(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsAString str;
|
||||
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)
|
||||
|
|
|
@ -3775,6 +3775,27 @@ static void _test_form_reset(unsigned line, IUnknown *unk)
|
|||
|
||||
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)
|
||||
static void _test_meta_name(unsigned line, IUnknown *unk, const char *exname)
|
||||
{
|
||||
|
@ -7342,6 +7363,7 @@ static void test_elems2(IHTMLDocument2 *doc)
|
|||
test_form_encoding((IUnknown*)elem, "multipart/form-data");
|
||||
test_form_elements((IUnknown*)elem);
|
||||
test_form_reset((IUnknown*)elem);
|
||||
test_form_target((IUnknown*)elem);
|
||||
IHTMLElement_Release(elem);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue